Created
May 16, 2018 05:19
-
-
Save LeaVerou/7fc3668ee1780483034852738f873ed5 to your computer and use it in GitHub Desktop.
Variable fonts for non-variable weights across sizes.
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
/** | |
* Variable fonts for non-variable weights across sizes. | |
*/ | |
@import url('https://variablefonts.monotype.com/MetaVariableDemo-Set.css'); | |
span { | |
display: block; | |
font-size: calc(var(--size, 1) * 100%); | |
xfont-weight: calc(100 + var(--size, 1) * 100); | |
font-weight: 200 | |
} | |
span:nth-child(1) { font-weight: 200; } | |
span:nth-child(2) { font-weight: 100; } | |
span:nth-child(3) { font-weight: 180; } | |
h1 { | |
text-align: center; | |
text-transform: uppercase; | |
font: 1800%/.85 FF Meta VF, sans-serif; | |
margin: 4rem; | |
} |
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
<h1> | |
<span style="--size: .32">Awesome</span> | |
<span style="--size: 1">CSS</span> | |
<span style="--size: .4">Secrets</span> | |
</h1> |
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
// alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment