angular-material-css-vars icon indicating copy to clipboard operation
angular-material-css-vars copied to clipboard

Styling custom components

Open gotwig opened this issue 3 years ago • 1 comments

Hello,

I realy would like to understand the project better, and would love to hear from your feedback.

Can I use this lib to integrate custom material themes for my custom components in my project? https://material.angular.io/guide/theming-your-components

The problem with the "official" approach is that it breaks the encapsulation, and I think css vars are much easier, so I could just do something like:

@include variables color: var(PrimaryColor);

Also I think the first sentence is not very clear :D Im not hear to learn about rainbows :O

Feedback? :)

gotwig avatar Jul 13 '20 10:07 gotwig

Hello @gotwig! I haven't tried this for myself nor I am very familiar with the official approach of component styling (and I never really saw the appeal to be honest), but in general, what your're asking should be possible. This lib mostly works by patching mat-color. The only thing you need to make sure is that this is done before you use it in your custom components.

johannesjo avatar Jul 13 '20 11:07 johannesjo