Skip to content

Instantly share code, notes, and snippets.

@davidhellmann
Created May 17, 2021 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidhellmann/5dd6d92238f273e18456838cfa56584c to your computer and use it in GitHub Desktop.
Save davidhellmann/5dd6d92238f273e18456838cfa56584c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
/*
// build the clamp property
const clamp = (multiMin = 0, multiMax = null) => {
const _calcMulti = calcMulti(multiMin, multiMax || multiMin)
const _fsMin = _calcMulti.fsMin
const _fsMax = _calcMulti.fsMax
return `clamp(${_fsMin}rem, calc(${_fsMin}rem + (${_fsMax} - ${_fsMin}) * ((100vw - ${screenMin}rem) / (${screenMax} - ${screenMin}))), ${_fsMax}rem)`
}
*/
@mixin clamp($properties: font-size, $min: 0.5rem, $max: 1rem) {
@each $property in $properties {
#{$property}: $min-value;
}
}
.div {
@include clamp();
}
/*
// build the clamp property
const clamp = (multiMin = 0, multiMax = null) => {
const _calcMulti = calcMulti(multiMin, multiMax || multiMin)
const _fsMin = _calcMulti.fsMin
const _fsMax = _calcMulti.fsMax
return `clamp(${_fsMin}rem, calc(${_fsMin}rem + (${_fsMax} - ${_fsMin}) * ((100vw - ${screenMin}rem) / (${screenMax} - ${screenMin}))), ${_fsMax}rem)`
}
*/
{
"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