mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 13:46:10 +03:00
chore(divider): finalize tokens
PiperOrigin-RevId: 530924237
This commit is contained in:
parent
d84d48c299
commit
ae9fc76bbc
@ -4,24 +4,32 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use '../../sass/theme';
|
||||
@use 'sass:list';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use '../../tokens';
|
||||
// go/keep-sorted end
|
||||
|
||||
@mixin theme($tokens) {
|
||||
$tokens: theme.validate-theme(tokens.md-comp-divider-values(), $tokens);
|
||||
$tokens: theme.create-theme-vars($tokens, 'divider');
|
||||
$supported-tokens: tokens.$md-comp-divider-supported-tokens;
|
||||
|
||||
@include theme.emit-theme-vars($tokens);
|
||||
@each $token, $value in $tokens {
|
||||
@if list.index($supported-tokens, $token) == null {
|
||||
@error 'Token `#{$token}` is not a supported token.';
|
||||
}
|
||||
|
||||
@if $value {
|
||||
--md-divider-#{$token}: #{$value};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@mixin styles() {
|
||||
$tokens: tokens.md-comp-divider-values();
|
||||
$tokens: theme.create-theme-vars($tokens, 'divider');
|
||||
|
||||
:host {
|
||||
@each $token, $value in $tokens {
|
||||
--_#{$token}: #{$value};
|
||||
--_#{$token}: var(--md-divider-#{$token}, #{$value});
|
||||
}
|
||||
|
||||
box-sizing: border-box;
|
||||
|
@ -6,12 +6,23 @@
|
||||
// go/keep-sorted start
|
||||
@use './md-sys-color';
|
||||
@use './v0_172/md-comp-divider';
|
||||
@use './values';
|
||||
// go/keep-sorted end
|
||||
|
||||
$supported-tokens: (
|
||||
// go/keep-sorted start
|
||||
'color',
|
||||
'thickness',
|
||||
// go/keep-sorted end
|
||||
);
|
||||
|
||||
$_default: (
|
||||
'md-sys-color': md-sys-color.values-light(),
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
@return md-comp-divider.values($deps, $exclude-hardcoded-values);
|
||||
@return values.validate(
|
||||
md-comp-divider.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user