mirror of
https://github.com/material-components/material-web.git
synced 2024-10-26 21:56:56 +03:00
5e40a1bcec
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
40 lines
848 B
SCSS
40 lines
848 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-secondary-tab-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-secondary-tab-#{$token}: #{$value};
|
|
}
|
|
}
|
|
}
|
|
|
|
@mixin styles() {
|
|
$tokens: tokens.md-comp-secondary-tab-values(
|
|
$exclude-custom-properties: false,
|
|
);
|
|
|
|
:host {
|
|
// Only use the logical properties.
|
|
$tokens: map.remove($tokens, 'container-shape');
|
|
@each $token, $value in $tokens {
|
|
--_#{$token}: #{$value};
|
|
}
|
|
}
|
|
}
|