I have a simple mixin like this:
@mixin icon_fn($glyph) {
&::before {content: "\e#{$glyph}";}
}
so that I can use it as simply as @include @icon_fn("9fa")
but for some reason there's always a space between \e
and the variable. Can't figure out a way to get rid of it..
-- After using function from the other thread
@function str-remove-whitespace($str) {
@while (str-index($str, ' ') != null) {
$index: str-index($str, ' ');
$str: "#{str-slice($str, 0, $index - 1)}#{str-slice($str, $index + 1)}";
}
@return $str;
}
@mixin icon_fn($glyph) {
$theglyph: "\e#{$glyph}";
&::before {content: str-remove-whitespace($theglyph);}
}