-
Notifications
You must be signed in to change notification settings - Fork 570
/
Copy pathbuttons.scss
125 lines (107 loc) · 2.42 KB
/
buttons.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@use 'variables' as *;
@use 'mixins';
// Resets button styles
button {
background: transparent;
border: none;
padding: 0;
cursor: pointer;
font-size: 14px;
appearance: none;
vertical-align: baseline;
&:focus {
outline: none;
}
&:focus-visible {
outline: $focus-outline;
}
svg {
cursor: pointer;
}
}
// Generic button base class
// Can be used by itself, or in conjunction with the .button-* modifier classes
.button {
cursor: pointer;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
margin: 0;
overflow: hidden;
text-decoration: none;
vertical-align: top;
transition: $anim-fast;
-webkit-tap-highlight-color: transparent;
background: transparent;
border-color: var(--tertiary-accent-color);
border-style: solid;
border-width: 2px;
color: var(--tertiary-accent-color);
font-size: 14px;
line-height: 1.5;
font-weight: $bold;
border-radius: $border-radius;
padding: 8px 12px;
&:active,
&.active {
background: var(--primary-button-bg-color);
color: var(--primary-button-fg-color);
}
&[disabled],
&:disabled {
opacity: 0.5;
}
}
// Primary buttons. Solid buttons.
.button-primary {
background: var(--primary-button-bg-color);
border-color: var(--secondary-color);
color: var(--primary-button-fg-color);
}
// Compact buttons. Use to make buttons smaller.
.button-compact {
padding: 0.3em 18px;
line-height: 1.25em;
font-size: 90%;
}
// Danger buttons
.button-danger {
color: var(--tertiary-highlight-color);
border-color: var(--tertiary-highlight-color);
&:active {
background: var(--tertiary-highlight-color);
color: var(--background-color);
}
}
// Borderless buttons don't have a border or background. Use it for icon or text buttons.
.button-borderless {
border-width: 0;
background: transparent;
svg[class^='icon-'] {
transition: $anim-fast;
}
}
.button-borderless.button-danger {
&:active {
color: var(--tertiary-highlight-color);
}
}
// Segmented control wrapper
.segmented-control {
display: flex;
flex-direction: row;
// Individual segmented control buttons
.button-segmented-control {
border-radius: 0;
border-left-width: 0;
padding-left: 0;
padding-right: 0;
&:first-child {
border-left-width: 2px;
border-radius: $border-radius 0 0 $border-radius;
}
&:last-child {
border-radius: 0 $border-radius $border-radius 0;
}
}
}