Skip to content

Instantly share code, notes, and snippets.

@jruz
Last active August 29, 2015 14:08
Show Gist options
  • Save jruz/09f31d13d1f8974a85a7 to your computer and use it in GitHub Desktop.
Save jruz/09f31d13d1f8974a85a7 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$icons-map: (
apple: "\x01",
android: "\x02");
@each $name, $code in $icons-map {
.icon-#{$name} {
content: $code;
}
}
@mixin get-icon($name){
@if map-has-key($icons-map, $name){
content: map-get($icons-map, $name);
font-family: 'Chameleon custom icons';
}
@else {
// this should be changed to @error on sass >= 3.4
@warn "The icon named '#{$name}' was not found!";
}
}
.not-found {
@include get-icon("asdf");
}
.found {
@include get-icon("apple");
}
.icon-apple {
content: "x01";
}
.icon-android {
content: "x02";
}
.found {
content: "x01";
font-family: 'Chameleon custom icons';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment