如何使用 angular css 组件设置 ng-zorro 组件的样式?
How to style ng-zorro component with angular css component?
我遇到了某个问题,例如:
我不喜欢 ng-zorro 的边距 table。
在我的浏览器中,我可以看到它从 .ant-table-small>.ant-table-content>.ant-table-body
选择器中获取边距。
有什么方法可以覆盖它吗?
在 ng-zorro theme.less 中不存在。
对于这个菜鸟问题,我感到非常抱歉。
您可以用 ::ng-deep
关键字覆盖 Angular css,例如:
::ng-deep .ant-table-small>.ant-table-content>.ant-table-body {
margin: 0;
}
如果您想在您的应用程序中全局更改此样式(您可能会这样做),请尝试添加覆盖 css 文件并将其包含在应用程序的样式文件中。所以你不需要在每个组件中重复相同的样式覆盖。
我遇到了某个问题,例如:
我不喜欢 ng-zorro 的边距 table。
在我的浏览器中,我可以看到它从 .ant-table-small>.ant-table-content>.ant-table-body
选择器中获取边距。
有什么方法可以覆盖它吗?
在 ng-zorro theme.less 中不存在。 对于这个菜鸟问题,我感到非常抱歉。
您可以用 ::ng-deep
关键字覆盖 Angular css,例如:
::ng-deep .ant-table-small>.ant-table-content>.ant-table-body {
margin: 0;
}
如果您想在您的应用程序中全局更改此样式(您可能会这样做),请尝试添加覆盖 css 文件并将其包含在应用程序的样式文件中。所以你不需要在每个组件中重复相同的样式覆盖。