Repository navigation
Expand file tree
/
Copy path_button.scss
More file actions
160 lines (135 loc) · 3.13 KB
/
Copy path_button.scss
File metadata and controls
160 lines (135 loc) · 3.13 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
@use "../design-tokens/color";
@use "../design-tokens/gradient";
@use "../design-tokens/shadow";
@use "../design-tokens/typography";
$button-ease-in-sine: cubic-bezier(0.5, 0, 1, 0.5);
$button-ease-out-sine: cubic-bezier(0, 0.5, 0.5, 1);
// ----------
// Button
// ----------
@mixin Button {
position: relative;
display: inline-block;
box-sizing: border-box;
padding: 10.5px 21px;
color: color.$color-grayDarker;
font-weight: 500;
font-size: typography.$typography-body-fontSize;
font-family: typography.$typography-body-fontFamily;
line-height: 1;
white-space: nowrap;
text-decoration: none;
background: color.$color-white;
border-color: color.$color-utilitiesGray;
border-style: solid;
border-width: 1px;
border-radius: 4px;
box-shadow: shadow.$shadow-near;
cursor: pointer;
transition-timing-function: linear;
transition-duration: 150ms;
transition-property: background-color, border-color, color, box-shadow, filter;
appearance: none;
&::before {
position: absolute;
top: -5px;
right: -5px;
bottom: -5px;
left: -5px;
border: 2px solid color.$color-blue;
border-radius: 8px;
transform: scale(0.95, 0.9); // x scale is more noticable
opacity: 0;
transition: opacity 150ms linear, transform 150ms $button-ease-in-sine;
content: '';
pointer-events: none;
}
&::-moz-focus-inner {
border: 0;
}
&:focus,
&:hover {
border-color: #8f8f95;
}
&:focus {
outline: none;
&::before {
transform: scale(1);
opacity: 1;
transition: opacity 150ms linear, transform 150ms $button-ease-out-sine;
}
}
&:active {
transform: translateY(1px);
}
&:disabled {
@include Button--Disabled;
}
}
// ----------
// Modifiers
// ----------
@mixin Button--Black {
color: color.$color-white;
background: color.$color-grayDarker;
border-color: color.$color-grayDarker;
&:hover {
background: color.$color-black;
border-color: color.$color-black;
}
&:disabled {
@include Button--Disabled;
}
}
@mixin Button--Brand {
color: color.$color-white;
background: gradient.$gradient-brand;
border-color: transparent;
&:hover {
border-color: transparent;
filter: saturate(150%);
}
&:disabled {
@include Button--Disabled;
}
}
@mixin Button--Danger {
color: color.$color-red;
background: color.$color-white;
border-color: currentColor;
&:hover {
background: #fef7f9;
border-color: currentColor;
}
&:disabled {
@include Button--Disabled;
}
}
@mixin Button--Disabled {
color: color.$color-gray;
background: color.$color-grayLighter;
border: 1px solid color.$color-utilitiesGray;
box-shadow: none;
cursor: not-allowed;
&:focus,
&:hover {
color: color.$color-gray;
background: color.$color-grayLighter;
border: 1px solid color.$color-utilitiesGray;
box-shadow: none;
}
&:focus::before {
opacity: 0;
}
&:active {
color: color.$color-gray;
background: color.$color-grayLighter;
border-color: color.$color-utilitiesGray;
box-shadow: none;
transform: none;
}
}
@mixin Button--Small {
padding: 8px 14px;
font-size: 13px;
}