Skip to content

Instantly share code, notes, and snippets.

@fubhy
Created November 20, 2013 18:00
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 fubhy/7567912 to your computer and use it in GitHub Desktop.
Save fubhy/7567912 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
$base-font-size: 14px;
// =============================================================================
// sass/abstraction/_units.scss
// =============================================================================
// Custom function to convert px values into em relative to the base font size.
@function em($target, $context: $base-font-size) {
@if $target == 0 {
@return 0
}
@return $target / $context * 1em;
}
// =============================================================================
// Proof of concept.
// =============================================================================
.foo-test {
width: em(140px);
}
.foo-test {
width: 10em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment