Last active
August 29, 2015 14:21
-
-
Save frontendbeast/49e3fe32a40ec4638fc2 to your computer and use it in GitHub Desktop.
Revisions
-
frontendbeast revised this gist
May 12, 2015 . No changes.There are no files selected for viewing
-
frontendbeast revised this gist
May 12, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,6 @@ $font-size-number: em_as_number(16px); // ==================================== // p { font-size: $font-size-string / 2; // Won't work font-size: $font-size-number / 2; // Works nicely } -
frontendbeast revised this gist
May 12, 2015 . No changes.There are no files selected for viewing
-
frontendbeast revised this gist
May 12, 2015 . 1 changed file with 15 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,15 +3,25 @@ // Compass (v1.0.1) // ---- @function em_as_string($px-value) { $size: $px-value/ 16px; @return $size#{em}; } @function em_as_number($px-value) { $size: $px-value/ 16px; @return $size*1em; } $font-size-string: em_as_string(16px); $font-size-number: em_as_number(16px); // ==================================== // // type-of($font-size-string) -> string // // type-of($font-size-number) -> number // // ==================================== // p { font-size: $font-size-string / 2; font-size: $font-size-number / 2; } -
frontendbeast revised this gist
May 12, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ @function em($px-value) { $size: $px-value/ 16px; @return $size#{em}; } $font-size-function: em(16px); -
frontendbeast created this gist
May 12, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // ---- // Sass (v3.3.14) // Compass (v1.0.1) // ---- @function em($px-value) { $size: $px-value/ 16px; @return #{$size}em; } $font-size-function: em(16px); $font-size-value: 1em; p { font-size: $font-size-function / 2; font-size: $font-size-value / 2; } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ p { font-size: 1em/2; font-size: 0.5em; }