|
2 | 2 | * Helper classes |
3 | 3 | * ================================= |
4 | 4 | * Non-semantic helper classes |
| 5 | + * - Clearfix |
| 6 | + * - State helpers |
| 7 | + * - Layout helpers |
| 8 | + * - Margin helpers |
| 9 | + * - Typography helpers |
| 10 | + * - Misc helpers |
5 | 11 | */ |
6 | 12 |
|
7 | 13 | /** |
8 | 14 | * Clearfix |
9 | 15 | * http://www.cssmojo.com/latest_new_clearfix_so_far/ |
10 | | - * See mixins/_utility.scss for a mixin version of this |
| 16 | + * @kickoff/utils also includes a mixin version of this |
11 | 17 | */ |
12 | 18 | .clearfix::after { |
13 | 19 | content: ""; |
14 | 20 | display: table; |
15 | 21 | clear: both; |
16 | 22 | } |
17 | 23 |
|
18 | | - |
19 | | -// For background image replacement |
20 | | -.ir { |
21 | | - background-color: transparent; |
22 | | - background-repeat: no-repeat; |
23 | | - border: 0; |
24 | | - direction: ltr; |
25 | | - display: block; |
26 | | - overflow: hidden; |
27 | | - text-align: left; |
28 | | - text-indent: -999em; |
29 | | - |
30 | | - br { |
31 | | - display: none; |
32 | | - } |
33 | | -} |
34 | | - |
| 24 | +/** |
| 25 | + * State helpers |
| 26 | + */ |
35 | 27 |
|
36 | 28 | // Hide from both screenreaders and browsers: h5bp.com/u |
37 | 29 | .is-hidden { |
38 | 30 | display: none !important; |
39 | 31 | visibility: hidden !important; |
40 | 32 | } |
41 | 33 |
|
42 | | -.is-shown { display: block; } |
| 34 | +.is-shown { display: block !important; } |
| 35 | +.is-visible { visibility: visible !important; } |
| 36 | + |
| 37 | +// Hide visually and from screenreaders, but maintain layout |
| 38 | +.is-invisible { visibility: hidden !important; } |
43 | 39 |
|
44 | 40 | // Hide only visually, but have it available for screenreaders: h5bp.com/v |
45 | 41 | .is-visuallyHidden { |
|
64 | 60 | } |
65 | 61 | } |
66 | 62 |
|
67 | | -// Hide visually and from screenreaders, but maintain layout |
68 | | -.is-invisible { visibility: hidden; } |
69 | | - |
70 | | -.l-floatLeft { |
71 | | - float: left; |
72 | | -} |
73 | | - |
74 | | -.l-floatRight { |
75 | | - float: right; |
76 | | -} |
| 63 | +/** |
| 64 | + * Layout helpers |
| 65 | + */ |
| 66 | +.l-floatLeft { float: left; } |
| 67 | +.l-floatRight { float: right; } |
77 | 68 |
|
78 | 69 | .l-clear { |
79 | 70 | clear: both; |
80 | 71 | float: none; |
81 | 72 | } |
82 | 73 |
|
| 74 | +/** |
| 75 | + * Margin helpers |
| 76 | + */ |
83 | 77 | .l-mb0 { margin-bottom: 0 !important; } |
| 78 | +.l-mb1 { margin-bottom: $baseline !important; } |
| 79 | +.l-mb2 { margin-bottom: ko-multiply($baseline, 2) !important; } |
| 80 | +.l-mb3 { margin-bottom: ko-multiply($baseline, 3) !important; } |
| 81 | + |
84 | 82 | .l-mt0 { margin-top: 0 !important; } |
| 83 | +.l-mb1 { margin-top: $baseline !important; } |
| 84 | +.l-mb2 { margin-top: ko-multiply($baseline, 2) !important; } |
| 85 | +.l-mb3 { margin-top: ko-multiply($baseline, 3) !important; } |
85 | 86 |
|
| 87 | +/** |
| 88 | + * Typography helpers |
| 89 | + */ |
| 90 | +.text-centre, |
| 91 | +.text-center { text-align: center; } |
| 92 | +.text-left { text-align: left; } |
| 93 | +.text-right { text-align: right; } |
| 94 | +.text-uppercase { text-transform: uppercase; } |
| 95 | +.text-lowercase { text-transform: lowercase; } |
| 96 | + |
| 97 | +// https://justmarkup.com/log/2015/07/dealing-with-long-words-in-css/ |
| 98 | +.text-hyphenate { |
| 99 | + overflow-wrap: break-word; |
| 100 | + word-wrap: break-word; |
| 101 | + hyphens: auto; |
| 102 | +} |
86 | 103 |
|
| 104 | +/** |
| 105 | + * Misc helpers |
| 106 | + */ |
87 | 107 | * { |
88 | 108 | -webkit-tap-highlight-color: transparent !important; |
89 | 109 | } |
90 | 110 |
|
| 111 | +// For background image replacement |
| 112 | +.ir { |
| 113 | + background-color: transparent; |
| 114 | + background-repeat: no-repeat; |
| 115 | + border: 0; |
| 116 | + direction: ltr; |
| 117 | + display: block; |
| 118 | + overflow: hidden; |
| 119 | + text-align: left; |
| 120 | + text-indent: -999em; |
| 121 | + |
| 122 | + br { |
| 123 | + display: none; |
| 124 | + } |
| 125 | +} |
| 126 | + |
91 | 127 | /* A hack for HTML5 contenteditable attribute on mobile */ |
92 | 128 | textarea[contenteditable] { |
93 | 129 | -webkit-appearance: none; |
|
0 commit comments