Last active
December 9, 2019 16:55
-
-
Save starryeyez024/e6d0b59724f6a9d966769c2d260a0d84 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
> 1% | |
last 2 versions |
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
<br/> | |
<div class="single"><p>single</p></div> | |
<div class="double"><p>double</p></div> | |
<div class="test"><p>test</p></div> |
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
// ---- | |
// libsass (v3.5.4) | |
// ---- | |
// redhat-theme | |
:root { | |
--foo: 15px; | |
} | |
$padding: var( --foo); | |
// Use the calc function like this | |
$padding-double: calc( var( --foo, 12px) * 2) ; | |
// interpolate when a sass var is inside a calc function: | |
$padding-double: calc( #{$padding} * 2) ; | |
// This won't work: | |
//$padding-double: #{var( --foo, 12px)} * 2 ; | |
//$padding-double: $padding * 2 ; | |
// USE CASE EXAMPLES | |
.single { | |
padding: $padding; | |
} | |
.double { | |
padding: $padding-double; | |
} | |
// interpolate when a sass var is inside a calc function | |
.test { | |
padding: calc(5% - #{$padding-double}); | |
} | |
// for demo | |
div {background: #eee;width: 300px;margin: 10px;float: left;} |
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
<br/> | |
<div class="single"><p>single</p></div> | |
<div class="double"><p>double</p></div> | |
<div class="test"><p>test</p></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment