Skip to content

Instantly share code, notes, and snippets.

@justinhough
Last active January 19, 2023 21:52
Show Gist options
  • Save justinhough/147178547f39107cae8d1815ee08aafd to your computer and use it in GitHub Desktop.
Save justinhough/147178547f39107cae8d1815ee08aafd to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Compass (v1.0.3)
// ----
$textSizes:(
-3:(
font-size: 10px,
line-height: 14px
),
-2:(
font-size: 12px,
line-height: 16px
),
-1:(
font-size: 14px,
line-height: 20px
),
0:(
font-size: 16px,
line-height: 22px
),
1:(
font-size: 18px,
line-height: 24px
),
2:(
font-size: 20px,
line-height: 28px
),
3:(
font-size: 22px,
line-height: 30px
),
4:(
font-size: 24px,
line-height: 32px
),
5:(
font-size: 28px,
line-height: 36px
),
6:(
font-size: 32px,
line-height: 40px
),
7:(
font-size: 36px,
line-height: 44px
),
8:(
font-size: 40px,
line-height: 48px
),
9:(
font-size: 44px,
line-height: 52px
),
10:(
font-size: 48px,
line-height: 56px
),
11:(
font-size: 56px,
line-height: 64px
),
12:(
font-size: 64px,
line-height: 72px
),
13:(
font-size: 72px,
line-height: 80px
),
14:(
font-size: 88px,
line-height: 96px
),
15:(
font-size: 104px,
line-height: 116px
),
16:(
font-size: 120px,
line-height: 132px
),
17:(
font-size: 156px,
line-height: 172px
)
);
// Mixin text size classes
@mixin text-sizes($map) {
@each $keyMap, $valueMap in $map {
.text-#{$keyMap} {
font-size: map-get($valueMap, font-size);
line-height: map-get($valueMap, line-height);
}
}
}
// Output text size classes
@include text-sizes($textSizes);
@mixin responsive-font-sizes($fontSize, $mediaQuery) {
$width: 1200px;
@if $mediaQuery == md {
$width: 1200px;
}
@if $mediaQuery == lg {
$width: 1440px;
}
@media (min-width: $width) {
@each $keyMap, $valueMap in $textSizes {
@if $keyMap == $fontSize {
font-size: map-get($valueMap, font-size);
line-height: map-get($valueMap, line-height);
}
}
}
}
.fs {
&--2 {
@extend .text--3;
@include responsive-font-sizes(-2, lg);
}
&--1 {
@extend .text--2;
@include responsive-font-sizes(-1, lg);
}
&-0 {
@extend .text--1;
@include responsive-font-sizes(0, lg);
}
&-1 {
@extend .text-0;
@include responsive-font-sizes(1, lg);
}
&-2 {
@extend .text-1;
@include responsive-font-sizes(2, lg);
}
&-3 {
@extend .text-2;
@include responsive-font-sizes(4, lg);
}
&-4 {
@extend .text-3;
@include responsive-font-sizes(4, md);
@include responsive-font-sizes(6, lg);
}
&-5 {
@extend .text-4;
@include responsive-font-sizes(5, md);
@include responsive-font-sizes(8, lg);
}
&-6 {
@extend .text-5;
@include responsive-font-sizes(7, md);
@include responsive-font-sizes(11, lg);
}
&-7 {
@extend .text-6;
@include responsive-font-sizes(9, md);
@include responsive-font-sizes(13, lg);
}
&-8 {
@extend .text-8;
@include responsive-font-sizes(11, md);
@include responsive-font-sizes(14, lg);
}
&-9 {
@extend .text-10;
@include responsive-font-sizes(13, md);
@include responsive-font-sizes(15, lg);
}
&-10 {
@extend .text-11;
@include responsive-font-sizes(14, md);
@include responsive-font-sizes(16, lg);
}
&-11 {
@extend .text-12;
@include responsive-font-sizes(15, md);
@include responsive-font-sizes(17, lg);
}
}
.text--3, .fs--2 {
font-size: 10px;
line-height: 14px;
}
.text--2, .fs--1 {
font-size: 12px;
line-height: 16px;
}
.text--1, .fs-0 {
font-size: 14px;
line-height: 20px;
}
.text-0, .fs-1 {
font-size: 16px;
line-height: 22px;
}
.text-1, .fs-2 {
font-size: 18px;
line-height: 24px;
}
.text-2, .fs-3 {
font-size: 20px;
line-height: 28px;
}
.text-3, .fs-4 {
font-size: 22px;
line-height: 30px;
}
.text-4, .fs-5 {
font-size: 24px;
line-height: 32px;
}
.text-5, .fs-6 {
font-size: 28px;
line-height: 36px;
}
.text-6, .fs-7 {
font-size: 32px;
line-height: 40px;
}
.text-7 {
font-size: 36px;
line-height: 44px;
}
.text-8, .fs-8 {
font-size: 40px;
line-height: 48px;
}
.text-9 {
font-size: 44px;
line-height: 52px;
}
.text-10, .fs-9 {
font-size: 48px;
line-height: 56px;
}
.text-11, .fs-10 {
font-size: 56px;
line-height: 64px;
}
.text-12, .fs-11 {
font-size: 64px;
line-height: 72px;
}
.text-13 {
font-size: 72px;
line-height: 80px;
}
.text-14 {
font-size: 88px;
line-height: 96px;
}
.text-15 {
font-size: 104px;
line-height: 116px;
}
.text-16 {
font-size: 120px;
line-height: 132px;
}
.text-17 {
font-size: 156px;
line-height: 172px;
}
@media (min-width: 1440px) {
.fs--2 {
font-size: 12px;
line-height: 16px;
}
}
@media (min-width: 1440px) {
.fs--1 {
font-size: 14px;
line-height: 20px;
}
}
@media (min-width: 1440px) {
.fs-0 {
font-size: 16px;
line-height: 22px;
}
}
@media (min-width: 1440px) {
.fs-1 {
font-size: 18px;
line-height: 24px;
}
}
@media (min-width: 1440px) {
.fs-2 {
font-size: 20px;
line-height: 28px;
}
}
@media (min-width: 1440px) {
.fs-3 {
font-size: 24px;
line-height: 32px;
}
}
@media (min-width: 1200px) {
.fs-4 {
font-size: 24px;
line-height: 32px;
}
}
@media (min-width: 1440px) {
.fs-4 {
font-size: 32px;
line-height: 40px;
}
}
@media (min-width: 1200px) {
.fs-5 {
font-size: 28px;
line-height: 36px;
}
}
@media (min-width: 1440px) {
.fs-5 {
font-size: 40px;
line-height: 48px;
}
}
@media (min-width: 1200px) {
.fs-6 {
font-size: 36px;
line-height: 44px;
}
}
@media (min-width: 1440px) {
.fs-6 {
font-size: 56px;
line-height: 64px;
}
}
@media (min-width: 1200px) {
.fs-7 {
font-size: 44px;
line-height: 52px;
}
}
@media (min-width: 1440px) {
.fs-7 {
font-size: 72px;
line-height: 80px;
}
}
@media (min-width: 1200px) {
.fs-8 {
font-size: 56px;
line-height: 64px;
}
}
@media (min-width: 1440px) {
.fs-8 {
font-size: 88px;
line-height: 96px;
}
}
@media (min-width: 1200px) {
.fs-9 {
font-size: 72px;
line-height: 80px;
}
}
@media (min-width: 1440px) {
.fs-9 {
font-size: 104px;
line-height: 116px;
}
}
@media (min-width: 1200px) {
.fs-10 {
font-size: 88px;
line-height: 96px;
}
}
@media (min-width: 1440px) {
.fs-10 {
font-size: 120px;
line-height: 132px;
}
}
@media (min-width: 1200px) {
.fs-11 {
font-size: 104px;
line-height: 116px;
}
}
@media (min-width: 1440px) {
.fs-11 {
font-size: 156px;
line-height: 172px;
}
}
{
"sass": {
"compiler": "Ruby Sass/3.4.21",
"extensions": {
"Compass": "1.0.3"
},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment