Skip to content

Instantly share code, notes, and snippets.

@shaunbent
Created June 24, 2014 09:31
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 shaunbent/868aa1f4b7b63efdc1e2 to your computer and use it in GitHub Desktop.
Save shaunbent/868aa1f4b7b63efdc1e2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
$values: (
'font-size': 20px,
'line-height': 24px,
'--bold': (
'font-weight': bold,
'letter-spacing': -1px
)
);
@mixin output-type-class($values) {
.trafalgar {
@include output-values($values)
}
}
@mixin output-values($values) {
@each $property, $value in $values {
@if(type-of($value) == map) {
// build modifier
&#{$property} {
@include output-values($value);
}
} @else {
// output values
#{$property}: $value;
}
}
}
@include output-type-class($values);
.trafalgar {
font-size: 20px;
line-height: 24px;
}
.trafalgar--bold {
font-weight: bold;
letter-spacing: -1px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment