Skip to content

Instantly share code, notes, and snippets.

@justb3a
Created June 14, 2016 12:33
Show Gist options
  • Save justb3a/8696a8a536523c8d42a79a4fcf0a2ecc to your computer and use it in GitHub Desktop.
Save justb3a/8696a8a536523c8d42a79a4fcf0a2ecc to your computer and use it in GitHub Desktop.
frickelbase
// a mixin for positioning svg icons
// ======================================================================
// usage examples:
//
// @include sprite; ==> width: 1em; height: 1em;
// @include sprite(18px, 50px, $color-second); => width: 18px; height: 50px; fill: $color-second;
// @include sprite(1, 2, none, $color-second, 2px); width: $base-unit; height: $base-double; stroke: $color-second; stroke-width: 2px;
@mixin sprite($width: 1em, $height: 1em, $fill: none, $stroke: none, $stroke-width: none) {
width: parse-unit($width);
height: parse-unit($height);
@if $fill != none {
fill: $fill;
}
@if $stroke != none {
stroke: $stroke;
stroke-width: parse-unit($stroke-width);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment