Last active
September 27, 2017 14:37
-
-
Save joakin/0b63a94078ddbb655781bfc733d590d5 to your computer and use it in GitHub Desktop.
Font size scale with CSS vars and calc
This file contains hidden or 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
:root { | |
--font-size-factor: 1.125; | |
--font-size-base: 1em; | |
--font-size-caption: calc(var(--font-size-note) / var(--font-size-factor)); | |
--font-size-note: calc(var(--font-size-base) / var(--font-size-factor)); | |
--font-size-h5: calc(var(--font-size-base) * var(--font-size-factor)); | |
--font-size-h4: calc(var(--font-size-h5) * var(--font-size-factor)); | |
--font-size-h3: calc(var(--font-size-h4) * var(--font-size-factor)); | |
--font-size-h2: calc(var(--font-size-h3) * var(--font-size-factor)); | |
--font-size-h1: calc(var(--font-size-h2) * var(--font-size-factor)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment