Sass - Setting the font family with material web components

淺唱寂寞╮ 提交于 2019-12-13 01:44:55

问题


I am using material web components in my project and I would like to change the font family. I was going through their documentation and I have tried to do that by setting the variable in my sass file like this:

$mdc-typography-font-family: Comfortaa, sans-serif !default;

But, that didn't work, in the documentation it also says that sass mixin sets the font:

mdc-typography-base 

How can I change the mixin to use a different font-family?


回答1:


I figured this out by removing !default flag:

$mdc-typography-font-family: Comfortaa, sans-serif;

Also, don't forget to embed Google Fonts in the head tag:

<link href="https://fonts.googleapis.com/css?family=Comfortaa" rel="stylesheet">


来源:https://stackoverflow.com/questions/48403114/sass-setting-the-font-family-with-material-web-components

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!