Created
December 4, 2014 11:57
-
-
Save jakob-e/87e73f3bcb3882108b33 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
| // | |
| // SCSS unit conversion | |
| // |
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.7) | |
| // Compass (v1.0.1) | |
| // ---- | |
| $ratios:( | |
| golden : (1.618, 1), | |
| typographic : ((6,7,8,9,10,11,12,14,16,18,21,24,36,48,60,72), 12) | |
| ); | |
| @mixin scale(){} | |
| @function num($val) { @return convert($val,0); } | |
| @function str($val) { @return convert($val,''); } | |
| @function px($val) { @return convert($val,0px); } | |
| @function pt($val) { @return convert($val,0pt); } | |
| @function pc($val) { @return convert($val,0pc); } | |
| @function in($val) { @return convert($val,0in); } | |
| @function mm($val) { @return convert($val,0mm); } | |
| @function cm($val) { @return convert($val,0cm); } | |
| @function deg($val) { @return convert($val,0deg); } | |
| @function rad($val) { @return convert($val,0rad); } | |
| @function grad($val){ @return convert($val,0grad); } | |
| @function turn($val){ @return convert($val,0turn); } | |
| @function convert($val,$zero-unit){ | |
| @return if(not $val, $val, | |
| if(type-of($zero-unit) == 'string', inspect($val), | |
| if(unit($zero-unit)=='', $val/($val*0+1), $zero-unit + $val | |
| ))); | |
| } | |
| .foo { font-size: px(12pt); } | |
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 { | |
| font-size: 16px; | |
| } |
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
| // | |
| // SCSS unit conversion | |
| // |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment