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


https://www.jianshu.com/p/8b887c2aac06

 

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

  • 类名等 前加::ng-deep
  • 类名等 前加:root
  • 类名等 前加:host /deep/
::ng-deep .ant-spin-dot i { background-color: #4c7bff; } :host ::ng-deep .ant-spin-dot i { background-color: #4c7bff; } :root .ant-select-dropdown { background-color: #1F273E; font-size: 14px; margin-top: 16px; } :host /deep/ .ant-spin-dot i { background-color: #4c7bff; } 

注意:上面三种方法可分别尝试一下,不同情况下其中之一会生效。

截止目前最新的7.0.0-rc.0 版本

table组件tbody中的td中的内容超出时默认会换行,想要实现xxxx...的效果需要一个hack:

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


作者:tiger亮
链接:https://www.jianshu.com/p/8b887c2aac06
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM