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
This commit is contained in:
Elizabeth Mitchell 2024-01-23 14:16:11 -08:00 committed by Copybara-Service
parent a3b2be80fb
commit 7f6dda58b5

View File

@ -5,6 +5,7 @@
// go/keep-sorted start
@use 'sass:list';
@use 'sass:map';
// go/keep-sorted end
// go/keep-sorted start
@use '../../tokens';
@ -26,16 +27,15 @@
@mixin styles() {
$tokens: tokens.md-comp-divider-values();
@each $token, $value in $tokens {
$tokens: map.set($tokens, $token, var(--md-divider-#{$token}, #{$value}));
}
:host {
@each $token, $value in $tokens {
--_#{$token}: var(--md-divider-#{$token}, #{$value});
}
box-sizing: border-box;
color: var(--_color);
color: map.get($tokens, 'color');
display: flex;
height: var(--_thickness);
height: map.get($tokens, 'thickness');
width: 100%;
}