Skip to content

Commit 0ac1911

Browse files
committed
fix(material/form-field): move unthemable tokens to theme mixin (#27887)
Though these tokens are not currently affected by the theme, in the future they will be affected by the design system used for theming (M2 or M3) (cherry picked from commit 3430c4d)
1 parent 84f399f commit 0ac1911

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/material/form-field/_form-field-theme.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@
1212
@use './form-field-density';
1313

1414
@mixin base($theme) {
15-
// TODO(mmalerba): Move form field base tokens here
15+
@include sass-utils.current-selector-or-root() {
16+
@include token-utils.create-token-values(
17+
tokens-mdc-filled-text-field.$prefix,
18+
tokens-mdc-filled-text-field.get-unthemable-tokens());
19+
@include token-utils.create-token-values(
20+
tokens-mdc-outlined-text-field.$prefix,
21+
tokens-mdc-outlined-text-field.get-unthemable-tokens());
22+
@include token-utils.create-token-values(
23+
tokens-mat-form-field.$prefix,
24+
tokens-mat-form-field.get-unthemable-tokens());
25+
}
1626
}
1727

1828
@mixin color($theme) {

src/material/form-field/form-field.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
@use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field;
1616
@use '../core/tokens/m2/mdc/filled-text-field' as tokens-mdc-filled-text-field;
1717
@use '../core/tokens/m2/mdc/outlined-text-field' as tokens-mdc-outlined-text-field;
18-
@use '../core/style/sass-utils';
1918
@use './form-field-sizing';
2019
@use './form-field-subscript';
2120
@use './form-field-focus-overlay';
@@ -44,24 +43,12 @@
4443
@include mdc-custom-properties.configure(
4544
$emit-fallback-values: false, $emit-fallback-vars: false) {
4645

47-
@include sass-utils.current-selector-or-root() {
48-
@include token-utils.create-token-values(
49-
tokens-mat-form-field.$prefix,
50-
tokens-mat-form-field.get-unthemable-tokens());
51-
}
52-
5346
.mdc-text-field--filled {
54-
@include token-utils.create-token-values(
55-
tokens-mdc-filled-text-field.$prefix,
56-
tokens-mdc-filled-text-field.get-unthemable-tokens());
5747
@include mdc-filled-text-field-theme.theme-styles(
5848
tokens-mdc-filled-text-field.get-token-slots());
5949
}
6050

6151
.mdc-text-field--outlined {
62-
@include token-utils.create-token-values(
63-
tokens-mdc-outlined-text-field.$prefix,
64-
tokens-mdc-outlined-text-field.get-unthemable-tokens());
6552
@include mdc-outlined-text-field-theme.theme-styles(
6653
tokens-mdc-outlined-text-field.get-token-slots());
6754
}

0 commit comments

Comments
 (0)