mirror of
https://github.com/material-components/material-web.git
synced 2026-01-09 07:21:09 +08:00
Moves the `button` component to `components/button` and creates re-exports in the original `button` directory for backward compatibility. This change also updates internal imports and includes copyright headers in the re-export files.
42 lines
911 B
SCSS
42 lines
911 B
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: tokens.$md-comp-text-button-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-text-button-#{$token}: #{$value};
|
|
}
|
|
}
|
|
}
|
|
|
|
@mixin styles() {
|
|
$tokens: tokens.md-comp-text-button-values();
|
|
|
|
:host {
|
|
// Only use the logical properties.
|
|
$tokens: map.remove($tokens, 'container-shape');
|
|
@each $token, $value in $tokens {
|
|
--_#{$token}: #{$value};
|
|
}
|
|
|
|
--_container-color: none;
|
|
--_disabled-container-color: none;
|
|
--_disabled-container-opacity: 0;
|
|
}
|
|
}
|