Skip to content

Instantly share code, notes, and snippets.

@LukyVj
Last active August 29, 2015 14:07
Show Gist options
  • Save LukyVj/315234eb782038755f66 to your computer and use it in GitHub Desktop.
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 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