Skip to content

feat(material/theming): fine-grain token override #28929

@wagnermaciel

Description

@wagnermaciel

Feature Description

Add a mixin to our components theming API which emits CSS to override the CSS variables emitted by our existing API.

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

Any situation where a user would like to override our styles.

Example Usage:

@include mat.checkbox-overrides((
    checkmark-color: red,
));

.my-other-checkbox {
    @include mat.checkbox-overrides((
        checkmark-color: blue,
    ));
}

Example Output

html {
    --mdc-checkbox-checkmark-color: red;
}

.my-other-checkbox {
    --mdc-checkbox-checkmark-color: blue;
}

Metadata

Metadata

Assignees

Labels

M3area: themingfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions