我需要将 .ts 文件中的样式插入到 less 中的原因:我有一个网站和类似内容管理器面板的东西,您可以在其中为其设置按钮的颜色。
当然我可以在我的 html 模板中使用这个 css 变量,例如:
[style.color]="colorVar"
但也许存在一些更好的解决方案?
最佳答案
您可以使用::ng-deep
来渗透到某些组件中并更改样式。
some-component-selector ::ng-deep selector-inside-of-that-some-component {
//write the sytles here
}
关于html - 如何在 angular cli 中将 css 样式从 ts 导入到 less?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52775245/