跳过特定的组件样式

Skipping Specific Component Styles

我尝试做一些真正基本的事情,如 spartacus 文档中所述 https://sap.github.io/spartacus-docs/css-architecture/#skipping-specific-component-styles

在文件 src/styles.scss:

$styleVersion: 4.3;
$skipComponentStyles: (cx-mini-cart, cx-product-carousel, cx-searchbox);
@import '~@spartacus/styles/index';

但看起来 $skipComponentStyles 变量没有按预期工作,UI 没有变化。这是最新版本的错误还是我错过了什么?

在我将样式导入从 angular.json 更改为 styles.scss 之前,它对我也不起作用。

之前:

"styles": [
              "src/styles.scss",
              "src/styles/spartacus/user.scss",
              "src/styles/spartacus/storefinder.scss",
              "src/styles/spartacus/product.scss",
              "src/styles/spartacus/order.scss",
              "src/styles/spartacus/checkout.scss",
              "src/styles/spartacus/cart.scss"
            ],

之后:

"styles": [
              "src/styles.scss"
            ],

styles.scss

$skipComponentStyles: (cx-mini-cart);
@import '~@spartacus/styles/index';

@import "styles/spartacus/user";
@import "styles/spartacus/storefinder";
@import "styles/spartacus/product";
@import "styles/spartacus/order";
@import "styles/spartacus/checkout";
@import "styles/spartacus/cart";

@import 'styles/custom-styles';