ng-zorro等组件默认样式的修改

时间:2020-09-24 22:05:40   收藏:0   阅读:69

在项目中修改ng-zorro组件默认样式的一些方法:

类名等 前加::ng-deep;
类名等 前加:root;
类名等 前加:host /deep/;
::ng-deep .ant-spin-dot i {
 
}
:host ::ng-deep .ant-spin-dot i {
 
}
:root .ant-select-dropdown {
 
  font-size: 14px;
  margin-top: 16px;
}
:host /deep/ .ant-spin-dot i {
 
}
注意:上面三种方法可分别尝试一下,不同情况下其中之一会生效。

截止目前最新的7.0.0-rc.0 版本
table组件tbody中的td中的内容超出时默认会换行,想要实现xxxx...的效果需要一个hack:

::ng-deep .ant-table-tbody > tr > td {
  max-width: 0;
  white-space: nowrap;
}

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!