Created
July 6, 2021 10:21
-
-
Save ffoodd/fad02650787cd3de954cd209ccbadfbe 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
@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; | |
} | |
@return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2); | |
} | |
@function subtract($value1, $value2, $return-calc: true) { | |
@if $value1 == null and $value2 == null { | |
@return null; | |
} | |
@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($value2) != number { | |
$value2: unquote("(") + $value2 + unquote(")"); | |
} | |
@return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2); | |
} | |
$add: add(1rem, 1em, false); | |
$subtract: subtract(1rem, 1em, false); | |
a { | |
font-size: add(1vw, $add); | |
font-size: add(1vw, $subtract); | |
font-size: subtract(1vw, $add); | |
font-size: subtract(1vw, $subtract); | |
} |
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
a { | |
font-size: calc(1vw + 1rem + 1em); | |
font-size: calc(1vw + 1rem - 1em); | |
font-size: calc(1vw - (1rem + 1em)); | |
font-size: calc(1vw - (1rem - 1em)); | |
} |
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