-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed commit of the following: commit 8736da0 Author: Francesco Improta <[email protected]> Date: Thu Apr 1 14:34:47 2021 +0200 Updated README commit 29ddc34 Author: Francesco Improta <[email protected]> Date: Thu Apr 1 12:19:55 2021 +0200 Added What Is to readme commit fd074e5 Author: Francesco Improta <[email protected]> Date: Tue Mar 30 15:11:20 2021 +0200 Changed README commit ab4900d Author: Francesco Improta <[email protected]> Date: Tue Mar 30 15:11:15 2021 +0200 Bumped version commit 153a78f Author: Francesco Improta <[email protected]> Date: Tue Mar 30 15:11:07 2021 +0200 Breakpoint is a parameter commit 5f74a8d Author: Francesco Improta <[email protected]> Date: Tue Mar 30 12:14:59 2021 +0200 Simplified library inclusion commit 92b2389 Author: Francesco Improta <[email protected]> Date: Mon Mar 29 16:08:04 2021 +0200 Added $rhythm variable commit b03ae2a Author: Francesco Improta <[email protected]> Date: Thu Mar 25 17:06:55 2021 +0100 Added demo page commit dbd34ce Author: Francesco Improta <[email protected]> Date: Thu Mar 25 17:06:51 2021 +0100 Added more info commit f04e049 Author: Francesco Improta <[email protected]> Date: Thu Mar 25 17:06:44 2021 +0100 Renamed base font size commit 0032381 Author: Francesco Improta <[email protected]> Date: Thu Mar 25 17:06:30 2021 +0100 Added ratio and bp option to mixin commit 5017683 Author: Francesco Improta <[email protected]> Date: Thu Mar 25 17:05:58 2021 +0100 Using Custom Properties for vertical rhythm commit c885b10 Author: Francesco Improta <[email protected]> Date: Thu Mar 25 17:05:39 2021 +0100 New default files commit 7b97fab Author: Francesco Improta <[email protected]> Date: Thu Mar 25 17:05:08 2021 +0100 Packages update
- Loading branch information
1 parent
f6bc679
commit dd4e8d2
Showing
10 changed files
with
225 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,67 @@ | ||
.canon { | ||
:root { | ||
--baseline: 4px; | ||
--ratio: 1.25; | ||
} | ||
|
||
.type-canon { | ||
font-size: 2rem; | ||
line-height: calc(1em + 4px); | ||
line-height: calc(1em + var(--baseline)); | ||
} | ||
|
||
@media screen and (min-width: 740px) { | ||
.canon { | ||
.type-canon { | ||
font-size: 2.25rem; | ||
} | ||
} | ||
|
||
.doublepica { | ||
.type-doublepica { | ||
font-size: 1.75rem; | ||
line-height: calc(1em + 4px); | ||
line-height: calc(1em + var(--baseline)); | ||
} | ||
|
||
@media screen and (min-width: 740px) { | ||
.doublepica { | ||
.type-doublepica { | ||
font-size: 2rem; | ||
} | ||
} | ||
|
||
.paragon { | ||
.type-paragon { | ||
font-size: 1.625rem; | ||
line-height: calc(1em + 4px); | ||
line-height: calc(1em + var(--baseline)); | ||
} | ||
|
||
@media screen and (min-width: 740px) { | ||
.paragon { | ||
.type-paragon { | ||
font-size: 1.75rem; | ||
} | ||
} | ||
|
||
.columbian { | ||
.type-columbian { | ||
font-size: 1.5rem; | ||
line-height: calc(1em + 4px); | ||
line-height: calc(1em + var(--baseline)); | ||
} | ||
|
||
.primer { | ||
.type-primer { | ||
font-size: 1.25rem; | ||
line-height: calc(1em + 4px); | ||
line-height: calc(1em + var(--baseline)); | ||
} | ||
|
||
.type-english { | ||
font-size: 1.125rem; | ||
line-height: calc(1em + var(--baseline)); | ||
} | ||
|
||
.pica { | ||
.type-pica { | ||
font-size: 1rem; | ||
line-height: calc(1em + 4px); | ||
line-height: calc(1em + var(--baseline)); | ||
} | ||
|
||
.brevier { | ||
.type-brevier { | ||
font-size: 0.875rem; | ||
line-height: calc(1em + 4px); | ||
line-height: calc(1em + var(--baseline)); | ||
} | ||
|
||
.minion { | ||
.type-minion { | ||
font-size: 0.75rem; | ||
line-height: calc(1em + 4px); | ||
line-height: calc(1em + var(--baseline)); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
|
||
<link rel="stylesheet" href="dist/typesmith.css"> | ||
</head> | ||
<body> | ||
|
||
<h1 class="type-canon">Heading title (Canon)</h1> | ||
|
||
<h2 class="type-doublepica">Heading title (Double Pica)</h2> | ||
|
||
<h3 class="type-paragon">Heading title (Paragon)</h3> | ||
|
||
<h4 class="type-columbian">Heading title (Columbian)</h4> | ||
|
||
<h5 class="type-primer">Heading title (Primer)</h5> | ||
|
||
<h5 class="type-english">Heading title (English)</h5> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,49 @@ | ||
// TYPESMITH TOOLS | ||
// @author Francesco Improta | ||
|
||
// Px to Rem | ||
// Convert any size expressed in 'px' to 'rem' | ||
/// Px to Rem | ||
/// Convert any size expressed in 'px' to 'rem' | ||
|
||
@function rem($value) { | ||
$rem-value: $value / $base; | ||
$rem-value: $value / $base-font-size; | ||
@return #{$rem-value}rem; | ||
} | ||
|
||
// Return type value from types map, specifying what $size you need | ||
/// Return type value from types map, specifying what $size you need | ||
|
||
@function type-size($type, $size) { | ||
@return map-get(map-get($types, $type), $size); | ||
} | ||
|
||
// Resposive type size based on type map values - media query is defined in it, not editable | ||
@mixin type-size($type) { | ||
/// Resposive type size based on type map values - media query is defined in it, not editable | ||
/// @param {String} $rhythm - The vertical rhythm condition - Must be 'baseline' or 'ratio' | ||
|
||
@mixin type-size($type, $bp: medium, $rhythm: 'ratio') { | ||
$size-small-px: type-size($type, small); | ||
$size-base-px: type-size($type, base); | ||
|
||
@if map-has-key(map-get($types, $type), small) { | ||
font-size: rem($size-small-px); | ||
|
||
@include bp(md) { | ||
@include bp($bp) { | ||
font-size: rem($size-base-px); | ||
} | ||
} @else { | ||
font-size: rem($size-base-px); | ||
} | ||
|
||
line-height: calc(1em + #{$baseline}); | ||
@if $rhythm != 'ratio' { | ||
line-height: calc(1em + var(--baseline)); | ||
} @else { | ||
line-height: calc(1em * var(--ratio)); | ||
} | ||
} | ||
|
||
// Loop throught types map printing classnames based on type names | ||
// Remove // to enable classes | ||
// @each $type, $sizes in $types { | ||
// .#{$type} { | ||
// @include type-size($type) | ||
// } | ||
// } | ||
/// Loop throught types map printing classnames based on type names to enable classes | ||
/// | ||
/// @param {String} $rhythm - The vertical rhythm condition - Must be 'baseline' or 'ratio' | ||
|
||
@if $typesmith-classes == true { | ||
@each $type, $sizes in $types { | ||
.type-#{$type} { | ||
@include type-size($type, $bp, $rhythm) | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.