【发布时间】:2022-01-12 13:15:20
【问题描述】:
我需要一个带有来自数据库的动态颜色的页面。在 sass 文件中,我在变量中有样式
$color-primary: #56b4d8;
$theme-colors: (primary: $color-primary,
secondary: #56b4d8,
success: #0ebd65,
info: #198ae3,
warning: #fed713,
danger: #e64b4b,
light: #f8f9fa,
dark: #1a1a1a);
应用于 boostrap 类的原色(text-primary、bg-primary、btn-primary)我希望 sass $ color-primary 变量填充我来自 DB 的数据
我正在使用 asp.net core html、sass 和 gulp。这是可能的
【问题讨论】:
-
您可能需要升级到使用 CSS 变量作为主题的 Bootstrap 5.0。以前的版本需要编译 LESS/SASS 代码,不能是动态的。
标签: javascript html css sass gulp