antd-scss-theme-plugin icon indicating copy to clipboard operation
antd-scss-theme-plugin copied to clipboard

theme.scss won't let me use @font-face

Open exzizt opened this issue 4 years ago • 3 comments

For example, adding this to my theme.scss won't let it compile due to a generic "SASS error". Any help is appreciated.

@font-face { font-family: 'BC Sans'; src: url('../assets/fonts/BCSans-Regular.woff'); }

The error:

Module build failed (from ./node_modules/antd-scss-theme-plugin/build/dist/lib/antdLessLoader.js): Could not compile the SCSS theme file "C:\Users\Luke\source\repos\bcgov\mds\services\minespace-web\src\styles\settings\theme.scss" for the purpose of variable extraction. This is likely because it contains a Sass error.

exzizt avatar Jan 19 '20 05:01 exzizt

Hi @exzizt

Are you sure the error is on that line? Can you share the whole content of your theme.scss file

refucktor avatar Jan 20 '20 13:01 refucktor

I have the same problem, but i found solution. You can use in your theme.scss only $font-family variable. Your font you can load by @font-face in other scss file in project

aproskurnov avatar Mar 06 '20 11:03 aproskurnov

@aproskurnov the $font-family in theme.scss does not support japanese word.

$font-family: "ヒラギノ角ゴ ProN W3";

same error as @exzizt

meishier avatar Jun 16 '20 06:06 meishier