bitstyles 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. checksums.yaml +7 -0
  2. data/.eslintignore +5 -0
  3. data/.eslintrc +4 -0
  4. data/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  5. data/.gitignore +19 -0
  6. data/.nvmrc +1 -0
  7. data/.stylelintrc +166 -0
  8. data/CODE_OF_CONDUCT.md +49 -0
  9. data/Gemfile +4 -0
  10. data/LICENSE.txt +7 -0
  11. data/README.md +251 -0
  12. data/Rakefile +2 -0
  13. data/bin/console +14 -0
  14. data/bin/setup +8 -0
  15. data/bitstyles.gemspec +29 -0
  16. data/bower.json +31 -0
  17. data/build/.gitignore +4 -0
  18. data/lib/bitstyles/engine.rb +9 -0
  19. data/lib/bitstyles/version.rb +3 -0
  20. data/lib/bitstyles.rb +2 -0
  21. data/package.json +85 -0
  22. data/postcss_build.json +12 -0
  23. data/postcss_lint.json +11 -0
  24. data/scripts/styleguide.sh +16 -0
  25. data/scss/bitstyles/base/_figure.scss +9 -0
  26. data/scss/bitstyles/base/_forms.scss +182 -0
  27. data/scss/bitstyles/base/_hr.scss +6 -0
  28. data/scss/bitstyles/base/_images.scss +13 -0
  29. data/scss/bitstyles/base/_link.scss +32 -0
  30. data/scss/bitstyles/base/_media.scss +24 -0
  31. data/scss/bitstyles/base/_typography.scss +354 -0
  32. data/scss/bitstyles/components/_expander.scss +45 -0
  33. data/scss/bitstyles/components/_modal.scss +170 -0
  34. data/scss/bitstyles/generic/_box-sizing.scss +16 -0
  35. data/scss/bitstyles/generic/_normalize.scss +421 -0
  36. data/scss/bitstyles/layout/_content.scss +33 -0
  37. data/scss/bitstyles/layout/_grid.scss +148 -0
  38. data/scss/bitstyles/layout/_topbar.scss +25 -0
  39. data/scss/bitstyles/layout/_width.scss +48 -0
  40. data/scss/bitstyles/objects/_absolute-center.scss +16 -0
  41. data/scss/bitstyles/objects/_absolute-cover.scss +16 -0
  42. data/scss/bitstyles/objects/_block.scss +14 -0
  43. data/scss/bitstyles/objects/_bordered-header.scss +39 -0
  44. data/scss/bitstyles/objects/_break-long-words.scss +15 -0
  45. data/scss/bitstyles/objects/_button--icon.scss +30 -0
  46. data/scss/bitstyles/objects/_button.scss +103 -0
  47. data/scss/bitstyles/objects/_clearfix.scss +19 -0
  48. data/scss/bitstyles/objects/_expander.scss +45 -0
  49. data/scss/bitstyles/objects/_fixed-ratio.scss +23 -0
  50. data/scss/bitstyles/objects/_flex.scss +24 -0
  51. data/scss/bitstyles/objects/_hidden.scss +33 -0
  52. data/scss/bitstyles/objects/_icon.scss +43 -0
  53. data/scss/bitstyles/objects/_input.scss +83 -0
  54. data/scss/bitstyles/objects/_label.scss +15 -0
  55. data/scss/bitstyles/objects/_link.scss +29 -0
  56. data/scss/bitstyles/objects/_list-reset.scss +25 -0
  57. data/scss/bitstyles/objects/_media.scss +20 -0
  58. data/scss/bitstyles/objects/_truncate-with-ellipsis.scss +18 -0
  59. data/scss/bitstyles/objects/_typography.scss +92 -0
  60. data/scss/bitstyles/objects/_vertical-center.scss +16 -0
  61. data/scss/bitstyles/objects/_visuallyhidden.scss +30 -0
  62. data/scss/bitstyles/settings/_bordered-header.scss +3 -0
  63. data/scss/bitstyles/settings/_button--icon.scss +5 -0
  64. data/scss/bitstyles/settings/_button.scss +18 -0
  65. data/scss/bitstyles/settings/_content.scss +5 -0
  66. data/scss/bitstyles/settings/_global.animation.scss +3 -0
  67. data/scss/bitstyles/settings/_global.breakpoints.scss +12 -0
  68. data/scss/bitstyles/settings/_global.color-base.scss +14 -0
  69. data/scss/bitstyles/settings/_global.color-theme.scss +11 -0
  70. data/scss/bitstyles/settings/_global.layout.scss +7 -0
  71. data/scss/bitstyles/settings/_global.setup.scss +1 -0
  72. data/scss/bitstyles/settings/_global.typography.scss +28 -0
  73. data/scss/bitstyles/settings/_grid.scss +1 -0
  74. data/scss/bitstyles/settings/_hidden.scss +1 -0
  75. data/scss/bitstyles/settings/_icon.scss +5 -0
  76. data/scss/bitstyles/settings/_input.scss +12 -0
  77. data/scss/bitstyles/settings/_link.scss +4 -0
  78. data/scss/bitstyles/settings/_modal.scss +9 -0
  79. data/scss/bitstyles/settings/_topbar.scss +2 -0
  80. data/scss/bitstyles/settings/_visuallyhidden.scss +1 -0
  81. data/scss/bitstyles/settings/_width.scss +12 -0
  82. data/scss/bitstyles/tools/_absolute-center.scss +13 -0
  83. data/scss/bitstyles/tools/_absolute-cover.scss +13 -0
  84. data/scss/bitstyles/tools/_block.scss +9 -0
  85. data/scss/bitstyles/tools/_break-long-words.scss +11 -0
  86. data/scss/bitstyles/tools/_clearfix.scss +13 -0
  87. data/scss/bitstyles/tools/_fixed-ratio.scss +27 -0
  88. data/scss/bitstyles/tools/_flex.scss +15 -0
  89. data/scss/bitstyles/tools/_font-face.scss +21 -0
  90. data/scss/bitstyles/tools/_hidden.scss +11 -0
  91. data/scss/bitstyles/tools/_list-reset.scss +17 -0
  92. data/scss/bitstyles/tools/_media-query.scss +30 -0
  93. data/scss/bitstyles/tools/_media.scss +15 -0
  94. data/scss/bitstyles/tools/_truncate-with-ellipsis.scss +13 -0
  95. data/scss/bitstyles/tools/_typography-conversions.scss +18 -0
  96. data/scss/bitstyles/tools/_typography.scss +17 -0
  97. data/scss/bitstyles/tools/_vertical-center.scss +11 -0
  98. data/scss/bitstyles/tools/_visuallyhidden.scss +18 -0
  99. data/scss/bitstyles/tools/_width.scss +30 -0
  100. data/scss/bitstyles/tools/_zindex.scss +36 -0
  101. data/scss/bitstyles/trumps/_background-color.scss +18 -0
  102. data/scss/bitstyles/trumps/_color.scss +19 -0
  103. data/scss/bitstyles/trumps/_margin.scss +39 -0
  104. data/scss/bitstyles/trumps/_no-margin.scss +39 -0
  105. data/scss/bitstyles/trumps/_no-padding.scss +43 -0
  106. data/scss/bitstyles/trumps/_padding.scss +43 -0
  107. data/scss/bitstyles/trumps/_text-align.scss +21 -0
  108. data/scss/bitstyles/trumps/_text-style.scss +19 -0
  109. data/scss/bitstyles/trumps/_text-weight.scss +25 -0
  110. data/scss/bitstyles.scss +167 -0
  111. data/styleguide/assets/images/icons.svg +12 -0
  112. data/styleguide/assets/images/placeholder_16-9.png +0 -0
  113. data/styleguide/assets/images/placeholder_button.png +0 -0
  114. data/styleguide/assets/javascripts/a11y-dialog.js +135 -0
  115. data/styleguide/assets/javascripts/expander.js +40 -0
  116. data/styleguide/assets/javascripts/modal.js +55 -0
  117. data/styleguide/assets/javascripts/styleguide-init.js +6 -0
  118. data/styleguide/assets/stylesheets/styleguide-extras.css +17 -0
  119. metadata +192 -0
@@ -0,0 +1,354 @@
1
+ /* stylelint-disable selector-no-type */
2
+ html {
3
+ font-family: $bitstyles-font-family-body;
4
+ font-size: px-to-em($bitstyles-font-size-base-small);
5
+ line-height: 1.5;
6
+ color: map-get($bitstyles-colors-theme, 'text');
7
+ background: map-get($bitstyles-colors-theme, 'background');
8
+
9
+ &.fonts-loaded {
10
+ font-family: $bitstyles-font-family-body-loaded;
11
+ }
12
+ }
13
+
14
+ // Headers
15
+ //
16
+ // Semantic headers, `<h1>` being the most important in a section or page, `<h6>` being the least.
17
+ //
18
+ // markup:
19
+ // <h1>Header 1</h1>
20
+ // <h2>Header 2</h2>
21
+ // <h3>Header 3</h3>
22
+ // <h4>Header 4</h4>
23
+ // <h5>Header 5</h5>
24
+ // <h6>Header 6</h6>
25
+ //
26
+ // Styleguide 4.1
27
+
28
+ h1,
29
+ h2,
30
+ h3,
31
+ h4,
32
+ h5,
33
+ h6 {
34
+ @include generic-heading;
35
+ }
36
+
37
+ h1 {
38
+ @include font-size($bitstyles-font-size-h1-small);
39
+ }
40
+
41
+ h2 {
42
+ @include font-size($bitstyles-font-size-h2-small);
43
+ }
44
+
45
+ h3 {
46
+ @include font-size($bitstyles-font-size-h3-small);
47
+ }
48
+
49
+ h4 {
50
+ @include font-size($bitstyles-font-size-h4-small);
51
+ }
52
+
53
+ h5 {
54
+ @include font-size($bitstyles-font-size-h5-small);
55
+ }
56
+
57
+ h6 {
58
+ @include font-size($bitstyles-font-size-h6-small);
59
+ }
60
+
61
+ @include media-query($bitstyles-typography-breakpoint) {
62
+ html {
63
+ font-size: px-to-em($bitstyles-font-size-base, $bitstyles-font-size-base);
64
+ }
65
+
66
+ h1 {
67
+ @include font-size($bitstyles-font-size-h1, $bitstyles-font-size-base);
68
+ }
69
+
70
+ h2 {
71
+ @include font-size($bitstyles-font-size-h2, $bitstyles-font-size-base);
72
+ }
73
+
74
+ h3 {
75
+ @include font-size($bitstyles-font-size-h3, $bitstyles-font-size-base);
76
+ }
77
+
78
+ h4 {
79
+ @include font-size($bitstyles-font-size-h4, $bitstyles-font-size-base);
80
+ }
81
+
82
+ h5 {
83
+ @include font-size($bitstyles-font-size-h5, $bitstyles-font-size-base);
84
+ }
85
+
86
+ h6 {
87
+ @include font-size($bitstyles-font-size-h6, $bitstyles-font-size-base);
88
+ }
89
+ }
90
+
91
+ // Paragraphs
92
+ //
93
+ // A paragraph of text.
94
+ //
95
+ // markup:
96
+ // <p>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer. Gummies cheesecake oat cake sugar plum icing cupcake tiramisu bonbon. Cotton candy chupa chups tootsie roll chupa chups cotton candy liquorice jelly gingerbread. Pastry gummi bears liquorice tart cotton candy marshmallow. Ice cream cotton candy chocolate cake cookie. Bonbon candy jelly-o sugar plum cotton candy carrot cake icing ice cream. Sweet chocolate marzipan. Candy canes danish cake carrot cake bonbon. Gummi bears sesame snaps tart bear claw pie chocolate bar. Ice cream candy canes sugar plum cookie. Macaroon biscuit biscuit carrot cake liquorice. Muffin pudding gingerbread powder jelly-o chocolate bar powder jelly beans toffee.</p>
97
+ //
98
+ // Styleguide 4.2
99
+
100
+ p {
101
+ margin: 0 0 $bitstyles-spacing;
102
+ }
103
+
104
+ // Address
105
+ //
106
+ // Address element. Often used to indicate authorship and contact information.
107
+ //
108
+ // markup:
109
+ // <address>Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</address
110
+ //
111
+ // Styleguide 4.4
112
+ address {
113
+ font-style: normal;
114
+ }
115
+
116
+ // Definition list
117
+ //
118
+ // Used to define terms.
119
+ //
120
+ // markup:
121
+ // <dl>
122
+ // <dt>Gummies cheesecake oat cake sugar plum icing cupcake tiramisu bonbon.</dt>
123
+ // <dd>Gummies cheesecake oat cake sugar plum icing cupcake tiramisu bonbon.</dd>
124
+ // </dl>
125
+ //
126
+ // Styleguide 4.5
127
+
128
+ dt {
129
+ font-weight: $bitstyles-font-weight-bold;
130
+ }
131
+
132
+ // List - Unordered
133
+ //
134
+ // An unordered list.
135
+ //
136
+ // markup:
137
+ // <ul>
138
+ // <li>Pie cotton candy chupa chups.</li>
139
+ // <li>Liquorice cheesecake wafer.</li>
140
+ // <li>Gummies cheesecake oat cake sugar.</li>
141
+ // </ul>
142
+ //
143
+ // Styleguide 4.6
144
+
145
+ // List - Ordered
146
+ //
147
+ // An unordered list.
148
+ //
149
+ // markup:
150
+ // <ol>
151
+ // <li>Pie cotton candy chupa chups.</li>
152
+ // <li>Liquorice cheesecake wafer.</li>
153
+ // <li>Gummies cheesecake oat cake sugar.</li>
154
+ // </ol>
155
+ //
156
+ // Styleguide 4.7
157
+
158
+ // Blockquote
159
+ //
160
+ // Quoted text.
161
+ //
162
+ // markup:
163
+ // <blockquote>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer. Gummies cheesecake oat cake sugar plum icing cupcake tiramisu bonbon. Cotton candy chupa chups tootsie roll chupa chups cotton candy liquorice jelly</blockquote>
164
+ //
165
+ // Styleguide 4.8
166
+
167
+ // Typographic styles
168
+ //
169
+ // Inline elements that have a default typographic representation in a browser.
170
+ //
171
+ // Styleguide 4.9
172
+
173
+ // strong
174
+ //
175
+ // markup:
176
+ // <strong>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer. Gummies cheesecake oat cake sugar plum icing cupcake tiramisu bonbon. Cotton candy chupa chups tootsie roll chupa chups cotton candy liquorice jelly</strong>
177
+ //
178
+ // Styleguide 4.9.1
179
+
180
+ // em
181
+ //
182
+ // markup:
183
+ // <em>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</em>
184
+ //
185
+ // Styleguide 4.9.2
186
+
187
+ // pre
188
+ //
189
+ // markup:
190
+ // <pre>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</pre>
191
+ //
192
+ // Styleguide 4.9.3
193
+
194
+ // code
195
+ //
196
+ // markup:
197
+ // <code>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</code>
198
+ //
199
+ // Styleguide 4.9.4
200
+
201
+ // kbd
202
+ //
203
+ // markup:
204
+ // <kbd>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</kbd>
205
+ //
206
+ // Styleguide 4.9.5
207
+
208
+ // samp
209
+ //
210
+ // markup:
211
+ // <samp>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</samp>
212
+ //
213
+ // Styleguide 4.9.6
214
+
215
+ // var
216
+ //
217
+ // markup:
218
+ // <var>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</var>
219
+ //
220
+ // Styleguide 4.9.7
221
+
222
+ // cite
223
+ //
224
+ // markup:
225
+ // <cite>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</cite>
226
+ //
227
+ // Styleguide 4.9.8
228
+
229
+ // del
230
+ //
231
+ // markup:
232
+ // <del>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</del>
233
+ //
234
+ // Styleguide 4.9.9
235
+
236
+ // abbr
237
+ //
238
+ // markup:
239
+ // <abbr>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</abbr>
240
+ //
241
+ // Styleguide 4.9.10
242
+
243
+ // i
244
+ //
245
+ // markup:
246
+ // <i>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</i>
247
+ //
248
+ // Styleguide 4.9.11
249
+
250
+ // b
251
+ //
252
+ // markup:
253
+ // <b>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</b>
254
+ //
255
+ // Styleguide 4.9.12
256
+
257
+ // ins
258
+ //
259
+ // markup:
260
+ // <ins>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</ins>
261
+ //
262
+ // Styleguide 4.9.13
263
+
264
+ // dfn
265
+ //
266
+ // markup:
267
+ // <dfn>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</dfn>
268
+ //
269
+ // Styleguide 4.9.14
270
+
271
+ // small
272
+ //
273
+ // markup:
274
+ // <small>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</small>
275
+ //
276
+ // Styleguide 4.9.15
277
+
278
+ // sub
279
+ //
280
+ // markup:
281
+ // <sub>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</sub>
282
+ //
283
+ // Styleguide 4.9.16
284
+
285
+ // sup
286
+ //
287
+ // markup:
288
+ // <sup>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</sup>
289
+ //
290
+ // Styleguide 4.9.17
291
+
292
+ // big
293
+ //
294
+ // markup:
295
+ // <big>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</big>
296
+ //
297
+ // Styleguide 4.9.18
298
+
299
+ // s
300
+ //
301
+ // markup:
302
+ // <s>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</s>
303
+ //
304
+ // Styleguide 4.9.19
305
+
306
+ // strike
307
+ //
308
+ // markup:
309
+ // <strike>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</strike>
310
+ //
311
+ // Styleguide 4.9.20
312
+
313
+ // q
314
+ //
315
+ // markup:
316
+ // <q>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</q>
317
+ //
318
+ // Styleguide 4.9.21
319
+
320
+ // time
321
+ //
322
+ // markup:
323
+ // <time>20:57</time>
324
+ //
325
+ // Styleguide 4.9.22
326
+
327
+ // Table
328
+ //
329
+ // markup:
330
+ // <table>
331
+ // <caption>Awesome caption</caption>
332
+ // <thead>
333
+ // <tr>
334
+ // <th>Header content 1</th>
335
+ // <th>Header content 2</th>
336
+ // </tr>
337
+ // </thead>
338
+ // <tfoot>
339
+ // <tr>
340
+ // <td>Footer content 1</td>
341
+ // <td>Footer content 2</td>
342
+ // </tr>
343
+ // </tfoot>
344
+ // <tbody>
345
+ // <tr>
346
+ // <td>Body content 1</td>
347
+ // <td>Body content 2</td>
348
+ // </tr>
349
+ // </tbody>
350
+ // </table>
351
+ //
352
+ // Styleguide 4.10
353
+
354
+ /* stylelint-enable selector-no-type */
@@ -0,0 +1,45 @@
1
+ // Expander
2
+ //
3
+ // Needs JS to function. The toggle is an interactive element of some kind (button, link),
4
+ // the body is the content you want to be revealed — it starts at zero height,
5
+ // expands to size of content once active.
6
+ //
7
+ // Use the `.o-button` classes on the `.c-expander-toggle` to set size & appearance.
8
+ //
9
+ // markup:
10
+ // <p>
11
+ // <button class="c-expander-toggle o-button" aria-expanded="false" aria-controls="expander-0" id="expander_button">
12
+ // Toggle content
13
+ // <svg class="o-icon c-expander-toggle__indicator">
14
+ // <use xlink:href="assets/images/icons.svg#icon-arrow-up"></use>
15
+ // </svg>
16
+ // </button>
17
+ // </p>
18
+ // <p>Other content</p>
19
+ // <div class="c-expander-body" id="expander-0" aria-hidden="true">
20
+ // <p>Pudding oat cake brownie. Gummies jelly beans apple pie. Donut sugar plum cotton candy sesame snaps muffin oat cake. Lemon drops carrot cake croissant gingerbread danish. Gingerbread liquorice soufflé croissant dessert sweet roll candy sweet roll. Pastry chocolate bar donut tiramisu marshmallow donut. Brownie chupa chups macaroon cupcake. Marzipan soufflé jelly sweet roll sesame snaps chocolate bar cake cotton candy brownie.</p>
21
+ // <p>Powder sweet roll sesame snaps. Sweet roll fruitcake ice cream cheesecake croissant. Candy cupcake cake brownie muffin oat cake gummi bears bear claw. Chupa chups liquorice jelly cotton candy gummies gummies. Jujubes lemon drops candy gummi bears cake cake fruitcake tart pastry. Cake topping candy canes. Lollipop dragée icing chocolate cake sugar plum. Jujubes halvah tootsie roll chocolate gingerbread sweet roll danish. Biscuit bonbon sweet.</p>
22
+ // </div>
23
+ //
24
+ // Styleguide 6.3
25
+
26
+ .#{$bitstyles-namespace}c-expander-toggle__indicator {
27
+ transform: rotate(180deg);
28
+ transition: transform $bitstyles-transition-duration $bitstyles-transition-easing;
29
+
30
+ .#{$bitstyles-namespace}c-expander-toggle[aria-expanded="true"] & {
31
+ transform: rotate(0deg); /* stylelint-disable-line length-zero-no-unit */
32
+ }
33
+ }
34
+
35
+ .#{$bitstyles-namespace}c-expander-body {
36
+ height: auto;
37
+ max-height: 0;
38
+ overflow: hidden;
39
+ transition: max-height $bitstyles-transition-duration-long $bitstyles-transition-easing;
40
+
41
+ &[aria-hidden="false"] {
42
+ max-height: 999rem;
43
+ max-height: 200vh; // stylelint-disable-line declaration-block-no-duplicate-properties
44
+ }
45
+ }
@@ -0,0 +1,170 @@
1
+ /* @define modal */
2
+ // Modal
3
+ //
4
+ // Needs JS to function. This is a modal overlay which animates in & out.
5
+ //
6
+ // Uses [A11y-dialog.js](https://github.com/edenspiekermann/a11y-dialog) so it’s really accessible —
7
+ // it requires semantic markup, landmark roles and aria attributes in order to function, and keeps
8
+ // those all updated with the component’s current state.
9
+ //
10
+ // Add `data-a11y-dialog-show="dialog_ID"` to a button to make that the trigger to open a modal.
11
+ //
12
+ // Can be closed by clicking the darkened overlay, the close button in the top right (or any button
13
+ // with the `data-a11y-dialog-hide` attribute), or hitting the escape key.
14
+ //
15
+ // Sizing is controlled by the usual layout classes e.g. `.l-content`, except at smaller screensizes
16
+ // where the modal becomes fullwidth.
17
+ //
18
+ // markup:
19
+ // <main aria-label="Content" id="main" class="l-content">
20
+ // <p>Icing powder pie jelly beans soufflé biscuit cupcake fruitcake. Jelly beans bear claw candy canes. Chupa chups gingerbread dessert gingerbread jelly-o icing topping. Marshmallow tiramisu tiramisu cheesecake. Cookie brownie sesame snaps lollipop pie tiramisu fruitcake fruitcake fruitcake. Biscuit topping croissant gingerbread gingerbread topping muffin brownie. Jelly toffee danish fruitcake. Liquorice fruitcake bonbon. Bear claw pudding bonbon jujubes. Danish icing sweet. Biscuit jelly marzipan pie tart. Sugar plum danish gingerbread powder cupcake ice cream sugar plum. Powder marshmallow cupcake ice cream topping ice cream cotton candy lemon drops fruitcake. Chocolate cake wafer jelly beans cupcake lemon drops.</p>
21
+ // <p class="t-text-align--center"><button class="o-link" data-a11y-dialog-show="dialog_1">open dialogue</button></p>
22
+ // <p>Icing powder pie jelly beans soufflé biscuit cupcake fruitcake. Jelly beans bear claw candy canes. Chupa chups gingerbread dessert gingerbread jelly-o icing topping. Marshmallow tiramisu tiramisu cheesecake. Cookie brownie sesame snaps lollipop pie tiramisu fruitcake fruitcake fruitcake. Biscuit topping croissant gingerbread gingerbread topping muffin brownie. Jelly toffee danish fruitcake. Liquorice fruitcake bonbon. Bear claw pudding bonbon jujubes. Danish icing sweet. Biscuit jelly marzipan pie tart. Sugar plum danish gingerbread powder cupcake ice cream sugar plum. Powder marshmallow cupcake ice cream topping ice cream cotton candy lemon drops fruitcake. Chocolate cake wafer jelly beans cupcake lemon drops.</p>
23
+ // </main>
24
+ // <div class="c-modal" id="dialog_1" aria-hidden="true">
25
+ // <div class="c-modal__overlay" tabindex="-1" data-a11y-dialog-hide></div>
26
+ // <div class="l-content c-modal__content" role="dialog" aria-labelledby="dialog-title">
27
+ // <div role="document">
28
+ // <h1 class="o-h1" id="dialog-title" tabindex="0">Dialog Title</h1>
29
+ // <p>Icing powder pie jelly beans soufflé biscuit cupcake fruitcake. Jelly beans bear claw candy canes. Chupa chups gingerbread dessert gingerbread jelly-o icing topping. Marshmallow tiramisu tiramisu cheesecake. Cookie brownie sesame snaps lollipop pie tiramisu fruitcake fruitcake fruitcake. Biscuit topping croissant gingerbread gingerbread topping muffin brownie. Jelly toffee danish fruitcake. Liquorice fruitcake bonbon. Bear claw pudding bonbon jujubes. Danish icing sweet. Biscuit jelly marzipan pie tart. Sugar plum danish gingerbread powder cupcake ice cream sugar plum. Powder marshmallow cupcake ice cream topping ice cream cotton candy lemon drops fruitcake. Chocolate cake wafer jelly beans cupcake lemon drops.</p>
30
+ // <p>Gummies cake topping ice cream dessert. Jelly beans marzipan toffee biscuit cookie lollipop cake pie. Apple pie sweet bonbon candy jujubes. Gummi bears biscuit cheesecake marshmallow chupa chups danish carrot cake. Cookie croissant ice cream bonbon ice cream. Cotton candy halvah bear claw. Pudding apple pie tootsie roll gummi bears halvah icing jelly-o jelly beans. Jujubes lemon drops macaroon wafer tart dragée. Gummies danish lollipop cupcake oat cake. Ice cream candy canes brownie chocolate bar pie macaroon biscuit tootsie roll. Tootsie roll carrot cake fruitcake. Wafer chupa chups jelly beans. Pie cake jujubes caramels wafer.</p>
31
+ // <button class="o-button c-modal__close" type="button" data-a11y-dialog-hide aria-label="Close this dialog window">
32
+ // &times;
33
+ // </button>
34
+ // </div>
35
+ // </div>
36
+ // </div>
37
+ //
38
+ // Styleguide 6.1
39
+
40
+ @import '../settings/modal';
41
+
42
+ @mixin modal-is-hidden {
43
+ opacity: 0;
44
+ visibility: hidden;
45
+ }
46
+
47
+ .#{$bitstyles-namespace}c-modal__overlay {
48
+ position: fixed;
49
+ top: 0;
50
+ right: 0;
51
+ bottom: 0;
52
+ left: 0;
53
+ z-index: 10;
54
+ background: $bitstyles-modal-overlay-color;
55
+ transition: all $bitstyles-modal-transition-duration $bitstyles-modal-transition-easing;
56
+ -webkit-backface-visibility: hidden; // stylelint-disable-line property-no-vendor-prefix
57
+ backface-visibility: hidden;
58
+ will-change: $bitstyles-modal-will-change;
59
+ cursor: pointer;
60
+
61
+ [aria-hidden="true"] & {
62
+ @include modal-is-hidden;
63
+
64
+ transition: all $bitstyles-modal-transition-duration $bitstyles-modal-transition-easing, visibility 0 $bitstyles-modal-transition-easing $bitstyles-modal-transition-duration;
65
+ }
66
+ }
67
+
68
+ .#{$bitstyles-namespace}c-modal__content {
69
+ position: fixed;
70
+ top: 50%;
71
+ left: 50%;
72
+ z-index: 20;
73
+ width: 100%;
74
+ height: 100%;
75
+ max-height: 100vh;
76
+ padding-top: $bitstyles-spacing;
77
+ padding-bottom: $bitstyles-spacing;
78
+ overflow: scroll;
79
+ -webkit-overflow-scrolling: touch;
80
+ background-color: $bitstyles-modal-background-color;
81
+ border-radius: $bitstyles-modal-border-radius;
82
+ transform: translate(-50%, -50%);
83
+ transform-origin: 50% 50%;
84
+ transition: all $bitstyles-modal-transition-duration-smallscreen $bitstyles-modal-transition-easing;
85
+ -webkit-backface-visibility: hidden; // stylelint-disable-line property-no-vendor-prefix
86
+ backface-visibility: hidden;
87
+ will-change: $bitstyles-modal-will-change;
88
+
89
+ [aria-hidden="true"] & {
90
+ @include modal-is-hidden;
91
+
92
+ transform: translate(-50%, 50%);
93
+ transition: all $bitstyles-modal-transition-duration-smallscreen $bitstyles-modal-transition-easing, visibility 0 $bitstyles-modal-transition-easing $bitstyles-modal-transition-duration;
94
+ }
95
+ }
96
+
97
+ @include media-query($bitstyles-modal-breakpoint) {
98
+ .#{$bitstyles-namespace}c-modal__content {
99
+ width: calc(100% - 2 * #{$bitstyles-spacing});
100
+ height: auto;
101
+ transition: all $bitstyles-modal-transition-duration $bitstyles-modal-transition-easing, visibility 0 $bitstyles-modal-transition-easing;
102
+
103
+ [aria-hidden="true"] & {
104
+ transform: translate(-50%, -50%) scale(0.875);
105
+ transition: all $bitstyles-modal-transition-duration $bitstyles-modal-transition-easing, visibility 0 $bitstyles-modal-transition-easing $bitstyles-modal-transition-duration;
106
+ }
107
+ }
108
+ }
109
+
110
+ .#{$bitstyles-namespace}c-modal__close {
111
+ position: absolute;
112
+ top: $bitstyles-spacing;
113
+ right: $bitstyles-spacing;
114
+ }
115
+
116
+ // Modal dialog
117
+ //
118
+ // Needs JS to function. This is a modal dialog overlay which animates in & out.
119
+ //
120
+ // As with the standard modal it uses [A11y-dialog.js](https://github.com/edenspiekermann/a11y-dialog) so it’s really accessible —
121
+ // it requires semantic markup, landmark roles and aria attributes in order to function, and keeps
122
+ // those all updated with the component’s current state.
123
+ //
124
+ // Add `data-a11y-dialog-show="dialog_ID"` to a button to make that the trigger to open a modal.
125
+ //
126
+ // Can be closed by clicking the darkened overlay, hitting the escape key, or by selecting one of the cancel/ok buttons.
127
+ // Different animations can be defined for each of the options.
128
+ //
129
+ // Sizing is controlled by the usual layout classes e.g. `.l-content`, except at smaller screensizes
130
+ // where the modal becomes fullwidth.
131
+ //
132
+ // markup:
133
+ // <main aria-label="Content" id="main" class="l-content">
134
+ // <p>Icing powder pie jelly beans soufflé biscuit cupcake fruitcake. Jelly beans bear claw candy canes. Chupa chups gingerbread dessert gingerbread jelly-o icing topping. Marshmallow tiramisu tiramisu cheesecake. Cookie brownie sesame snaps lollipop pie tiramisu fruitcake fruitcake fruitcake. Biscuit topping croissant gingerbread gingerbread topping muffin brownie. Jelly toffee danish fruitcake. Liquorice fruitcake bonbon. Bear claw pudding bonbon jujubes. Danish icing sweet. Biscuit jelly marzipan pie tart. Sugar plum danish gingerbread powder cupcake ice cream sugar plum. Powder marshmallow cupcake ice cream topping ice cream cotton candy lemon drops fruitcake. Chocolate cake wafer jelly beans cupcake lemon drops.</p>
135
+ // <p class="t-text-align--center"><button class="o-link" data-a11y-dialog-show="dialog_1">open dialogue</button></p>
136
+ // <p>Icing powder pie jelly beans soufflé biscuit cupcake fruitcake. Jelly beans bear claw candy canes. Chupa chups gingerbread dessert gingerbread jelly-o icing topping. Marshmallow tiramisu tiramisu cheesecake. Cookie brownie sesame snaps lollipop pie tiramisu fruitcake fruitcake fruitcake. Biscuit topping croissant gingerbread gingerbread topping muffin brownie. Jelly toffee danish fruitcake. Liquorice fruitcake bonbon. Bear claw pudding bonbon jujubes. Danish icing sweet. Biscuit jelly marzipan pie tart. Sugar plum danish gingerbread powder cupcake ice cream sugar plum. Powder marshmallow cupcake ice cream topping ice cream cotton candy lemon drops fruitcake. Chocolate cake wafer jelly beans cupcake lemon drops.</p>
137
+ // </main>
138
+ // <div class="c-modal" id="dialog_1" aria-hidden="true">
139
+ // <div class="c-modal__overlay" tabindex="-1" data-a11y-dialog-hide></div>
140
+ // <div class="l-content c-modal__content" role="dialog" aria-labelledby="dialog-title">
141
+ // <div role="document">
142
+ // <h1 class="o-h1" id="dialog-title" tabindex="0">Dialog Title</h1>
143
+ // <p>Icing powder pie jelly beans soufflé biscuit cupcake fruitcake. Jelly beans bear claw candy canes. Chupa chups gingerbread dessert gingerbread jelly-o icing topping. Marshmallow tiramisu tiramisu cheesecake. Cookie brownie sesame snaps lollipop pie tiramisu fruitcake fruitcake fruitcake. Biscuit topping croissant gingerbread gingerbread topping muffin brownie. Jelly toffee danish fruitcake. Liquorice fruitcake bonbon. Bear claw pudding bonbon jujubes. Danish icing sweet. Biscuit jelly marzipan pie tart. Sugar plum danish gingerbread powder cupcake ice cream sugar plum. Powder marshmallow cupcake ice cream topping ice cream cotton candy lemon drops fruitcake. Chocolate cake wafer jelly beans cupcake lemon drops.</p>
144
+ // <p>Gummies cake topping ice cream dessert. Jelly beans marzipan toffee biscuit cookie lollipop cake pie. Apple pie sweet bonbon candy jujubes. Gummi bears biscuit cheesecake marshmallow chupa chups danish carrot cake. Cookie croissant ice cream bonbon ice cream. Cotton candy halvah bear claw. Pudding apple pie tootsie roll gummi bears halvah icing jelly-o jelly beans. Jujubes lemon drops macaroon wafer tart dragée. Gummies danish lollipop cupcake oat cake. Ice cream candy canes brownie chocolate bar pie macaroon biscuit tootsie roll. Tootsie roll carrot cake fruitcake. Wafer chupa chups jelly beans. Pie cake jujubes caramels wafer.</p>
145
+ // <button class="o-button" type="button" id="#cancel_button">Cancel</button>
146
+ // <button class="o-button" type="button" id="#ok_button">Ok</button>
147
+ // </div>
148
+ // </div>
149
+ // </div>
150
+ //
151
+ // Styleguide 6.2
152
+
153
+ @mixin modal-variation($state) {
154
+ .#{$bitstyles-namespace}c-modal--animation-#{$state} {
155
+ &[aria-hidden="true"] {
156
+ .#{$bitstyles-namespace}c-modal__content {
157
+ @content;
158
+ }
159
+ }
160
+ }
161
+ }
162
+
163
+ @include modal-variation(cancel) {
164
+ transform: translate(-50%, 50%);
165
+ }
166
+
167
+ @include modal-variation(ok) {
168
+ opacity: 1;
169
+ transform: translate(-50%, -200%);
170
+ }
@@ -0,0 +1,16 @@
1
+ // Can be used to apply the border-box box model to all elements instead of the default content-box,
2
+ // while still allowing components to change.
3
+ //
4
+ // No styleguide reference.
5
+
6
+ /* stylelint-disable selector-no-type */
7
+ html {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ *,
12
+ *::before,
13
+ *::after {
14
+ box-sizing: inherit;
15
+ }
16
+ /* stylelint-enable selector-no-type */