mirror of
https://github.com/material-components/material-web.git
synced 2026-03-09 00:09:23 +08:00
75 lines
1.7 KiB
SCSS
75 lines
1.7 KiB
SCSS
//
|
|
// Copyright 2021 Google LLC
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
// go/keep-sorted start
|
|
@use 'sass:map';
|
|
// go/keep-sorted end
|
|
// go/keep-sorted start
|
|
@use '../../sass/theme';
|
|
@use '../../tokens';
|
|
// go/keep-sorted end
|
|
|
|
// stylelint-disable selector-class-pattern --
|
|
// Selector '.md3-*' should only be used in this project.
|
|
|
|
@mixin theme($tokens) {
|
|
$tokens: theme.validate-theme(
|
|
tokens.md-comp-outlined-button-values(),
|
|
$tokens
|
|
);
|
|
|
|
@each $token, $value in $tokens {
|
|
--md-outlined-button-#{$token}: #{$value};
|
|
}
|
|
}
|
|
|
|
@mixin styles() {
|
|
$tokens: tokens.md-comp-outlined-button-values();
|
|
|
|
:host {
|
|
@each $token, $value in $tokens {
|
|
--_#{$token}: #{$value};
|
|
}
|
|
}
|
|
|
|
.md3-button__outline {
|
|
inset: 0;
|
|
border-style: solid;
|
|
position: absolute;
|
|
box-sizing: border-box;
|
|
border-color: var(--_outline-color);
|
|
border-start-start-radius: var(--_container-shape-start-start);
|
|
border-start-end-radius: var(--_container-shape-start-end);
|
|
border-end-start-radius: var(--_container-shape-end-start);
|
|
border-end-end-radius: var(--_container-shape-end-end);
|
|
|
|
.md3-button:active & {
|
|
border-color: var(--_pressed-outline-color);
|
|
}
|
|
|
|
.md3-button:disabled & {
|
|
border-color: var(--_disabled-outline-color);
|
|
opacity: var(--_disabled-outline-opacity);
|
|
}
|
|
}
|
|
|
|
.md3-button__outline,
|
|
.md3-button__ripple {
|
|
border-width: var(--_outline-width);
|
|
}
|
|
|
|
.md3-button__ripple {
|
|
inline-size: calc(100% - 2 * var(--_outline-width));
|
|
block-size: calc(100% - 2 * var(--_outline-width));
|
|
border-style: solid;
|
|
border-color: transparent;
|
|
}
|
|
}
|
|
|
|
@function _resolve-tokens($tokens) {
|
|
$tokens: shared.remove-unsupported-tokens($tokens);
|
|
@return $tokens;
|
|
}
|