我在Bulma.io
项目中使用Angular 8
,并且已经使用以下命令安装Bulma:npm install bulma
。之后,我将样式包含在angular.json
文件中:
"styles": [
"src/styles.css",
"node_modules/bulma/css/bulma.css"
],
"stylePreprocessorOptions": {
"includePaths":
"node_modules",
"node_modules/bulma/sass/utilities"
]
},
我可以使用Bulma
,但是不能覆盖要更改的变量,例如navbar
的背景色。
这是我的scss
文件,它覆盖了background-color
的{{1}}:
navbar
我在做什么错? 预先感谢。
答案 0 :(得分:0)
我们可以像使用节点sass一样导入它
首先保存bulma
程序包
npm install bulma --save
然后转到style.scss
并提供以下代码
// Set your brand colors
$purple: #8a4d76;
$pink: #fa7c91;
$brown: #757763;
$beige-light: #d0d1cd;
$beige-lighter: #eff0eb;
// Update Bulma's global variables
$family-sans-serif: 'Nunito', sans-serif;
$grey-dark: $brown;
$grey-light: $beige-light;
$primary: $purple;
$link: $pink;
$widescreen-enabled: false;
$fullhd-enabled: false;
// Update some of Bulma's component variables
// $body-background-color: $beige-lighter;
$body-background-color: #fff;
$control-border-width: 2px;
$input-border-color: transparent;
$input-shadow: none;
// Import only what you need from Bulma
@import '~node_modules/bulma/sass/utilities/_all';
@import '~node_modules/bulma/sass/base/_all';
@import '~node_modules/bulma/sass/elements/button';
@import '~node_modules/bulma/sass/elements/container';
@import '~node_modules/bulma/sass/elements/title';
@import '~node_modules/bulma/sass/form/_all';
@import '~node_modules/bulma/sass/components/navbar';
@import '~node_modules/bulma/sass/layout/hero';
@import '~node_modules/bulma/sass/layout/section';
为例