Skip to content

Instantly share code, notes, and snippets.

@sebastiano-guerriero
Last active July 18, 2018 07:58
Show Gist options
  • Save sebastiano-guerriero/6b55e6bdd26941ef647ea7e2a4aa98bf to your computer and use it in GitHub Desktop.
Save sebastiano-guerriero/6b55e6bdd26941ef647ea7e2a4aa98bf to your computer and use it in GitHub Desktop.
:root {
/* set base values */
--text-base-size: 1em;
--text-scale-ratio: 1.2;
/* type scale */
--text-xs: calc(1em / (var(--text-scale-ratio) * var(--text-scale-ratio)));
--text-sm: calc(1em / var(--text-scale-ratio));
--text-md: calc(1em * var(--text-scale-ratio));
--text-lg: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio));
--text-xl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
}
@include breakpoint(md) {
:root {
// you can manage typography editing only these 2 variables
--text-base-size: 1.25em;
--text-scale-ratio: 1.25;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment