Skip to content

Instantly share code, notes, and snippets.

@kasteph
Forked from alexlouden/icon_mixin.sass
Created April 23, 2014 03:16
Show Gist options
  • Save kasteph/11201738 to your computer and use it in GitHub Desktop.
Save kasteph/11201738 to your computer and use it in GitHub Desktop.
@mixin icon($name, $code)
.icon-#{$name}:before
content: "#{$code}"
// Usage:
+icon(heart, \e600)
// Compiles to:
.icon-heart:before {
content: "\e600";
}
// Regex: (css to sass mixin)
// \.icon\-(.+)\:before[ ]* \{\n\s+content: "([\\e0-9a-f]+)";\n\}
// +icon(\1, \2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment