Skip to content

Instantly share code, notes, and snippets.

@trub
Created April 8, 2014 22:36
Show Gist options
  • Select an option

  • Save trub/10203494 to your computer and use it in GitHub Desktop.

Select an option

Save trub/10203494 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
@function em($target, $context: $default-font-size) {
$foo: $target / $context * 1em;
@return $foo;
}
@function percent($target) {
$foo: $target * 1%;
@return $foo;
}
$base-font-size: 16;
$default-font-size: 12;
html {
font-size: em($default-font-size, $base-font-size);
}
$deafult-size: 20 * 10;
.class {
font-size: percent(200);
width: percent(500);
}
html {
font-size: 0.75em;
}
.class {
font-size: 200%;
width: 500%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment