-
Notifications
You must be signed in to change notification settings - Fork 31
/
button.scss
94 lines (77 loc) · 1.89 KB
/
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@import "../style/base";
@import "button-vars";
:host {
--_button-color: #{$button-color};
--_button-bg: #{$button-bg};
--_button-shadow-color: #{$button-shadow-color};
color: var(--_button-color);
background: var(--_button-bg);
box-shadow: elevation(1, var(--_button-shadow-color));
padding: $button-padding;
font-size: $button-font-size;
border-radius: $button-border-radius;
font-family: $button-font-family;
transition: $button-transition;
letter-spacing: $button-letter-spacing;
line-height: 1;
text-transform: uppercase;
cursor: pointer;
text-align: center;
user-select: none;
outline: none;
display: inline-flex;
align-items: center;
justify-content: center;
// Add ellipsis when the text is too long
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
// Make sure the ripple is behind the text but visible inside the button
position: relative;
z-index: 0;
}
:host([fab]) {
width: $button-fab-size;
height: $button-fab-size;
padding: 0;
letter-spacing: 0;
display: inline-flex;
justify-content: center;
align-items: center;
border-radius: 100%;
}
:host([inverted]) {
color: var(--_button-bg);
background: var(--_button-color);
}
:host([outlined]) {
border: $button-border-outlined;
}
:host(:hover), :host(:focus) {
--_button-color: #{$button-color-hover};
--_button-bg: #{$button-bg-hover};
--_button-shadow-color: #{$button-shadow-color-hover};
will-change: background, color, box-shadow;
}
:host(:active) {
--_button-color: #{$button-color-active};
--_button-bg: #{$button-bg-active};
box-shadow: elevation(4, var(--_button-shadow-color));
}
:host([flat]:focus) {
background: $button-bg-active-flat;
}
:host([disabled]) {
--_button-color: #{$button-color-disabled};
--_button-bg: #{$button-bg-disabled};
box-shadow: none;
cursor: default;
pointer-events: none;
}
:host([flat]) {
box-shadow: none;
background: none;
}
#ripple {
z-index: -1;
}