sunflowerdeath / webfonts-generator

Generator of webfonts from svg icons
The Unlicense
271 stars 152 forks source link

scss template doesn't write correct charcode #33

Open nguyenphucthanh opened 7 years ago

nguyenphucthanh commented 7 years ago

hello.

I'm using webpack, and this loader https://github.com/jeerbl/webfonts-loader. This loader uses webfonts-generator under the hood. And there's only one problem with the scss template - mixin webfont-icon, it doesn't write correct charcode (missing \ in "content").

I cloned the template and changed a bit in the code, and it works well. I think you can consider it as a workaround.

@mixin webfont-icon($name) {
    line-height: 1;

    $icon: map-get($webfont-icons, $name);
    $character-code: "\"\\" + nth($icon, 2) + "\"";
    &:before {
        font-family: nth($icon, 1) !important;
        font-style: normal;
        font-weight: normal !important;
        vertical-align: top;
        content: #{$character-code};
    }
}