如何从导入的 SCSS 扩展 class?
How to extend a class from an imported SCSS?
shared.scss:
.gridContainer {
display: grid;
background-color: #efefef;
}
我的-component.scss
@import url("../../../shared.scss");
.contentWrapper {
@extend .gridContainer
}
从 angular 组件 scss(my-component.scss) 扩展到 .gridContainer
时出现此错误。这里的导入很好。
是否可以像这样扩展?如果不是如何从 shared.scss?
访问 class 或变量
ERROR in Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: The target selector was not found.
Use @extend .gridContainer !optional
to avoid this error.`
我认为导入语句不正确。尝试 @import 'shared.scss'
与
类似的问题
shared.scss:
.gridContainer {
display: grid;
background-color: #efefef;
}
我的-component.scss
@import url("../../../shared.scss");
.contentWrapper {
@extend .gridContainer
}
从 angular 组件 scss(my-component.scss) 扩展到 .gridContainer
时出现此错误。这里的导入很好。
是否可以像这样扩展?如果不是如何从 shared.scss?
ERROR in Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: The target selector was not found. Use
@extend .gridContainer !optional
to avoid this error.`
我认为导入语句不正确。尝试 @import 'shared.scss'
与