在角度2的模块级别应用CSS

时间:2022-04-24 18:36:18

I have developed an application with three big modules. I want to apply some common CSS to 2 modules but the third module will have a different CSS. I do not want to apply the css of the first 2 modules to the third module.

我开发了一个包含三个大模块的应用程序。我想将一些常见的CSS应用于2个模块,但第三个模块将具有不同的CSS。我不想将前两个模块的css应用到第三个模块。

I cannot apply css at component level because each module has many sub modules, component and sub components.

我无法在组件级别应用css,因为每个模块都有许多子模块,组件和子组件。

Please suggest a way to implement the CSS at module level.

请建议一种在模块级别实现CSS的方法。

Thanks In Advance

提前致谢

2 个解决方案

#1


0  

No, right now you can't do that. It is a pending feature (See this and this).

不,现在你不能这样做。这是一个待定功能(请参阅此内容)。

However you can apply style to bootstrapped component of your module with /deep/ strategy. See this for more info

但是,您可以使用/ deep / strategy将样式应用于模块的bootstrapped组件。有关详细信息,请参阅此

#2


-1  

In an Angular app you should use ::ng-deep since /deep/ and >>> are deprecated. This link might help.

在Angular应用程序中,您应该使用:: ng-deep,因为/ deep /和>>>已被弃用。此链接可能有所帮助。

#1


0  

No, right now you can't do that. It is a pending feature (See this and this).

不,现在你不能这样做。这是一个待定功能(请参阅此内容)。

However you can apply style to bootstrapped component of your module with /deep/ strategy. See this for more info

但是,您可以使用/ deep / strategy将样式应用于模块的bootstrapped组件。有关详细信息,请参阅此

#2


-1  

In an Angular app you should use ::ng-deep since /deep/ and >>> are deprecated. This link might help.

在Angular应用程序中,您应该使用:: ng-deep,因为/ deep /和>>>已被弃用。此链接可能有所帮助。