更改 uikit 的默认 CSS 字体

twi*_*igg 0 css uikit getuikit

你会更改 uikit 的默认字体吗?用户界面工具包

默认字体是

"Helvetica Neue",Helvetica,Arial,sans-serif 
Run Code Online (Sandbox Code Playgroud)

并将其设置在 html 元素标签上。如果我将 html 标签中自定义样式的字体更改为其他字体,则不会覆盖更改。我可以使用确实改变事情的重要:

html {
     font: 'Raleway', sans-serif !important;
}
Run Code Online (Sandbox Code Playgroud)

这会按预期更改全局字体,font-awesome 显然不再起作用,因为 !important 已覆盖它。有任何想法吗?

Tom*_*Tom 5

这已经很旧了,但无论如何我都会发布当前的工作答案,以防其他人需要它用于版本 3,如此处所述

// 1. Your custom variables and variable overwrites. If you are using google fonts,
//follow their instructions as normal as well. (add a link in the html for example).
$global-font-family: 'Ubuntu', sans-serif;

// 2. Import default variables and available mixins.
@import "../../node_modules/uikit/src/scss/variables-theme.scss";
@import "../../node_modules/uikit/src/scss/mixins-theme.scss";

// 3. Import UIkit.
@import "../../node_modules/uikit/src/scss/uikit-theme.scss";
Run Code Online (Sandbox Code Playgroud)