Created
November 2, 2016 14:55
-
-
Save Camwyn/b1e9241aa45788b94843c9c8adfd23de to your computer and use it in GitHub Desktop.
Mixin for creating svg icons
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
| /** | |
| * Icon | |
| * Allows easy insertion of an svg icon. | |
| * | |
| * $icon-name: name of the icon used in the symbol-defs (needs quotes) | |
| * $fill: icon fill color | |
| * $property: background-image or content? | |
| * example: @include icon('cross', '#000', content); | |
| */ | |
| @mixin icon($icon-name, $fill: false, $property: background-image) { | |
| #{$property}: url('../svg/symbol-defs.svg#icon-#{$icon-name}'); | |
| @if false != $fill { | |
| fill: $fill; | |
| } | |
| @content; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment