ng-zorro-antd/table/style/size
你进口的,本身就是进口
../../style/themes/index
你没有很多选择。
*选项1:复制库中较少的文件,并将所需的新值放入这些复制的文件中。问题是你不能自动利用图书馆的发展。
-
选项2:保持代码原样,在较少的文件中只覆盖您感兴趣的类(例如使用::ngdeep)。例如,如下所示:
@import 'ng-zorro-antd/table/style/index';
@import 'ng-zorro-antd/table/style/size';
@table-border-radius-base: 0;
@table-header-bg: black;
::ng-deep table {
border-radius: @table-border-radius-base @table-border-radius-base 0 0; // the property will be overriden by the variables you have defined
}
...
::ng-deep
:文档中说,即使它仍在大量使用,它也被弃用。若要避免此问题,如果您的常规样式文件不与特定组件相关,则可以将要替代的样式放入此文件中,而不需要