Created
August 29, 2014 05:46
-
-
Save jakob-e/9fcb2375b3c57e961e8a 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
<div id="scssdebug">scssdebug</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
// ---- | |
// Sass (v3.4.1) | |
// Compass (v1.0.1) | |
// ---- | |
@function isNaN($val) { @return type-of($val)!=number; } | |
@function conv($val, $to-unit){ | |
$from-unit:unit($val); | |
$conv-unit:1px - 1px; | |
@return $conv-unit + $val; | |
} | |
@function convert-to-unit($string){ | |
$units:(px:1px, px:1pt, pc:1pc, in:1in, mm:1mm, cm:1cm, // Absolute | |
em:1em, rem:1rem, ch:1ch, ex:1ex, // Relative - font based | |
vv:1vw, vh:1vh, vmin:1vmin, vmax:1vmax, // Relative - viewport based | |
deg:1deg, turn:1turn, grad:1grad, // Angles | |
s:1s, ms:1ms, // Time | |
hz:1hz, kHz:1khz, // Frequencies | |
dpi:1dpi, dpcm:1dpcm, dppx:1dppx // Resolutions | |
); | |
$index: index($strings, $unit); | |
} | |
.foo { hey:conv(120pt,px) } |
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
.foo { | |
hey: 160px; | |
} |
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
<div id="scssdebug">scssdebug</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment