Skip to content

Instantly share code, notes, and snippets.

@Bachana123
Created November 29, 2019 09:54
Show Gist options
  • Save Bachana123/5310463976271ec56c1500c94e1fa188 to your computer and use it in GitHub Desktop.
Save Bachana123/5310463976271ec56c1500c94e1fa188 to your computer and use it in GitHub Desktop.
Fonts on different languages
//
/// @group Fonts
/// @access public
/// @param {string} $lang-code
/// @param {string} $font-family
/// @param {string} $font-size
/// @example body{ @include fonts('ka','bpg-nino-mtavruli',18px) }
/// @return
/// html[lang="ka"]{ body{ font-family: 'bpg-nino-mtavruli; font-size: 18px;} }
//
@mixin fonts($fonts...){
$lang-list: "ka","en";
$lang-code: nth($fonts,1);
@if(contains($lang-list,$lang-code)){
html[lang="#{$lang-code}"] &{
@if(length($fonts) > 1){
font-family: nth($fonts,2);
}
@if(length($fonts) > 2){
font-size: nth($fonts,3);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment