-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
box.scss
284 lines (228 loc) · 5.15 KB
/
box.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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
// Box
// Intended to replace simple-box, boxed-group, and table-list
.Box {
background-color: $white;
border: $border-width $border-style $border-gray-dark;
border-radius: $border-radius;
}
// Box padding density options
.Box--condensed {
line-height: $lh-condensed;
.Box-header {
padding: $spacer-2 $spacer-3;
}
.Box-body {
padding: $spacer-2 $spacer-3;
}
.Box-footer {
padding: $spacer-2 $spacer-3;
}
.Box-btn-octicon {
&.btn-octicon {
padding: $spacer-2 $spacer-3;
margin: (-$spacer-2) (-$spacer-3);
line-height: $lh-condensed;
}
}
.Box-row {
padding: $spacer-2 $spacer-3;
}
}
.Box--spacious {
.Box-header {
padding: $spacer-4;
line-height: $lh-condensed;
}
.Box-title {
font-size: $h3-size;
}
.Box-body {
padding: $spacer-4;
}
.Box-footer {
padding: $spacer-4;
}
.Box-btn-octicon {
&.btn-octicon {
padding: $spacer-4;
margin: (-$spacer-4) (-$spacer-4);
}
}
.Box-row {
padding: $spacer-4;
}
}
.Box-header {
padding: $spacer-3;
margin: -$border-width -$border-width 0;
background-color: $bg-gray;
border-color: $border-gray-dark;
border-style: $border-style;
border-width: $border-width;
border-top-left-radius: $border-radius;
border-top-right-radius: $border-radius;
}
.Box-title {
font-size: $body-font-size;
font-weight: $font-weight-bold;
}
.Box-body {
padding: $spacer-3;
border-bottom: $border-width $border-style $border-gray;
// Ensures bottom-border doesn't poke out when .Box-body used without box-footer
&:last-of-type {
margin-bottom: -$border-width;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;
}
}
// Box rows
.Box-row {
padding: $spacer-3;
margin-top: -1px;
list-style-type: none; // To account for applying Box component to a list
border-top: $border-width $border-style $border-gray;
&:first-of-type {
border-top-color: transparent;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
&:last-of-type {
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;
}
// Adds a blue vertical line to the left of the row
// For indicating a row item is unread
&.Box-row--unread,
// .unread to be deprecated with .Box-row-unread
&.unread {
box-shadow: 2px 0 0 $blue inset;
}
&.navigation-focus {
// Focus styles for when drag icon
.Box-row--drag-button {
color: $text-blue;
cursor: grab;
opacity: 100;
}
// Grabbing while row is dragged
&.is-dragging .Box-row--drag-button {
cursor: grabbing;
}
// Row dragging styles
&.sortable-chosen {
background-color: $bg-gray-light;
}
// Makes dragging row background gray
&.sortable-ghost {
background-color: $bg-gray;
// Hides contents of row while dragging so row looks solid gray
.Box-row--drag-hide {
opacity: 0;
}
}
}
}
.Box-row--focus-gray {
&.navigation-focus {
background-color: $bg-gray;
}
}
.Box-row--focus-blue {
&.navigation-focus {
background-color: $bg-blue-light;
}
}
.Box-row--hover-gray {
&:hover {
background-color: $bg-gray;
}
}
.Box-row--hover-blue {
&:hover {
background-color: $bg-blue-light;
}
}
// Optional link style
// Makes links on mobile blue since they don't have hover state,
// and links are dark-gray with blue hover on desktop.
.Box-row-link {
@include breakpoint(md) {
color: $text-gray-dark;
text-decoration: none;
&:hover {
color: $text-blue;
text-decoration: none;
}
}
}
// Optional drag icon styles for reordering items
// Focus styles included in .Box-row above
.Box-row--drag-button {
opacity: 0;
}
.Box-footer {
padding: $spacer-3;
margin-top: -1px; // prevents double border when used with .Box-body
border-top: $border-width $border-style $border-gray;
}
// Option for a box with scrolling content
.Box--scrollable {
max-height: 324px;
overflow: scroll;
}
// Box themes
.Box--blue {
border-color: $border-blue-light;
.Box-header {
background-color: $bg-blue-light;
border-color: $border-blue-light;
}
.Box-body {
border-color: $border-blue-light;
}
.Box-row {
border-color: $border-blue-light;
}
.Box-footer {
border-color: $border-blue-light;
}
}
// Applies and red border to the outside of the box,
// but not to the border separating rows.
.Box--danger {
border-color: $border-red;
.Box-row {
&:first-of-type {
border-color: $border-red;
}
}
.Box-body {
&:last-of-type {
border-color: $border-red;
}
}
}
.Box-header--blue {
background-color: $bg-blue-light;
border-color: $border-blue-light;
}
// Box row highlight themes
.Box-row--yellow {
background-color: $yellow-100;
}
.Box-row--blue {
background-color: $bg-blue-light;
}
.Box-row--gray {
background-color: $bg-gray;
}
//Box with btn-octicon
.Box-btn-octicon {
// Increase specificity when btn-octicon is used because comes after .Box in the cascade
&.btn-octicon {
padding: $spacer-3 $spacer-3;
margin: (-$spacer-3) (-$spacer-3);
line-height: $lh-default; // override btn-octicon line-height
}
}