Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(material/theming): fine-grain token override without variable duplication #28932

Open
wagnermaciel opened this issue Apr 22, 2024 · 0 comments · May be fixed by #28972
Open

feat(material/theming): fine-grain token override without variable duplication #28932

wagnermaciel opened this issue Apr 22, 2024 · 0 comments · May be fixed by #28972
Labels
area: theming feature This issue represents a new feature or feature request rather than a bug or bug fix M3

Comments

@wagnermaciel
Copy link
Contributor

Feature Description

Add a Sass function to our components theming API which allows users to alter the tokens map in a theme config.

This design satisfies the following pain points for our users:

  • There are no guard rails preventing users from misspelling variable names.
  • Our CSS variables are prefixed with "--mat" and "--mdc" which can be confusing for users.

Use Case

Situations where a user would like to override our styles on more of an application level without generating duplicate css variables.

For more context, compare the example output below to the example output of #28929.

Example Usage

$theme: mat.define-theme(...);

$theme: mat.checkbox-extend-theme($theme, (
    checkbox-color: blue,
));

@include mat.checkbox-theme($theme);

Example Output

html {
    --mdc-checkbox-checkmark-color: blue;
}
@wagnermaciel wagnermaciel added 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 labels Apr 22, 2024
@wagnermaciel wagnermaciel self-assigned this Apr 22, 2024
@wagnermaciel wagnermaciel added area: theming M3 and removed needs triage This issue needs to be triaged by the team labels Apr 22, 2024
@wagnermaciel wagnermaciel linked a pull request Apr 26, 2024 that will close this issue
@wagnermaciel wagnermaciel removed their assignment Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: theming feature This issue represents a new feature or feature request rather than a bug or bug fix M3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant