查看 SCSS lighten()
Vue SCSS lighten()
如何在 VueJS 中使用像 lighten( );
这样的 SASS 颜色函数?确切代码如下:
<style lang="scss">
@import "../assets/variables";
.disable-primary {
lighten( $primary, 10% );
}
</style>
但是我在 VS Code 中遇到编译错误:
Failed to compile.
./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-
loader/lib/style-compiler?{"vue":true,"id":"data-v-
8dc7cce2","scoped":false,"hasInlineConfig":false}!./node_modules/sass-
loader/lib/loader.js?{"sourceMap":true}!./node_modules/vue-
loader/lib/selector.js?type=styles&index=1!./src/components/Home.vue
Module build failed:
lighten( $color-primary, 10% );
^
Property "lighten" must be followed by a ':'
函数lighten
只有returns一种颜色,你还是要把它赋值给一个CSS属性接受颜色字符串,例如:
.disable-primary {
background-color: lighten( $primary, 10% );
}
或者您想要设置的任何 属性。
如何在 VueJS 中使用像 lighten( );
这样的 SASS 颜色函数?确切代码如下:
<style lang="scss">
@import "../assets/variables";
.disable-primary {
lighten( $primary, 10% );
}
</style>
但是我在 VS Code 中遇到编译错误:
Failed to compile.
./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-
loader/lib/style-compiler?{"vue":true,"id":"data-v-
8dc7cce2","scoped":false,"hasInlineConfig":false}!./node_modules/sass-
loader/lib/loader.js?{"sourceMap":true}!./node_modules/vue-
loader/lib/selector.js?type=styles&index=1!./src/components/Home.vue
Module build failed:
lighten( $color-primary, 10% );
^
Property "lighten" must be followed by a ':'
函数lighten
只有returns一种颜色,你还是要把它赋值给一个CSS属性接受颜色字符串,例如:
.disable-primary {
background-color: lighten( $primary, 10% );
}
或者您想要设置的任何 属性。