如何将自定义 class 添加到语义 UI?
How to add a custom class to Semantic UI?
Where 和 how 我要添加自定义 class 吗:
.my-custom-class {
color: red;
}
原因是它不会更改所有语义 UI 元素。
我应该将它添加到哪个文件中才能包含在 dist 文件中?
如果您不想更改 Semantic-UI 元素,为什么不拥有一个完全独立的 CSS 自定义样式文件?
拥有多个 CSS 文件完全没问题(而且很常见),例如具有以下结构:
<link rel="stylesheet" type="text/css" class="ui" href="/dist/semantic.min.css">
<link rel="stylesheet" type="text/css" href="custom.css">
然后在 custom.css
中,只需包含您的额外自定义样式:
.my-custom-class {
color: red;
}
外部样式表的加载顺序直接对应specificity;加载自定义样式表 after 语义-UI 将在平局的情况下赋予它更多的特异性。
希望对您有所帮助! :)
Where 和 how 我要添加自定义 class 吗:
.my-custom-class {
color: red;
}
原因是它不会更改所有语义 UI 元素。
我应该将它添加到哪个文件中才能包含在 dist 文件中?
如果您不想更改 Semantic-UI 元素,为什么不拥有一个完全独立的 CSS 自定义样式文件?
拥有多个 CSS 文件完全没问题(而且很常见),例如具有以下结构:
<link rel="stylesheet" type="text/css" class="ui" href="/dist/semantic.min.css">
<link rel="stylesheet" type="text/css" href="custom.css">
然后在 custom.css
中,只需包含您的额外自定义样式:
.my-custom-class {
color: red;
}
外部样式表的加载顺序直接对应specificity;加载自定义样式表 after 语义-UI 将在平局的情况下赋予它更多的特异性。
希望对您有所帮助! :)