mirror of
https://github.com/material-components/material-web.git
synced 2024-11-09 16:19:39 +03:00
601ebb669c
BREAKING CHANGE: Rename `@material/web/button/lib` to `@material/web/button/internal`. Prefer not using internal files. PiperOrigin-RevId: 549999271
63 lines
1.5 KiB
SCSS
63 lines
1.5 KiB
SCSS
//
|
|
// Copyright 2021 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: list.join(
|
|
tokens.$md-comp-elevated-button-supported-tokens,
|
|
(
|
|
'container-shape-start-start',
|
|
'container-shape-start-end',
|
|
'container-shape-end-end',
|
|
'container-shape-end-start'
|
|
)
|
|
);
|
|
|
|
@each $token, $value in $tokens {
|
|
@if list.index($supported-tokens, $token) == null {
|
|
@error 'Token `#{$token}` is not a supported token.';
|
|
}
|
|
|
|
@if $value {
|
|
--md-elevated-button-#{$token}: #{$value};
|
|
}
|
|
}
|
|
}
|
|
|
|
@mixin styles() {
|
|
$tokens: tokens.md-comp-elevated-button-values();
|
|
|
|
:host {
|
|
@each $token, $value in $tokens {
|
|
--_#{$token}: var(--md-elevated-button-#{$token}, #{$value});
|
|
}
|
|
|
|
// Support logical shape properties
|
|
--_container-shape-start-start: var(
|
|
--md-elevated-button-container-shape-start-start,
|
|
var(--_container-shape)
|
|
);
|
|
--_container-shape-start-end: var(
|
|
--md-elevated-button-container-shape-start-end,
|
|
var(--_container-shape)
|
|
);
|
|
--_container-shape-end-end: var(
|
|
--md-elevated-button-container-shape-end-end,
|
|
var(--_container-shape)
|
|
);
|
|
--_container-shape-end-start: var(
|
|
--md-elevated-button-container-shape-end-start,
|
|
var(--_container-shape)
|
|
);
|
|
}
|
|
}
|