feat(system-level-variables): Allow calling component mixins without specific theme #29374
Labels
feature
This issue represents a new feature or feature request rather than a bug or bug fix
needs triage
This issue needs to be triaged by the team
Feature Description
System level CSS variables are awesome. They give full control over theming:
sys-
variables.@angular/material
.Defining and using a theme is as simple as:
With this one can easily define a bunch of such defined themes, and then load one based on user settings. Alternatively a backend endpoint could render the CSS file with the
sys-
variables.The issue
Everything in Angular Material nicely supports system-level themes, except the component theming mixins.
We still are still required to do something like:
This is not nice, because we now have generic styling code that needs to use a specific theme.
A solution would be to allow passing something like this:
Workaround
Create your own
$system-variables-theme
, and use it:Use Case
Easy and clean theming, with minimal theme files.
I'm not sure whether the current workaround is 'ergonomic' enough. If it is, it should at least be added to the documentation.
The text was updated successfully, but these errors were encountered: