Skip to content

Instantly share code, notes, and snippets.

@mattpilott
Last active September 15, 2021 23:14
Show Gist options
  • Save mattpilott/543148ec99d9d48e5338053e5fc5a6c2 to your computer and use it in GitHub Desktop.
Save mattpilott/543148ec99d9d48e5338053e5fc5a6c2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
$wrap: 1920px;
@function strip($number) {
@if type-of($number) == 'number' and not unitless($number) {
@return $number / ($number * 0 + 1);
}
@return $number;
}
@function clampy($min, $max, $multi: (strip($max) / strip($wrap)) * 100vw) {
@return min(max(#{$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);
--h1: #{clampy(2rem, 3rem)} / 1.3 var(--family);
}
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) / 1.3 var(--family);
}
{
"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