Last active
August 29, 2015 14:07
-
-
Save LukyVj/315234eb782038755f66 to your computer and use it in GitHub Desktop.
This morning while browsing twitter, I've found a tweet from @davidkaneda : "Does anyone have a CSS trick (ahem, @chriscoyier) for changing font-weight based on available/used font?" And it gave me the idea of this small sass snippet. By the way, this is not what he meant. But it's still cool.
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 morning while browsing twitter, I've found a tweet from @DavidKaneda : | |
"Does anyone have a CSS trick (ahem, @chriscoyier) for changing font-weight | |
based on available/used font?" | |
And it gave me the idea of this small sass snippet. | |
By the way, this is not what he meant. But it's still cool. | |
*/ | |
$font: 'font-a'; | |
$font: 'font-b'; | |
@mixin fontWeight($font){ | |
@if($font == 'font-a'){ | |
font-weight: 900; | |
} | |
@else{ | |
font-weight: 600; | |
} | |
} | |
p{ | |
@include fontWeight($font); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment