material-web/button/internal/_elevated-button.scss
Andrew Jakubowicz 601ebb669c fix(button)!: rename "lib" directory to "internal"
BREAKING CHANGE: Rename `@material/web/button/lib` to `@material/web/button/internal`. Prefer not using internal files.

PiperOrigin-RevId: 549999271
2023-07-21 11:20:19 -07:00

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)
);
}
}