1111@use ' sass:map' ;
1212@use ' @material/theme/color-palette' ;
1313@use ' @material/shape/shape' ;
14- @use ' @material/theme/keys' ;
1514@use ' @material/theme/state' ;
1615@use ' @material/theme/theme-color' ;
17- @use ' @material/theme/theme' ;
16+ @use ' @material/mwc-../sass/theme' ;
17+ @use ' @material/mwc-../sass/var' ;
1818@use ' ./content-theme' ;
1919@use ' ./field-theme' ;
2020@use ' ./label-theme' ;
@@ -48,21 +48,26 @@ $light-theme: map.merge(
4848 hover- state- layer- color: color-palette .$grey-800 ,
4949 hover- state- layer- opacity: 0.08 ,
5050 hover- stroke- color: color-palette .$grey-900 ,
51- shape: small ,
51+ shape: shape . $ small-component-radius ,
5252 stroke- color: color-palette .$grey-700 ,
5353 stroke-width : 1px ,
5454 )
5555);
5656
5757@mixin theme ($theme ) {
58- @include theme .validate-theme ($light-theme , $theme );
59- @include keys .declare-custom-properties ($theme , filled- field);
58+ $theme : theme .create-theme-vars (
59+ theme .validate-theme ($light-theme , $theme ),
60+ filled-field
61+ );
62+
63+ @include theme .emit-theme-vars ($theme );
6064}
6165
6266@mixin theme-styles ($theme ) {
63- @include theme .validate-theme ($light-theme , $theme );
64-
65- $theme : keys .create-theme-properties ($theme , filled-field );
67+ $theme : theme .create-theme-vars (
68+ theme .validate-theme-tokens ($light-theme , $theme ),
69+ filled-field
70+ );
6671
6772 @include field-theme .theme-styles ($theme );
6873 @include content-theme .theme-styles ($theme );
@@ -135,15 +140,15 @@ $light-theme: map.merge(
135140@mixin _set-container-color ($color ) {
136141 .mdc-field__container {
137142 & ::before {
138- @include theme . property ( background , $color ) ;
143+ background : $color ;
139144 }
140145 }
141146}
142147
143148@mixin _set-container-hover-color ($color ) {
144149 .mdc-field__container {
145150 & ::after {
146- @include theme . property ( background , $color ) ;
151+ background : $color ;
147152 }
148153 }
149154}
@@ -164,52 +169,48 @@ $light-theme: map.merge(
164169@mixin _set-container-opacity ($opacity ) {
165170 .mdc-field__container {
166171 & ::before {
167- @include theme . property ( opacity , $opacity ) ;
172+ opacity : $opacity ;
168173 }
169174 }
170175}
171176
172177@mixin _set-container-hover-opacity ($opacity ) {
173178 .mdc-field__container {
174179 & ::after {
175- @include theme . property ( opacity , $opacity ) ;
180+ opacity : $opacity ;
176181 }
177182 }
178183}
179184
180185@mixin _container-padding-horizontal ($padding ) {
181186 .mdc-field__start {
182- @include theme . property ( padding-inline-start , $padding ) ;
187+ padding-inline-start : $padding ;
183188 }
184189
185190 .mdc-field__end {
186- @include theme . property ( padding-inline-end , $padding ) ;
191+ padding-inline-end : $padding ;
187192 }
188193}
189194
190195@mixin _container-padding-vertical ($padding ) {
191196 .mdc-field__container {
192- @include theme . property ( padding-top , $padding ) ;
193- @include theme . property ( padding-bottom , $padding ) ;
197+ padding-top : $padding ;
198+ padding-bottom : $padding ;
194199 }
195200}
196201
197202@mixin _floating-label-text-line-height ($line-height ) {
198203 & :not (.mdc-field--no-label ) {
199204 .mdc-field__middle {
200- @include theme . property ( padding-top , $line-height ) ;
205+ padding-top : $line-height ;
201206 }
202207 }
203208}
204209
205210@mixin _shape ($shape ) {
206211 .mdc-field__container {
207- // TODO(b/177368168): support percentages relative to density
208- @include shape .radius (
209- shape .mask-radius ($shape , 1 1 0 0 ),
210- $rtl-reflexive : true,
211- $component-height : 56px
212- );
212+ border-start-start-radius : $shape ;
213+ broder-start-end-radius : $shape ;
213214 }
214215}
215216
@@ -234,13 +235,13 @@ $light-theme: map.merge(
234235
235236@mixin _set-stroke-color ($color ) {
236237 .mdc-field__stroke ::before {
237- @include theme . property ( border-bottom-color , $color ) ;
238+ border-bottom-color : $color ;
238239 }
239240}
240241
241242@mixin _set-stroke-focus-color ($color ) {
242243 .mdc-field__stroke ::after {
243- @include theme . property ( border-bottom-color , $color ) ;
244+ border-bottom-color : $color ;
244245 }
245246}
246247
@@ -262,25 +263,19 @@ $light-theme: map.merge(
262263
263264@mixin _set-stroke-opacity ($opacity ) {
264265 .mdc-field__stroke ::before {
265- @include theme . property ( opacity , $opacity ) ;
266+ opacity : $opacity ;
266267 }
267268}
268269
269270@mixin _stroke-width ($widths ) {
270271 .mdc-field__stroke {
271272 // Default/focus are on different elements and do not need state selectors
272273 & ::before {
273- @include theme .property (
274- border-bottom-width ,
275- state .get-default-state ($widths )
276- );
274+ border-bottom-width : state .get-default-state ($widths );
277275 }
278276
279277 & ::after {
280- @include theme .property (
281- border-bottom-width ,
282- state .get-focus-state ($widths )
283- );
278+ border-bottom-width : state .get-focus-state ($widths );
284279 }
285280 }
286281}
0 commit comments