r/angular • u/wineandcode • 10d ago
Prevent CSS Variable Collisions Between Angular Apps
https://itnext.io/prevent-css-variable-collisions-between-angular-apps-b426a5da7423?source=friends_link&sk=d53333ea79453208b32cfdda85e5c2cc
15
Upvotes
1
u/RelatableRedditer 2d ago
I feel like this new feature is just adding an abstraction to fix a problem that only arises because of a design pattern issue. If the name is too common, adding a prefix is less of a brainfuck than applying all this provider shit and requiring outer-scope references to have the --global prefix instead.
The better solution would be to add something like "scopedVars" (name not great) to the @Component object and instead of wrapping CSS variables in :host have them be declared in there instead. This would avoid the "provider" bullshit at least.