-
Notifications
You must be signed in to change notification settings - Fork 905
/
_outlined-button.scss
74 lines (62 loc) · 1.71 KB
/
_outlined-button.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// 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-elevated-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;
}