Skip to content

Instantly share code, notes, and snippets.

@alexlouden
Created December 18, 2013 10:28
Show Gist options
  • Save alexlouden/8020202 to your computer and use it in GitHub Desktop.
Save alexlouden/8020202 to your computer and use it in GitHub Desktop.
Sass mixin for icon font definitions (and search-replace from expanded sass definition)
@mixin icon($name, $code)
.icon-#{$name}:before
content: "#{$code}"
// Usage:
+icon(heart, \e600)
// Compiles to:
.icon-heart:before {
content: "\e600";
}
// Regex:
// \.icon\-(.+)\:before[ ]*\n 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