Skip to content

Commit 7f6dda5

Browse files
asynclizcopybara-github
authored andcommitted
refactor(divider): reduce CSS size
Reduces the size by removing private (`--_*`) custom properties. These are not needed since the component does not share styles across variants. Size before: 523b / 308b gzip Size after: 469b (-10%) / 292b gzip (-5%) PiperOrigin-RevId: 600904594
1 parent a3b2be8 commit 7f6dda5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

divider/internal/_divider.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
// go/keep-sorted start
77
@use 'sass:list';
8+
@use 'sass:map';
89
// go/keep-sorted end
910
// go/keep-sorted start
1011
@use '../../tokens';
@@ -26,16 +27,15 @@
2627

2728
@mixin styles() {
2829
$tokens: tokens.md-comp-divider-values();
30+
@each $token, $value in $tokens {
31+
$tokens: map.set($tokens, $token, var(--md-divider-#{$token}, #{$value}));
32+
}
2933

3034
:host {
31-
@each $token, $value in $tokens {
32-
--_#{$token}: var(--md-divider-#{$token}, #{$value});
33-
}
34-
3535
box-sizing: border-box;
36-
color: var(--_color);
36+
color: map.get($tokens, 'color');
3737
display: flex;
38-
height: var(--_thickness);
38+
height: map.get($tokens, 'thickness');
3939
width: 100%;
4040
}
4141

0 commit comments

Comments
 (0)