Created
September 15, 2021 22:54
-
-
Save mattpilott/998a11ed0dbd7c7b95473899f41eee16 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
$wrap: 1920; | |
@function strip-unit($number) { | |
@if type-of($number) == 'number' and not unitless($number) { | |
@return $number / ($number * 0 + 1); | |
} | |
@return $number; | |
} | |
@mixin clamp($prop, $min, $max, $multi: 100vw) { | |
$multi: (strip-unit($max) / $wrap) * 100vw; | |
#{$prop}: min(max(#{$min}, #{$multi}), #{$max}); | |
#{$prop}: clamp(#{$min}, #{$multi}, #{$max}); | |
} | |
html { | |
--family: -apple-system, Roboto, sans-serif; | |
--h1: 3rem / 1.3 var(--family); | |
--h2: 2.5rem / 1.3 var(--family); | |
--h3: 2.25rem / 1.3 var(--family); | |
@include clamp(--h1, 2rem, 3rem); | |
} |
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
html { | |
--family: -apple-system, Roboto, sans-serif; | |
--h1: 3rem / 1.3 var(--family); | |
--h2: 2.5rem / 1.3 var(--family); | |
--h3: 2.25rem / 1.3 var(--family); | |
--h1: min(max(2rem, 0.15625vw), 3rem); | |
--h1: clamp(2rem, 0.15625vw, 3rem); | |
} |
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
{ | |
"sass": { | |
"compiler": "dart-sass/1.32.12", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment