简体   繁体   English

我应该如何在 Angular v13 中提取 @angular/material css 文件?

[英]How should I extract @angular/material css file in Angular v13?

  • In my Angular[v13] project, I used @angular/material .在我的 Angular[v13] 项目中,我使用了@angular/material I also want to use tailwindcss .我也想使用tailwindcss
  • but @angular/material css is a style tag in head.@angular/material css 是 head 中的样式标签。 so tailwindcss is not working.所以tailwindcss不工作。 在此处输入图像描述
  • Now i want to extract @angular/material css file.现在我想提取@angular/material css 文件。 Or is there any way to solve this problem或者有什么办法可以解决这个问题

To solve this issue, be sure to activate important flag on tailwindcss config, in order to automatically mark all css class with !important clause .要解决此问题,请务必在 tailwindcss 配置中激活important标志,以便使用!important子句自动标记所有 css 类。

So every predefined classes of TailwindCSS will override @angular/material styles.所以 TailwindCSS 的每个预定义类都会覆盖@angular/material样式。

tailwind.config.js: tailwind.config.js:

module.exports = {
  ...
  important: true,
  ...
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM