Last active
February 7, 2018 14:37
-
-
Save 19h47/310c0551045ee33074cdf2277af98f71 to your computer and use it in GitHub Desktop.
Fonts placeholder and utility classes
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
/** | |
* Font | |
* | |
* A map containing all information about fonts | |
* | |
* @type map | |
*/ | |
$font: ( | |
/** | |
* Font weights | |
* | |
* Each font weight used in the theme. | |
* | |
* @uses map-get( $font, weights ) to retrieve font weight value | |
* @type map | |
*/ | |
weights: ( | |
extralight: 100, | |
light: 200, | |
book: 300, | |
regular: 400, | |
medium: 500, | |
semibold: 600, | |
bold: 700, | |
extrabold: 800, | |
extrablack: 900 | |
), | |
/** | |
* Font styles | |
* | |
* Each font style used in the theme. | |
* | |
* @uses map-get( $font, styles ) to retrieve font style value | |
* @type list | |
*/ | |
styles: 'italic', | |
); | |
/** | |
* Font styles | |
* | |
* Constructor class for each font styles found in map-get( $font, styles ) | |
* | |
* @param $style name of style font in map map-get( $font, styles ) | |
*/ | |
@each $style in map-get( $font, styles ) { | |
%font-style-#{ $style } { | |
font-style: unquote( $style ); | |
} | |
.font-style-#{ $style } { | |
@extend %font-style-#{ $style }; | |
} | |
} | |
/** | |
* Font weight | |
* | |
* Constructor class for each font weight found in map-get( $font, weights ) | |
* | |
* @param $weight-name name of weight | |
* @param $weight-value value of weight | |
*/ | |
@each $weight-name, $weight-value in map-get( $font, weights ) { | |
%font-weight-#{ $weight-name } { | |
font-weight: #{ $weight-value }; | |
} | |
.font-weight-#{ $weight-name } { | |
@extend %font-weight-#{ $weight-name }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment