我正在使用Sage框架构建WordPress网站,并想使用自定义CSS框架,即Materialize CSS。 Sage使用Webpack构建CSS。
在构建时,出现以下错误消息:
WAIT Compiling... 1:55:57 PM
ERROR Failed to compile with 1 errors 1:55:57 PM
error in ./resources/assets/styles/main.scss
Module build failed:
.#{$color_name}.#{$color_type} {
^
Invalid CSS after ".white": expected selector, was ".#0a0a0a"
in /mnt/c/Users/Kenny/Local Sites/ngcsaget1/app/public/wp-content/themes/ngc11/node_modules/materialize-css/sass/components/_color-classes.scss (line 14, column 7)
@ ./resources/assets/styles/main.scss 2:14-358 21:1-42:3 22:19-363
@ multi ./resources/assets/build/util/../helpers/hmr-client.js ./scripts/main.js ./styles/main.scss
这是物化Github仓库:https://github.com/Dogfalo/materialize
如果需要,这是Sage框架的github,webpack.config.js位于build文件夹中:https://github.com/roots/sage/tree/master/resources/assets
注释:
尝试导入.scss
文件时出现错误:
@import "~materialize-css/sass/materialize";
如果导入完整的.css
文件,则可以访问该框架,但这很简单:
@import "~materialize-css/dist/css/materialize";
这是Webpack代码:https://github.com/roots/sage/blob/master/resources/assets/build/webpack.config.js