Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit bc9ae6c

Browse files
refactor(textfield): expose light theme map
Exports the `light-theme` map so it can be used for validations. PiperOrigin-RevId: 553584998
1 parent 83355c3 commit bc9ae6c

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

packages/mdc-textfield/_filled-text-field-theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
$_custom-property-prefix: 'filled-text-field';
3838

39-
$_light-theme: (
39+
$light-theme: (
4040
active-indicator-color: null,
4141
active-indicator-height: null,
4242
caret-color: null,
@@ -131,7 +131,7 @@ $_light-theme: (
131131
);
132132

133133
@mixin theme($theme) {
134-
$theme: validate.theme($_light-theme, $theme);
134+
$theme: validate.theme($light-theme, $theme);
135135

136136
@include keys.declare-custom-properties(
137137
$theme,
@@ -140,7 +140,7 @@ $_light-theme: (
140140
}
141141

142142
@mixin theme-styles($theme, $resolvers: resolvers.$material) {
143-
$theme: validate.theme-styles($_light-theme, $theme, false);
143+
$theme: validate.theme-styles($light-theme, $theme, false);
144144

145145
$theme: keys.create-theme-properties(
146146
$theme,

packages/mdc-textfield/_outlined-text-field-theme.scss

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
$custom-property-prefix: 'outlined-text-field';
3838

39-
$_light-theme: (
39+
$light-theme: (
4040
caret-color: null,
4141
container-height: null,
4242
container-shape: null,
@@ -125,7 +125,7 @@ $_light-theme: (
125125
);
126126

127127
@mixin theme($theme) {
128-
$theme: validate.theme($_light-theme, $theme);
128+
$theme: validate.theme($light-theme, $theme);
129129

130130
@include keys.declare-custom-properties(
131131
$theme,
@@ -134,7 +134,7 @@ $_light-theme: (
134134
}
135135

136136
@mixin theme-styles($theme, $resolvers: resolvers.$material) {
137-
$theme: validate.theme-styles($_light-theme, $theme, false);
137+
$theme: validate.theme-styles($light-theme, $theme, false);
138138

139139
$theme: keys.create-theme-properties(
140140
$theme,
@@ -157,15 +157,21 @@ $_light-theme: (
157157
'text-field-outlined-#{custom-properties.get-fallback($container-height)}',
158158
'text-field-outlined-#{$container-height}'
159159
);
160-
@include mixins.outlined-height($container-height-value, $keyframe-suffix);
160+
@include mixins.outlined-height(
161+
$container-height-value,
162+
$keyframe-suffix
163+
);
161164

162165
&.mdc-text-field--with-leading-icon {
163166
$with-leading-icon-keyframe-suffix: if(
164167
custom-properties.is-custom-prop($container-height),
165168
'text-field-outlined-with-leading-icon-#{custom-properties.get-fallback($container-height)}',
166169
'text-field-outlined-with-leading-icon-#{$container-height}'
167170
);
168-
@include mixins.outlined-with-leading-icon-height($container-height-value, $with-leading-icon-keyframe-suffix);
171+
@include mixins.outlined-with-leading-icon-height(
172+
$container-height-value,
173+
$with-leading-icon-keyframe-suffix
174+
);
169175
}
170176
}
171177
}

packages/mdc-textfield/_text-field-theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
@use './text-field';
3434

35-
$_light-theme: (
35+
$light-theme: (
3636
active-indicator-color: null,
3737
active-indicator-height: null,
3838
caret-color: null,
@@ -144,7 +144,7 @@ $_light-theme: (
144144
);
145145

146146
@mixin theme-styles($theme, $resolvers: resolvers.$material) {
147-
@include theme.validate-theme-styles($_light-theme, $theme);
147+
@include theme.validate-theme-styles($light-theme, $theme);
148148

149149
// TODO(b/261633818): Remove support for extraneous `*-caret-color` tokens.
150150
@include _caret-color(

0 commit comments

Comments
 (0)