mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 13:46:10 +03:00
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:
parent
a3b2be80fb
commit
7f6dda58b5
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
// go/keep-sorted start
|
// go/keep-sorted start
|
||||||
@use 'sass:list';
|
@use 'sass:list';
|
||||||
|
@use 'sass:map';
|
||||||
// go/keep-sorted end
|
// go/keep-sorted end
|
||||||
// go/keep-sorted start
|
// go/keep-sorted start
|
||||||
@use '../../tokens';
|
@use '../../tokens';
|
||||||
@ -26,16 +27,15 @@
|
|||||||
|
|
||||||
@mixin styles() {
|
@mixin styles() {
|
||||||
$tokens: tokens.md-comp-divider-values();
|
$tokens: tokens.md-comp-divider-values();
|
||||||
|
@each $token, $value in $tokens {
|
||||||
|
$tokens: map.set($tokens, $token, var(--md-divider-#{$token}, #{$value}));
|
||||||
|
}
|
||||||
|
|
||||||
:host {
|
:host {
|
||||||
@each $token, $value in $tokens {
|
|
||||||
--_#{$token}: var(--md-divider-#{$token}, #{$value});
|
|
||||||
}
|
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: var(--_color);
|
color: map.get($tokens, 'color');
|
||||||
display: flex;
|
display: flex;
|
||||||
height: var(--_thickness);
|
height: map.get($tokens, 'thickness');
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user