Skip to content

Instantly share code, notes, and snippets.

@prochor666
Created October 15, 2019 07:54
Show Gist options
  • Save prochor666/a9fd5e33824e75adb50db93fca6e8c6e to your computer and use it in GitHub Desktop.
Save prochor666/a9fd5e33824e75adb50db93fca6e8c6e to your computer and use it in GitHub Desktop.
Fixed version for materialdesignicons with scssphp
@function char($character-code) {
@if function-exists("selector-append") {
@return unquote("\"\\#{$character-code}\"");
}
@if "\\#{'x'}" == "\\x" {
@return str-slice("\x", 1, 1) + $character-code;
}
@else {
@return str-slice("\x",1,1) + $character-code;
}
}
@function mdi($name) {
@if map-has-key($mdi-icons, $name) == false {
@warn "Icon #{$name} not found.";
@return "";
}
@return char(map-get($mdi-icons, $name));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment