Last active
December 16, 2015 22:39
-
-
Save lunelson/5508454 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com, the Sass playground.
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
// two functions to deal with removing or setting units; | |
// aliased to strip() and assert() respectively | |
@function remove-unit($n) { @return $n / ($n * 0 + 1); } | |
@function strip($n) { @return remove-unit($n); } | |
@function set-unit($n, $u) { @return remove-unit($n) * 1#{$u}; } | |
@function assert($n, $u) { @return set-unit($n, $u); } | |
.test { | |
color: remove-unit(15%); | |
width: set-unit(100,px); | |
height: assert(200px,em); | |
margin: strip(100px) auto; | |
} |
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
.test { | |
color: 15; | |
width: 100px; | |
height: 200em; | |
margin: 100 auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment