Skip to content

Instantly share code, notes, and snippets.

@MichaelArestad
Created August 11, 2014 17:00
Show Gist options
  • Save MichaelArestad/b5d7f80e93aaf0b8e197 to your computer and use it in GitHub Desktop.
Save MichaelArestad/b5d7f80e93aaf0b8e197 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
$root-font:(
color: #222,
font-family: Open Sans,
font-size: 10,
font-weight: normal,
line-height: 1.6,
modular-base--primary: 18,
modular-base--secondary: 620,
modular-multiplier: 1.3,
);
@function size(
$exponent,
$multiplier: map-get($root-font, modular-multiplier),
$base--primary: map-get($root-font, modular-base--primary),
$base--secondary: map-get($root-font, modular-base--secondary)
) {
$value: $multiplier * $base--primary;
@if $exponent > 1 {
$value: $multiplier * $base--primary;
$secondary: $multiplier * $base--secondary;
@if $exponent % 2 == 0 {
$value: $multiplier * $base--secondary;
}
@for $i from 2 through $exponent {
$value: $value * $multiplier;
}
}
@if $exponent < 1 {
$value: $multiplier * $base--primary;
@for $i from 0 through -$exponent {
$value: $value / $multiplier;
}
}
@return $value;
}
@function em($value, $context: map-get($root-font, font-size)) {
@return ($value / $context * 1em);
}
// show numbers
h1 {
font-size: size(-3);
font-size: size(-2);
font-size: size(-1);
font-size: size(1);
font-size: size(2);
font-size: size(3);
}
// change some stuff
h2 {
// changed modifier
font-size: size(2, 1.2);
// changed base multiplier
font-size: em(size(2,20));
}
// for realsies
div {
font-size: em(26.17924);
font-size: em(size(2));
h1 {
font-size: em(42.35801,26.17924);
font-size: em(size(3),size(2));
}
}
h1 {
font-size: 8.19299;
font-size: 10.65089;
font-size: 13.84615;
font-size: 23.4;
font-size: 1047.8;
font-size: 39.546;
}
h2 {
font-size: 892.8;
font-size: 24800em;
}
div {
font-size: 2.61792em;
font-size: 104.78em;
}
div h1 {
font-size: 1.618em;
font-size: 0.03774em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment