Skip to content

Commit 84536d7

Browse files
asynclizcopybara-github
authored andcommitted
chore: update components to use custom properties from tokens
PiperOrigin-RevId: 601597083
1 parent feff721 commit 84536d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+208
-150
lines changed

button/internal/_elevated-button.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
}
3535

3636
@mixin styles() {
37-
$tokens: tokens.md-comp-elevated-button-values();
37+
$tokens: tokens.md-comp-elevated-button-values(
38+
$exclude-custom-properties: false,
39+
);
3840

3941
:host {
4042
@each $token, $value in $tokens {
41-
--_#{$token}: var(--md-elevated-button-#{$token}, #{$value});
43+
--_#{$token}: #{$value};
4244
}
4345

4446
// Support logical shape properties

button/internal/_filled-button.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
}
3535

3636
@mixin styles() {
37-
$tokens: tokens.md-comp-filled-button-values();
37+
$tokens: tokens.md-comp-filled-button-values(
38+
$exclude-custom-properties: false,
39+
);
3840

3941
:host {
4042
@each $token, $value in $tokens {
41-
--_#{$token}: var(--md-filled-button-#{$token}, #{$value});
43+
--_#{$token}: #{$value};
4244
}
4345

4446
// Support logical shape properties

button/internal/_filled-tonal-button.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
}
3535

3636
@mixin styles() {
37-
$tokens: tokens.md-comp-filled-tonal-button-values();
37+
$tokens: tokens.md-comp-filled-tonal-button-values(
38+
$exclude-custom-properties: false,
39+
);
3840

3941
:host {
4042
@each $token, $value in $tokens {
41-
--_#{$token}: var(--md-filled-tonal-button-#{$token}, #{$value});
43+
--_#{$token}: #{$value};
4244
}
4345

4446
// Support logical shape properties

button/internal/_outlined-button.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
}
3535

3636
@mixin styles() {
37-
$tokens: tokens.md-comp-outlined-button-values();
37+
$tokens: tokens.md-comp-outlined-button-values(
38+
$exclude-custom-properties: false,
39+
);
3840

3941
:host {
4042
@each $token, $value in $tokens {
41-
--_#{$token}: var(--md-outlined-button-#{$token}, #{$value});
43+
--_#{$token}: #{$value};
4244
}
4345

4446
--_container-color: none;

button/internal/_text-button.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
}
3535

3636
@mixin styles() {
37-
$tokens: tokens.md-comp-text-button-values();
37+
$tokens: tokens.md-comp-text-button-values(
38+
$exclude-custom-properties: false,
39+
);
3840

3941
:host {
4042
@each $token, $value in $tokens {
41-
--_#{$token}: var(--md-text-button-#{$token}, #{$value});
43+
--_#{$token}: #{$value};
4244
}
4345

4446
--_container-color: none;

checkbox/internal/_checkbox.scss

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,26 @@ $_checkmark-bottom-left: 7px, -14px;
4747
}
4848

4949
@mixin styles() {
50-
$tokens: tokens.md-comp-checkbox-values();
50+
$tokens: tokens.md-comp-checkbox-values(
51+
$exclude-custom-properties: false,
52+
);
5153

5254
// Support logical shape properties
5355
$container-shape: map.get($tokens, 'container-shape');
54-
$tokens: map.set(
55-
$tokens,
56-
'container-shape-start-start',
57-
var(--md-checkbox-container-shape, #{$container-shape})
58-
);
59-
$tokens: map.set(
60-
$tokens,
61-
'container-shape-start-end',
62-
var(--md-checkbox-container-shape, #{$container-shape})
63-
);
64-
$tokens: map.set(
65-
$tokens,
66-
'container-shape-end-end',
67-
var(--md-checkbox-container-shape, #{$container-shape})
68-
);
69-
$tokens: map.set(
56+
$tokens: map.merge(
7057
$tokens,
71-
'container-shape-end-start',
72-
var(--md-checkbox-container-shape, #{$container-shape})
58+
(
59+
'container-shape-start-start':
60+
var(--md-checkbox-container-shape-start-start, #{$container-shape}),
61+
'container-shape-start-end':
62+
var(--md-checkbox-container-shape-start-end, #{$container-shape}),
63+
'container-shape-end-end':
64+
var(--md-checkbox-container-shape-end-end, #{$container-shape}),
65+
'container-shape-end-start':
66+
var(--md-checkbox-container-shape-end-start, #{$container-shape}),
67+
)
7368
);
7469

75-
@each $token, $value in $tokens {
76-
$tokens: map.set($tokens, $token, var(--md-checkbox-#{$token}, #{$value}));
77-
}
78-
7970
:host {
8071
border-start-start-radius: map.get($tokens, 'container-shape-start-start');
8172
border-start-end-radius: map.get($tokens, 'container-shape-start-end');

chips/internal/_assist-chip.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@
3333
}
3434

3535
@mixin styles() {
36-
$tokens: tokens.md-comp-assist-chip-values();
36+
$tokens: tokens.md-comp-assist-chip-values(
37+
$exclude-custom-properties: false,
38+
);
3739

3840
:host {
3941
@each $token, $value in $tokens {
40-
--_#{$token}: var(--md-assist-chip-#{$token}, #{$value});
42+
--_#{$token}: #{$value};
4143
}
4244

4345
// Support logical shape properties

chips/internal/_filter-chip.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@
3333
}
3434

3535
@mixin styles() {
36-
$tokens: tokens.md-comp-filter-chip-values();
36+
$tokens: tokens.md-comp-filter-chip-values(
37+
$exclude-custom-properties: false,
38+
);
3739

3840
:host {
3941
@each $token, $value in $tokens {
40-
--_#{$token}: var(--md-filter-chip-#{$token}, #{$value});
42+
--_#{$token}: #{$value};
4143
}
4244

4345
// Support logical shape properties

chips/internal/_input-chip.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@
3333
}
3434

3535
@mixin styles() {
36-
$tokens: tokens.md-comp-input-chip-values();
36+
$tokens: tokens.md-comp-input-chip-values(
37+
$exclude-custom-properties: false,
38+
);
3739

3840
:host {
3941
@each $token, $value in $tokens {
40-
--_#{$token}: var(--md-input-chip-#{$token}, #{$value});
42+
--_#{$token}: #{$value};
4143
}
4244

4345
// Support logical shape properties

chips/internal/_suggestion-chip.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@
3333
}
3434

3535
@mixin styles() {
36-
$tokens: tokens.md-comp-suggestion-chip-values();
36+
$tokens: tokens.md-comp-suggestion-chip-values(
37+
$exclude-custom-properties: false,
38+
);
3739

3840
:host {
3941
@each $token, $value in $tokens {
40-
--_#{$token}: var(--md-suggestion-chip-#{$token}, #{$value});
42+
--_#{$token}: #{$value};
4143
}
4244

4345
// Support logical shape properties

0 commit comments

Comments
 (0)