Skip to content

Instantly share code, notes, and snippets.

@mattpilott
Created September 15, 2021 22:42
Show Gist options
  • Save mattpilott/5c1ab1145d6b87fde3d69e29338d1228 to your computer and use it in GitHub Desktop.
Save mattpilott/5c1ab1145d6b87fde3d69e29338d1228 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
$wrap: 1920;
@mixin clamp($prop, $min, $max, $multi: 100vw) {
$multi: ($max / $wrap) * 100;
#{$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);
}
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.15625rem), 3rem);
--h1: clamp(2rem, 0.15625rem, 3rem);
}
{
"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