正如标题所说,我无法正确地将自定义颜色应用于语义 UI 中的菜单。我在互联网上搜索了教程、指南,包括语义 UI 页面。我唯一能找到的是人们能够成功地将自定义颜色应用于按钮,或者人们使用语义 UI 为菜单定义的默认颜色。
<div class="ui fluid container">
<div class="ui segment attached">
<h1 class="ui header item">CONTERACT</h1>
</div>
</div>
<div class="ui fluid container">
<div class="ui primary attached four item inverted menu">
<a href="" class="brand item">Project Name</a>
<a href="" class="active item">Link</a>
<a href="" class="item">Link</a>
<a href="" class="item">Link</a>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我已将我想要的特定颜色定义为 @primaryColor,这适用于按钮,就像一个实验,但不适用于菜单。我还尝试覆盖 site.override 中的默认颜色,但没有成功。我怀疑您可能无法在语义 UI 的菜单中使用自定义颜色,但考虑到这会破坏自定义方面,这也令人难以置信。
/**
User Global Variables
**/
@primaryColor: #fabd42
Run Code Online (Sandbox Code Playgroud) semantic-ui ×1