Reputation: 185
The questions I'm trying to answer:
The Angular Material documentation has an example about how to theme your own custom component: https://material.angular.io/guide/theming-your-components
Do we need to do this for EVERY component that wants to read a theme value?
For instance, our header needs the accent 200 color, so this means we take our header components scss file, mostly duplicate it and turn it into a mixin (per the Material documentation).
Then we have to include this components mixin in the application (see step #4: https://material.angular.io/guide/theming-your-components#step-4-include-the-theme-mixin-in-your-application).
This feels like a lot of overhead to just grab a single color value. I've seen people read Material theme values and then assign them to CSS variables under root and then they can access those colors component stylesheets, but that feels hacky.
Upvotes: 0
Views: 396
Reputation: 29
there is no need to change your theme for every component. its good to define your custom theme on a file then use it in the style.scss
Upvotes: 0