material-web/chips/internal/_assist-chip.scss
Elizabeth Mitchell 5e40a1bcec chore: create shape logical tokens in Sass component token files
Adds `@material/web/tokens/internal/shape` to take a shape token and create 4 logical tokens from its value.

All components' logical shape tokens are now generated by the token files themselves, rather than added in each component's styles.

PiperOrigin-RevId: 601783846
2024-01-26 09:13:58 -08:00

46 lines
941 B
SCSS

//
// Copyright 2023 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// go/keep-sorted start
@use 'sass:list';
@use 'sass:map';
// go/keep-sorted end
// go/keep-sorted start
@use '../../tokens';
// go/keep-sorted end
@mixin theme($tokens) {
$supported-tokens: tokens.$md-comp-assist-chip-supported-tokens;
@each $token, $value in $tokens {
@if list.index($supported-tokens, $token) == null {
@error 'Token `#{$token}` is not a supported token.';
}
@if $value {
--md-assist-chip-#{$token}: #{$value};
}
}
}
@mixin styles() {
$tokens: tokens.md-comp-assist-chip-values(
$exclude-custom-properties: false,
);
:host {
// Only use the logical properties.
$tokens: map.remove($tokens, 'container-shape');
@each $token, $value in $tokens {
--_#{$token}: #{$value};
}
}
@media (forced-colors: active) {
.link .outline {
border-color: ActiveText;
}
}
}