Skip to content

Instantly share code, notes, and snippets.

@elussich
Created February 4, 2015 16:19
Show Gist options
  • Select an option

  • Save elussich/837e9b279a5beedbc87e to your computer and use it in GitHub Desktop.

Select an option

Save elussich/837e9b279a5beedbc87e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="h1">Aflsdkfjsd sdfdsflj</div>
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
$typeset: (
'h1': regular 21px 15px,
'h2': bold 14px 15px,
);
@mixin regular {
font-weight: normal;
}
@mixin type($name) {
$props: map-get($typeset, $name);
@if nth($props, 1) == 'regular' {
@include regular;
};
@include t( nth($props, 2), nth($props, 3) );
}
@mixin t($size, $height: normal) {
font-size: $size;
line-height: $height;
}
@each $name, $props in $typeset {
.#{$name} {
@include type($name);
}
}
.h1 {
font-weight: normal;
font-size: 21px;
line-height: 15px;
}
.h2 {
font-size: 14px;
line-height: 15px;
}
<div class="h1">Aflsdkfjsd sdfdsflj</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment