Created
May 20, 2021 14:50
-
-
Save ffoodd/a26bcc11efaab95ad77ace47030129dd to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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
@function add($value1, $value2, $return-calc: true) { | |
@if $value1 == null { | |
@return $value2; | |
} | |
@if $value2 == null { | |
@return $value1; | |
} | |
@if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) { | |
@return $value1 + $value2; | |
} | |
@if type-of($value1) != number { | |
$value1: unquote("(") + $value1 + unquote(")"); | |
} | |
@if type-of($value2) != number { | |
$value2: unquote("(") + $value2 + unquote(")"); | |
} | |
@if $return-calc == true { | |
@return calc(#{$value1} + #{$value2}); | |
} | |
@return $value1 + unquote(" + ") + $value2; | |
} | |
$value: add(1rem, 1em, false); | |
a { | |
font-size: add(1vw, $value); | |
type: type-of($value); | |
} | |
b { | |
font-size: add(1rem, 1em); | |
} |
This file contains hidden or 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
a { | |
font-size: calc(1vw + (1rem + 1em)); | |
type: string; | |
} | |
b { | |
font-size: calc(1rem + 1em); | |
} |
This file contains hidden or 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