Last active
January 8, 2020 16:17
-
-
Save nathansmith/208af93d0b4bfff43e98a4c08beb22d7 to your computer and use it in GitHub Desktop.
Sass font override example
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
// ================== | |
// In variables file. | |
// ================== | |
$font-size-h1: 2.2rem !default; | |
$font-family-h1: inherit !default; | |
$font-weight-h1: inherit !default; | |
// ================= | |
// In headings file. | |
// ================= | |
h1 { | |
font-size: $font-size-h1; | |
font-weight: $font-weight-h1; | |
/* | |
In all browsers, `font-family` | |
behaves like "inherit" by default. | |
So we only need this if it has | |
been set to something specific. | |
*/ | |
@if ($font-family-h1 != inherit) { | |
font-family: $font-family-h1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment