Created
November 4, 2014 12:36
-
-
Save jruz/929ad8238ca6443087f1 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// 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 { | |
@error "The icon named '#{$name}' was not found!"; | |
} | |
} | |
.not-found { | |
@include get-icon("asdf"); | |
} | |
.found { | |
@include get-icon("apple"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The icon named 'asdf' was not found! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment