Open johanndev opened 1 year ago
I'd very much appreciate this too! The problem right now is that many Angular Material components add CSS rules inside a style tag to the document's head. Currently there is no way to configure that these CSS rules should be defined as part of a specific CSS cascade layer.
I would also like to offer my help in implementing this feature.
Any update on this?
Can I be of assistance with this? Has anyone already worked on this, or do you guys have a specific design in mind?
@OpCyc-Ben As far as I know, nobody has worked on this yet. Here's a suggestion how it could work:
What do you think?
@alexlehner86 While I love that idea, I'd like to first discuss first what we are conceptually trying to do. I'm even torn whether angular itself might be a better place for this. To be transparent about my motivation, our (my) use-case for this would be to wrap any non-layered styles into a base-layer. This use-case would go beyond the scope of 'material' or angular's own components.
@layer
, it seems to me, would have to be more like an app-wide configuration change, as the emitted style tag this would have to end up in isn't repeated for every instance of every component they apply to.My open questions to you would be: Where exactly do you envision that InjectionToken to go, and what exactly do you think it should do to the output? What's your use-case?
Feature Description
Are there any plans to introduce support for CSS Cascade Layers?
References: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_layers https://caniuse.com/css-cascade-layers https://www.smashingmagazine.com/2022/01/introduction-css-cascade-layers/
Use Case
To meet the demands of our customers, our team often has to override the default styles of angular material components. We'd like to use cascade layers to organize our normalization, override, and custom styles. If the angular components would be wrapped in a dedicated (configurable?) layer, our material overrides could be embedded more conveniently into our overall style logic.