Skip to content

Instantly share code, notes, and snippets.

@frontendbeast
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frontendbeast/49e3fe32a40ec4638fc2 to your computer and use it in GitHub Desktop.
Save frontendbeast/49e3fe32a40ec4638fc2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// 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; // Won't work
font-size: $font-size-number / 2; // Works nicely
}
p {
font-size: 1em/2;
font-size: 0.5em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment