-
Notifications
You must be signed in to change notification settings - Fork 64
/
_helpers.scss
382 lines (310 loc) · 5.54 KB
/
_helpers.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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
/*------------------------------------*\
$HELPER
\*------------------------------------*/
/**
* A series of helper classes to use arbitrarily. Only use a helper class if an
* element/component doesn’t already have a class to which you could apply this
* styling, e.g. if you need to float `.main-nav` left then add `float:left;` to
* that ruleset as opposed to adding the `.float--left` class to the markup.
*
* A lot of these classes carry `!important` as you will always want them to win
* out over other selectors.
*/
/**
* Add/remove floats
*/
.float--right {
float: right !important;
}
.float--left {
float: left !important;
}
.float--none {
float: none !important;
}
/**
* Text alignment
*/
.text--left {
text-align: left !important;
}
.text--center {
text-align: center !important;
}
.text--right {
text-align: right !important;
}
/**
* Add/remove margins
*/
.push {
margin: 0 !important;
}
.push--top {
margin-top: 0 !important;
}
.push--right {
margin-right: 0 !important;
}
.push--bottom {
margin-bottom: 0 !important;
}
.push--left {
margin-left: 0 !important;
}
.push--ends {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
.push--sides {
margin-right: 0 !important;
margin-left: 0 !important;
}
.push-half {
margin: 0 !important;
}
.push-half--top {
margin-top: 0 !important;
}
.push-half--right {
margin-right: 0 !important;
}
.push-half--bottom {
margin-bottom: 0 !important;
}
.push-half--left {
margin-left: 0 !important;
}
.push-half--ends {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
.push-half--sides {
margin-right: 0 !important;
margin-left: 0 !important;
}
.flush {
margin: 0 !important;
}
.flush--top {
margin-top: 0 !important;
}
.flush--right {
margin-right: 0 !important;
}
.flush--bottom {
margin-bottom: 0 !important;
}
.flush--left {
margin-left: 0 !important;
}
.flush--ends {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
.flush--sides {
margin-right: 0 !important;
margin-left: 0 !important;
}
/**
* Add/remove paddings
*/
.soft {
padding: 0 !important;
}
.soft--top {
padding-top: 0 !important;
}
.soft--right {
padding-right: 0 !important;
}
.soft--bottom {
padding-bottom: 0 !important;
}
.soft--left {
padding-left: 0 !important;
}
.soft--ends {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.soft--sides {
padding-right: 0 !important;
padding-left: 0 !important;
}
.soft-half {
padding: 0 !important;
}
.soft-half--top {
padding-top: 0 !important;
}
.soft-half--right {
padding-right: 0 !important;
}
.soft-half--bottom {
padding-bottom: 0 !important;
}
.soft-half--left {
padding-left: 0 !important;
}
.soft-half--ends {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.soft-half--sides {
padding-right: 0 !important;
padding-left: 0 !important;
}
.hard {
padding: 0 !important;
}
.hard--top {
padding-top: 0 !important;
}
.hard--right {
padding-right: 0 !important;
}
.hard--bottom {
padding-bottom: 0 !important;
}
.hard--left {
padding-left: 0 !important;
}
.hard--ends {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.hard--sides {
padding-right: 0 !important;
padding-left: 0 !important;
}
.align--middle {
vertical-align: middle !important;
}
.align--top {
vertical-align: top !important;
}
.inline-block {
display: inline-block !important;
}
.display-block {
display: block !important;
}
/**
* Add a help cursor to any element that gives the user extra information on
* `:hover`.
*/
.informative {
cursor: help !important;
}
/**
* Mute an object by reducing its opacity.
*/
.muted {
opacity: 0.5 !important;
filter: alpha(opacity=50) !important;
}
/**
* Align items to the right where they imply progression/movement forward, e.g.:
*
<p class=proceed><a href=#>Read more...</a></p>
*
*/
.proceed {
text-align: right !important;
}
/**
* Add a right-angled quote to links that imply movement, e.g.:
*
<a href=# class=go>Read more</a>
*
*/
.go:after {
content: "\00A0" "\00BB" !important;
}
/**
* Apply capital case to an element (usually a `strong`).
*/
.caps {
text-transform: uppercase !important;
}
/**
* Underline text
*/
.underline {
text-decoration: underline !important;
}
.no--underline {
text-decoration: none !important;
}
/**
* Force no wrap on text
*/
.no-wrap {
white-space: nowrap !important;
}
/**
* Force long character sequences to split over lines, e.g. email addresses
*/
.word-wrap {
white-space: pre-line;
word-wrap: break-word;
word-break: break-all;
}
/**
* Hide content off-screen without resorting to `display:none;`, also provide
* breakpoint specific hidden elements.
*/
@mixin accessibility {
position: absolute;
overflow: hidden;
clip: rect(0 0 0 0);
height: 1px;
width: 1px;
margin: -1px;
padding: 0;
border: 0;
}
.accessibility,
.visuallyhidden {
@include accessibility;
}
.hidden,
.no-js .js-visible,
.js .js-hidden {
display: none !important;
}
// Base-level rules cannot contain the parent-selector-referencing character '&'.
.hidden--mobile {
@include media(mobile) {
display: none !important;
}
}
.hidden--tablet {
@include media(tablet) {
display: none !important;
}
}
%no-bullet {
list-style: none;
}
.no-bullets {
@extend %no-bullet;
}
/**
* Truncate text with an ellipsis
*/
.truncate {
text-overflow: ellipsis;
overflow: hidden;
}
/**
* Table cells need this hack in order
* for truncation to work normally
*/
.truncate--table-cell {
max-width: 1px;
}
.truncate--small {
max-width: 125px;
}