fortitude-sass 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/.npmignore +9 -0
  4. data/.scss-lint.yml +13 -0
  5. data/Gemfile +4 -0
  6. data/Gemfile.lock +48 -0
  7. data/README.md +19 -0
  8. data/app/assets/javascripts/fortitude/jquery/blocks/flashbar.js +13 -0
  9. data/app/assets/javascripts/fortitude/jquery/blocks/select-input.js +26 -0
  10. data/app/assets/javascripts/fortitude/jquery/blocks/shade.js +48 -0
  11. data/app/assets/javascripts/fortitude/jquery/generic/transition-end.js +50 -0
  12. data/app/assets/javascripts/fortitude/jquery/generic/viewport.js +7 -0
  13. data/app/assets/javascripts/fortitude/jquery/index.js +3 -0
  14. data/app/assets/javascripts/fortitude.jquery.js +45 -0
  15. data/app/assets/stylesheets/fortitude/base/_hr.scss +10 -0
  16. data/app/assets/stylesheets/fortitude/base/_images.scss +32 -0
  17. data/app/assets/stylesheets/fortitude/base/_lists.scss +15 -0
  18. data/app/assets/stylesheets/fortitude/base/_page.scss +28 -0
  19. data/app/assets/stylesheets/fortitude/blocks/_badge.scss +141 -0
  20. data/app/assets/stylesheets/fortitude/blocks/_bare-list.scss +17 -0
  21. data/app/assets/stylesheets/fortitude/blocks/_block-list.scss +83 -0
  22. data/app/assets/stylesheets/fortitude/blocks/_box.scss +23 -0
  23. data/app/assets/stylesheets/fortitude/blocks/_button.scss +229 -0
  24. data/app/assets/stylesheets/fortitude/blocks/_container.scss +67 -0
  25. data/app/assets/stylesheets/fortitude/blocks/_flag.scss +426 -0
  26. data/app/assets/stylesheets/fortitude/blocks/_flashbar.scss +22 -0
  27. data/app/assets/stylesheets/fortitude/blocks/_fluid-container.scss +12 -0
  28. data/app/assets/stylesheets/fortitude/blocks/_inline-list.scss +19 -0
  29. data/app/assets/stylesheets/fortitude/blocks/_input.scss +377 -0
  30. data/app/assets/stylesheets/fortitude/blocks/_layout.scss +288 -0
  31. data/app/assets/stylesheets/fortitude/blocks/_list-navigation.scss +34 -0
  32. data/app/assets/stylesheets/fortitude/blocks/_media.scss +289 -0
  33. data/app/assets/stylesheets/fortitude/blocks/_shade.scss +51 -0
  34. data/app/assets/stylesheets/fortitude/blocks/_table.scss +31 -0
  35. data/app/assets/stylesheets/fortitude/blocks/_tabs-navigation.scss +58 -0
  36. data/app/assets/stylesheets/fortitude/blocks/_tabs.scss +19 -0
  37. data/app/assets/stylesheets/fortitude/blocks/_text.scss +67 -0
  38. data/app/assets/stylesheets/fortitude/blocks/_ui-list.scss +97 -0
  39. data/app/assets/stylesheets/fortitude/generic/_box-sizing.scss +23 -0
  40. data/app/assets/stylesheets/fortitude/generic/_clearfix.scss +3 -0
  41. data/app/assets/stylesheets/fortitude/generic/_normalize.scss +200 -0
  42. data/app/assets/stylesheets/fortitude/generic/_reset.scss +53 -0
  43. data/app/assets/stylesheets/fortitude/settings/_defaults.scss +58 -0
  44. data/app/assets/stylesheets/fortitude/tools/_functions.scss +115 -0
  45. data/app/assets/stylesheets/fortitude/tools/_mixins.scss +58 -0
  46. data/app/assets/stylesheets/fortitude/trumps/_responsive-border.scss +35 -0
  47. data/app/assets/stylesheets/fortitude/trumps/_responsive-column.scss +37 -0
  48. data/app/assets/stylesheets/fortitude/trumps/_responsive-display.scss +35 -0
  49. data/app/assets/stylesheets/fortitude/trumps/_responsive-float.scss +13 -0
  50. data/app/assets/stylesheets/fortitude/trumps/_responsive-font.scss +13 -0
  51. data/app/assets/stylesheets/fortitude/trumps/_responsive-height.scss +13 -0
  52. data/app/assets/stylesheets/fortitude/trumps/_responsive-line-height.scss +13 -0
  53. data/app/assets/stylesheets/fortitude/trumps/_responsive-margin.scss +129 -0
  54. data/app/assets/stylesheets/fortitude/trumps/_responsive-padding.scss +65 -0
  55. data/app/assets/stylesheets/fortitude/trumps/_responsive-text.scss +17 -0
  56. data/app/assets/stylesheets/fortitude.scss +40 -0
  57. data/bin/fortitude +6 -0
  58. data/bower.json +43 -0
  59. data/config.rb +36 -0
  60. data/dist/fortitude.css +5242 -0
  61. data/dist/fortitude.css.map +7 -0
  62. data/dist/fortitude.jquery.js +45 -0
  63. data/fortitude-black.png +0 -0
  64. data/fortitude.gemspec +32 -0
  65. data/fortitude.png +0 -0
  66. data/lib/fortitude-sass/engine.rb +5 -0
  67. data/lib/fortitude-sass/generator.rb +80 -0
  68. data/lib/fortitude-sass/version.rb +3 -0
  69. data/lib/fortitude-sass.rb +27 -0
  70. data/lib/tasks/install.rake +20 -0
  71. data/package.json +24 -0
  72. metadata +187 -0
@@ -0,0 +1,22 @@
1
+ /*------------------------------------*\
2
+ #FLASHBAR
3
+ \*------------------------------------*/
4
+
5
+
6
+ @mixin fortitude-flashbar {
7
+ @include fortitude-clearfix;
8
+ position: relative;
9
+ }
10
+
11
+ @mixin fortitude-flashbar__close {
12
+ position: absolute;
13
+ right: halve($fortitude-base-spacing-unit);
14
+ }
15
+
16
+ .#{$fortitude-namespace}flashbar {
17
+ @include fortitude-flashbar;
18
+ }
19
+
20
+ .#{$fortitude-namespace}flashbar__close {
21
+ @include fortitude-flashbar__close;
22
+ }
@@ -0,0 +1,12 @@
1
+ /*------------------------------------*\
2
+ #FLUID-CONTAINER
3
+ \*------------------------------------*/
4
+
5
+ @mixin fortitude-fluid-container {
6
+ @include fortitude-clearfix;
7
+ width: 100%;
8
+ }
9
+
10
+ .#{$fortitude-namespace}fluid-container {
11
+ @include fortitude-fluid-container;
12
+ }
@@ -0,0 +1,19 @@
1
+ /*------------------------------------*\
2
+ #INLINE-LIST
3
+ \*------------------------------------*/
4
+
5
+ @mixin fortitude-inline-list {
6
+ display: inline;
7
+ }
8
+
9
+ @mixin fortitude-inline-list__item {
10
+ display: inline;
11
+ }
12
+
13
+ .#{$fortitude-namespace}inline-list {
14
+ @include fortitude-inline-list;
15
+ }
16
+
17
+ .#{$fortitude-namespace}inline-list__item {
18
+ @include fortitude-inline-list__item;
19
+ }
@@ -0,0 +1,377 @@
1
+ /*------------------------------------*\
2
+ #INPUT
3
+ \*------------------------------------*/
4
+
5
+ $fortitude-field-input-placeholder-color: #a9a9a9 !default;
6
+ $fortitude-field-input-height: double($fortitude-base-spacing-unit) !default;
7
+ $fortitude-field-input-background-color: white !default;
8
+ $fortitude-field-input-border-width: 0.1rem !default;
9
+ $fortitude-field-input-border-style: solid !default;
10
+ $fortitude-field-input-border-color: #a9a9a9 !default;
11
+ $fortitude-field-input-border-radius: 0.2rem !default;
12
+
13
+ $fortitude-text-input-placeholder-color: $fortitude-field-input-placeholder-color !default;
14
+ $fortitude-text-input-height: $fortitude-field-input-height !default;
15
+ $fortitude-text-input-background-color: $fortitude-field-input-background-color !default;
16
+ $fortitude-text-input-border-width: $fortitude-field-input-border-width !default;
17
+ $fortitude-text-input-border-style: $fortitude-field-input-border-style !default;
18
+ $fortitude-text-input-border-color: $fortitude-field-input-border-color !default;
19
+ $fortitude-text-input-border-radius: $fortitude-field-input-border-radius !default;
20
+
21
+ $fortitude-textarea-input-placeholder-color: $fortitude-field-input-placeholder-color !default;
22
+ $fortitude-textarea-input-height: $fortitude-field-input-height !default;
23
+ $fortitude-textarea-input-background-color: $fortitude-field-input-background-color !default;
24
+ $fortitude-textarea-input-border-width: $fortitude-field-input-border-width !default;
25
+ $fortitude-textarea-input-border-style: $fortitude-field-input-border-style !default;
26
+ $fortitude-textarea-input-border-color: $fortitude-field-input-border-color !default;
27
+ $fortitude-textarea-input-border-radius: $fortitude-field-input-border-radius !default;
28
+
29
+ $fortitude-select-input-placeholder-color: $fortitude-field-input-placeholder-color !default;
30
+ $fortitude-select-input-height: $fortitude-field-input-height !default;
31
+ $fortitude-select-input-background-color: $fortitude-field-input-background-color !default;
32
+ $fortitude-select-input-border-width: $fortitude-field-input-border-width !default;
33
+ $fortitude-select-input-border-style: $fortitude-field-input-border-style !default;
34
+ $fortitude-select-input-border-color: $fortitude-field-input-border-color !default;
35
+ $fortitude-select-input-border-radius: $fortitude-field-input-border-radius !default;
36
+
37
+ $fortitude-color-input-placeholder-color: $fortitude-field-input-placeholder-color !default;
38
+ $fortitude-color-input-height: $fortitude-field-input-height !default;
39
+ $fortitude-color-input-background-color: $fortitude-field-input-background-color !default;
40
+ $fortitude-color-input-border-width: $fortitude-field-input-border-width !default;
41
+ $fortitude-color-input-border-style: $fortitude-field-input-border-style !default;
42
+ $fortitude-color-input-border-color: $fortitude-field-input-border-color !default;
43
+ $fortitude-color-input-border-radius: $fortitude-field-input-border-radius !default;
44
+
45
+ $fortitude-range-input-height: $fortitude-field-input-height !default;
46
+ $fortitude-range-input-background-color: false !default;
47
+ $fortitude-range-input-border-width: 0 !default;
48
+ $fortitude-range-input-border-style: $fortitude-field-input-border-style !default;
49
+ $fortitude-range-input-border-color: $fortitude-field-input-border-color !default;
50
+ $fortitude-range-input-border-radius: $fortitude-field-input-border-radius !default;
51
+
52
+ $fortitude-switch-input-size: $fortitude-base-spacing-unit - 0.4rem !default;
53
+ $fortitude-switch-input-background-color: false !default;
54
+ $fortitude-switch-input-border-width: 0.1rem !default;
55
+ $fortitude-switch-input-border-style: solid !default;
56
+ $fortitude-switch-input-border-color: #a9a9a9 !default;
57
+ $fortitude-switch-input-border-radius: 0.2rem !default;
58
+
59
+ $fortitude-checkbox-input-size: $fortitude-switch-input-size !default;
60
+ $fortitude-checkbox-input-background-color: $fortitude-switch-input-background-color !default;
61
+ $fortitude-checkbox-input-border-width: $fortitude-switch-input-border-width !default;
62
+ $fortitude-checkbox-input-border-style: $fortitude-switch-input-border-style !default;
63
+ $fortitude-checkbox-input-border-color: $fortitude-switch-input-border-color !default;
64
+ $fortitude-checkbox-input-border-radius: $fortitude-switch-input-border-radius !default;
65
+
66
+ $fortitude-radio-input-size: $fortitude-switch-input-size !default;
67
+ $fortitude-radio-input-background-color: $fortitude-switch-input-background-color !default;
68
+ $fortitude-radio-input-border-width: $fortitude-switch-input-border-width !default;
69
+ $fortitude-radio-input-border-style: $fortitude-switch-input-border-style !default;
70
+ $fortitude-radio-input-border-color: $fortitude-switch-input-border-color !default;
71
+ $fortitude-radio-input-border-radius: 10rem !default;
72
+
73
+ $fortitude-enable-input--full: false !default;
74
+ $fortitude-enable-input--pill: false !default;
75
+
76
+
77
+
78
+
79
+ // Here we set a variable assuming that `box-sizing: border-box;` is not set
80
+ // globally. If it has been previously been defined, the following variable will
81
+ // be overriden and will be set to `true`.
82
+ $fortitude-global-border-box: false !default;
83
+
84
+
85
+ @mixin fortitude-input {
86
+ /**
87
+ * 1. Allow us to style box model properties.
88
+ * 2. Line different sized inputs up a little nicer.
89
+ * 3. Make inputs inherit use their initial styles (fixes zooming on iOS).
90
+ * 4. Fixes odd inner spacing in IE7.
91
+ */
92
+ @include fortitude-font-size($fortitude-base-font-size); /* [3] */
93
+ display: inline-block; /* [1] */
94
+ vertical-align: middle; /* [2] */
95
+ font: inherit;
96
+ overflow: visible; /* [4] */
97
+ max-width: 100%;
98
+
99
+ @if $fortitude-global-border-box == false {
100
+ box-sizing: border-box; /* [10] */
101
+ }
102
+ }
103
+
104
+ @mixin fortitude-text-input {
105
+ @include fortitude-input;
106
+
107
+ /**
108
+ * 5. Reset/normalize some styles.
109
+ * 6. Subtract the border size from the padding value so that inputs do not
110
+ * grow larger as we add borders.
111
+ */
112
+
113
+ height: $fortitude-text-input-height;
114
+ margin: fortitude-block-margin($fortitude-text-input-height, $fortitude-text-input-border-width, $fortitude-base-line-height) 0; /* [5] */
115
+ padding: fortitude-block-padding($fortitude-text-input-height, $fortitude-text-input-border-width, $fortitude-base-line-height); /* [6] */
116
+
117
+ @if ($fortitude-text-input-border-width != 0) {
118
+ border: $fortitude-text-input-border-width $fortitude-text-input-border-style $fortitude-text-input-border-color;
119
+ } @else {
120
+ border: 0; /* [5] */
121
+ }
122
+
123
+ @if ($fortitude-text-input-border-radius != 0) {
124
+ border-radius: $fortitude-text-input-border-radius;
125
+ } @else {
126
+ border-radius: 0; /* [5] */
127
+ }
128
+
129
+ @if ($fortitude-text-input-background-color) {
130
+ background-color: $fortitude-text-input-background-color;
131
+ }
132
+
133
+ &::placeholder {
134
+ color: $fortitude-text-input-placeholder-color;
135
+ }
136
+ }
137
+
138
+ @mixin fortitude-textarea-input {
139
+ @include fortitude-input;
140
+
141
+ /**
142
+ * 5. Reset/normalize some styles.
143
+ * 6. Subtract the border size from the padding value so that inputs do not
144
+ * grow larger as we add borders.
145
+ */
146
+
147
+ min-height: $fortitude-textarea-input-height;
148
+ margin: fortitude-block-margin($fortitude-textarea-input-height, $fortitude-textarea-input-border-width, $fortitude-base-line-height) 0; /* [5] */
149
+ padding: fortitude-block-padding($fortitude-textarea-input-height, $fortitude-textarea-input-border-width, $fortitude-base-line-height); /* [6] */
150
+
151
+ @if($fortitude-textarea-input-border-width != 0) {
152
+ border: $fortitude-textarea-input-border-width $fortitude-textarea-input-border-style $fortitude-textarea-input-border-color;
153
+ } @else {
154
+ border: 0; /* [5] */
155
+ }
156
+
157
+ @if ($fortitude-textarea-input-border-radius != 0) {
158
+ border-radius: $fortitude-textarea-input-border-radius;
159
+ } @else {
160
+ border-radius: 0; /* [5] */
161
+ }
162
+
163
+ @if ($fortitude-textarea-input-background-color) {
164
+ background-color: $fortitude-textarea-input-background-color;
165
+ }
166
+
167
+ &::placeholder {
168
+ color: $fortitude-textarea-input-placeholder-color;
169
+ }
170
+ }
171
+
172
+ @mixin fortitude-select-input {
173
+ @include fortitude-input;
174
+
175
+ /**
176
+ * 5. Reset/normalize some styles.
177
+ * 6. Subtract the border size from the padding value so that inputs do not
178
+ * grow larger as we add borders.
179
+ */
180
+
181
+ height: $fortitude-select-input-height;
182
+ margin: fortitude-block-margin($fortitude-select-input-height, $fortitude-select-input-border-width, $fortitude-base-line-height) 0; /* [5] */
183
+ padding: fortitude-block-padding($fortitude-select-input-height, $fortitude-select-input-border-width, $fortitude-base-line-height); /* [6] */
184
+
185
+ @if($fortitude-select-input-border-width != 0) {
186
+ border: $fortitude-select-input-border-width $fortitude-select-input-border-style $fortitude-select-input-border-color;
187
+ } @else {
188
+ border: 0; /* [5] */
189
+ }
190
+
191
+ @if ($fortitude-select-input-border-radius != 0) {
192
+ border-radius: $fortitude-select-input-border-radius;
193
+ } @else {
194
+ border-radius: 0; /* [5] */
195
+ }
196
+
197
+ @if ($fortitude-select-input-background-color) {
198
+ background-color: $fortitude-select-input-background-color;
199
+ }
200
+
201
+ &.placeholder {
202
+ color: $fortitude-select-input-placeholder-color;
203
+ }
204
+
205
+ &[multiple] {
206
+ height: auto;
207
+ }
208
+ }
209
+
210
+ @mixin fortitude-checkbox-input {
211
+ @include fortitude-input;
212
+
213
+ /**
214
+ * 5. Reset/normalize some styles.
215
+ * 6. Subtract the border size from the padding value so that inputs do not
216
+ * grow larger as we add borders.
217
+ */
218
+
219
+ width: $fortitude-checkbox-input-size;
220
+ height: $fortitude-checkbox-input-size;
221
+ margin: fortitude-block-margin($fortitude-checkbox-input-size + 0.2rem, $fortitude-checkbox-input-border-width, $fortitude-base-line-height) 0; /* [5] */
222
+ padding: fortitude-block-padding($fortitude-checkbox-input-size, $fortitude-checkbox-input-border-width, $fortitude-base-line-height); /* [6] */
223
+
224
+ @if ($fortitude-checkbox-input-border-width != 0) {
225
+ border: $fortitude-checkbox-input-border-width $fortitude-checkbox-input-border-style $fortitude-checkbox-input-border-color;
226
+ } @else {
227
+ border: 0; /* [5] */
228
+ }
229
+
230
+ @if ($fortitude-checkbox-input-border-radius != 0) {
231
+ border-radius: $fortitude-checkbox-input-border-radius;
232
+ } @else {
233
+ border-radius: 0; /* [5] */
234
+ }
235
+
236
+ @if ($fortitude-checkbox-input-background-color) {
237
+ background-color: $fortitude-checkbox-input-background-color;
238
+ }
239
+ }
240
+
241
+ @mixin fortitude-radio-input {
242
+ @include fortitude-input;
243
+
244
+ /**
245
+ * 5. Reset/normalize some styles.
246
+ * 6. Subtract the border size from the padding value so that inputs do not
247
+ * grow larger as we add borders.
248
+ */
249
+
250
+ width: $fortitude-radio-input-size;
251
+ height: $fortitude-radio-input-size;
252
+ margin: fortitude-block-margin($fortitude-radio-input-size + 0.4rem, $fortitude-radio-input-border-width, $fortitude-base-line-height) 0; /* [5] */
253
+ padding: fortitude-block-padding($fortitude-radio-input-size, $fortitude-radio-input-border-width, $fortitude-base-line-height); /* [6] */
254
+
255
+ @if ($fortitude-radio-input-border-width != 0) {
256
+ border: $fortitude-radio-input-border-width $fortitude-radio-input-border-style $fortitude-radio-input-border-color;
257
+ } @else {
258
+ border: 0; /* [5] */
259
+ }
260
+
261
+ @if ($fortitude-radio-input-border-radius != 0) {
262
+ border-radius: $fortitude-radio-input-border-radius;
263
+ } @else {
264
+ border-radius: 0; /* [5] */
265
+ }
266
+
267
+ @if ($fortitude-radio-input-background-color) {
268
+ background-color: $fortitude-radio-input-background-color;
269
+ }
270
+ }
271
+
272
+ @mixin fortitude-range-input {
273
+ @include fortitude-input;
274
+
275
+ /**
276
+ * 5. Reset/normalize some styles.
277
+ * 6. Subtract the border size from the padding value so that inputs do not
278
+ * grow larger as we add borders.
279
+ */
280
+
281
+ height: $fortitude-range-input-height;
282
+ margin: fortitude-block-margin($fortitude-range-input-height, $fortitude-range-input-border-width, $fortitude-base-line-height) 0; /* [5] */
283
+ padding: fortitude-block-padding($fortitude-range-input-height, $fortitude-range-input-border-width, $fortitude-base-line-height) 0; /* [6] */
284
+
285
+ @if ($fortitude-range-input-border-width != 0) {
286
+ border: $fortitude-range-input-border-width $fortitude-range-input-border-style $fortitude-range-input-border-color;
287
+ } @else {
288
+ border: 0; /* [5] */
289
+ }
290
+
291
+ @if ($fortitude-range-input-border-radius != 0) {
292
+ border-radius: $fortitude-range-input-border-radius;
293
+ } @else {
294
+ border-radius: 0; /* [5] */
295
+ }
296
+
297
+ @if ($fortitude-range-input-background-color) {
298
+ background-color: $fortitude-range-input-background-color;
299
+ }
300
+ }
301
+
302
+ @mixin fortitude-color-input {
303
+ @include fortitude-input;
304
+
305
+ /**
306
+ * 5. Reset/normalize some styles.
307
+ * 6. Subtract the border size from the padding value so that inputs do not
308
+ * grow larger as we add borders.
309
+ */
310
+
311
+ height: $fortitude-color-input-height;
312
+ margin: fortitude-block-margin($fortitude-color-input-height, $fortitude-color-input-border-width, $fortitude-base-line-height) 0; /* [5] */
313
+ padding: fortitude-block-padding($fortitude-color-input-height, $fortitude-color-input-border-width, $fortitude-base-line-height); /* [6] */
314
+
315
+ @if ($fortitude-color-input-border-width != 0) {
316
+ border: $fortitude-color-input-border-width $fortitude-color-input-border-style $fortitude-color-input-border-color;
317
+ } @else {
318
+ border: 0; /* [5] */
319
+ }
320
+
321
+ @if ($fortitude-color-input-border-radius != 0) {
322
+ border-radius: $fortitude-color-input-border-radius;
323
+ } @else {
324
+ border-radius: 0; /* [5] */
325
+ }
326
+
327
+ @if ($fortitude-color-input-background-color) {
328
+ background-color: $fortitude-color-input-background-color;
329
+ }
330
+
331
+ &::placeholder {
332
+ color: $fortitude-color-input-placeholder-color;
333
+ }
334
+ }
335
+
336
+ @mixin fortitude-input--full { width: 100%; }
337
+
338
+ @mixin fortitude-input--pill { border-radius: 10rem; }
339
+
340
+ .#{$fortitude-namespace}checkbox-input {
341
+ @include fortitude-checkbox-input;
342
+ }
343
+
344
+ .#{$fortitude-namespace}radio-input {
345
+ @include fortitude-radio-input;
346
+ }
347
+
348
+ .#{$fortitude-namespace}text-input {
349
+ @include fortitude-text-input;
350
+ }
351
+
352
+ .#{$fortitude-namespace}textarea-input {
353
+ @include fortitude-textarea-input;
354
+ }
355
+
356
+ .#{$fortitude-namespace}select-input {
357
+ @include fortitude-select-input;
358
+ }
359
+
360
+ .#{$fortitude-namespace}range-input {
361
+ @include fortitude-range-input;
362
+ }
363
+
364
+ .#{$fortitude-namespace}color-input {
365
+ @include fortitude-color-input;
366
+ }
367
+
368
+
369
+ .#{$fortitude-namespace}input {
370
+ &--full {
371
+ @include fortitude-input--full;
372
+ }
373
+
374
+ &--pill {
375
+ @include fortitude-input--pill;
376
+ }
377
+ }
@@ -0,0 +1,288 @@
1
+ /*------------------------------------*\
2
+ #LAYOUT
3
+ \*------------------------------------*/
4
+
5
+ /**
6
+ * The Fortitude layout system uses `box-sizing: border-box;` and
7
+ * `display: inline-block;` to create an extremely powerful, flexible
8
+ * alternative to the traditional grid system. Combine the layout items with
9
+ * the widths found in `trumps.widths`.
10
+ */
11
+
12
+ // Predefine the variables below in order to alter and enable specific features.
13
+ $fortitude-layout-gutter: $fortitude-base-spacing-unit !default;
14
+ $fortitude-layout-gutter--small: halve($fortitude-layout-gutter) !default;
15
+ $fortitude-layout-gutter--large: double($fortitude-layout-gutter) !default;
16
+
17
+ $fortitude-enable-layout--small: false !default;
18
+ $fortitude-enable-layout--large: false !default;
19
+ $fortitude-enable-layout--flush: false !default;
20
+ $fortitude-enable-layout--rev: false !default;
21
+ $fortitude-enable-layout--middle: false !default;
22
+ $fortitude-enable-layout--bottom: false !default;
23
+ $fortitude-enable-layout--right: false !default;
24
+ $fortitude-enable-layout--center: false !default;
25
+
26
+
27
+
28
+
29
+
30
+ // Here we set a variable assuming that `box-sizing: border-box;` is not set
31
+ // globally. If it has been previously been defined, the following variable will
32
+ // be overriden and will be set to `true`.
33
+ $fortitude-global-border-box: false !default;
34
+
35
+
36
+
37
+
38
+
39
+ @mixin fortitude-layout($extension: null) {
40
+ list-style: none;
41
+ display: block;
42
+ margin: 0;
43
+ padding: 0;
44
+ margin-left: -$fortitude-layout-gutter;
45
+ }
46
+
47
+ @mixin fortitude-layout__item($extension: null) {
48
+ /**
49
+ * 1. Cause columns to stack side-by-side.
50
+ * 2. Space columns apart.
51
+ * 3. Align columns to the tops of each other.
52
+ * 4. Full-width unless told to behave otherwise.
53
+ * 5. Required to combine fluid widths and fixed gutters.
54
+ */
55
+ display: inline-block; /* [1] */
56
+ padding-left: $fortitude-layout-gutter; /* [2] */
57
+ vertical-align: top; /* [3] */
58
+ width: 100%; /* [4] */
59
+ position: relative;
60
+
61
+ @if $fortitude-global-border-box == false {
62
+ box-sizing: border-box; /* [5] */
63
+ }
64
+ }
65
+
66
+ @mixin fortitude-layout--small {
67
+ margin-left: -($fortitude-layout-gutter--small);
68
+ }
69
+
70
+ @mixin fortitude-layout--small__item {
71
+ padding-left: $fortitude-layout-gutter--small;
72
+ }
73
+
74
+ @mixin fortitude-layout--large {
75
+ margin-left: -($fortitude-layout-gutter--large);
76
+ }
77
+
78
+ @mixin fortitude-layout--large__item {
79
+ padding-left: $fortitude-layout-gutter--large;
80
+ }
81
+
82
+ @mixin fortitude-layout--flush {
83
+ margin-left: 0;
84
+ }
85
+
86
+ @mixin fortitude-layout--flush__item {
87
+ padding-left: 0;
88
+ }
89
+
90
+ @mixin fortitude-layout--rev {
91
+ direction: rtl;
92
+ text-align: left;
93
+ }
94
+
95
+ @mixin fortitude-layout--rev__item {
96
+ direction: ltr;
97
+ text-align: left;
98
+ }
99
+
100
+ @mixin fortitude-layout--middle__item {
101
+ vertical-align: middle;
102
+ }
103
+
104
+ @mixin fortitude-layout--bottom__item {
105
+ vertical-align: bottom;
106
+ }
107
+
108
+ @mixin fortitude-layout--right {
109
+ text-align: right;
110
+ }
111
+
112
+ @mixin fortitude-layout--right__item {
113
+ text-align: left;
114
+ }
115
+
116
+ @mixin fortitude-layout--center {
117
+ text-align: center;
118
+ }
119
+
120
+ @mixin fortitude-layout--center__item {
121
+ text-align: left;
122
+ }
123
+
124
+ /**
125
+ * Begin a layout group.
126
+ */
127
+
128
+ .#{$fortitude-namespace}layout {
129
+ @include fortitude-layout;
130
+ }
131
+
132
+ .#{$fortitude-namespace}layout__item {
133
+ @include fortitude-layout__item;
134
+ }
135
+
136
+
137
+
138
+
139
+
140
+ @if ($fortitude-enable-layout--small == true) {
141
+
142
+ /**
143
+ * Layouts with small gutters.
144
+ */
145
+
146
+ .#{$fortitude-namespace}layout--small {
147
+ @include fortitude-layout--small;
148
+ > .#{$fortitude-namespace}layout__item {
149
+ @include fortitude-layout--small__item;
150
+ }
151
+
152
+ }
153
+
154
+ }
155
+
156
+ @if ($fortitude-enable-layout--large == true) {
157
+
158
+ /**
159
+ * Layouts with large gutters.
160
+ */
161
+
162
+ .#{$fortitude-namespace}layout--large {
163
+ @include fortitude-layout--large;
164
+
165
+ > .#{$fortitude-namespace}layout__item {
166
+ @include fortitude-layout--large__item;
167
+ }
168
+
169
+ }
170
+
171
+ }
172
+
173
+
174
+
175
+
176
+
177
+ @if ($fortitude-enable-layout--flush == true) {
178
+
179
+ /**
180
+ * Layouts with no gutters.
181
+ */
182
+
183
+ .#{$fortitude-namespace}layout--flush {
184
+ @include fortitude-layout--flush;
185
+
186
+ > .#{$fortitude-namespace}layout__item {
187
+ @include fortitude-layout--flush__item;
188
+ }
189
+
190
+ }
191
+
192
+ }
193
+
194
+
195
+
196
+
197
+
198
+ @if ($fortitude-enable-layout--rev == true) {
199
+
200
+ /**
201
+ * Reversed rendered order of layout items, e.g. items 1, 2, 3, 4 in your
202
+ * markup will display in order 4, 3, 2, 1 on your page.
203
+ */
204
+
205
+ .#{$fortitude-namespace}layout--rev {
206
+ @include fortitude-layout--rev;
207
+
208
+ > .#{$fortitude-namespace}layout__item {
209
+ @include fortitude-layout--rev__item;
210
+ }
211
+
212
+ }
213
+
214
+ }
215
+
216
+
217
+
218
+
219
+
220
+ @if ($fortitude-enable-layout--middle == true) {
221
+
222
+ /**
223
+ * Align layout items to the vertical centers of each other.
224
+ */
225
+
226
+ .#{$fortitude-namespace}layout--middle {
227
+
228
+ > .#{$fortitude-namespace}layout__item {
229
+ @include fortitude-layout--middle__item;
230
+ }
231
+
232
+ }
233
+
234
+ }
235
+
236
+ @if ($fortitude-enable-layout--bottom == true) {
237
+
238
+ /**
239
+ * Align layout items to the vertical bottoms of each other.
240
+ */
241
+
242
+ .#{$fortitude-namespace}layout--bottom {
243
+
244
+ > .#{$fortitude-namespace}layout__item {
245
+ @include fortitude-layout--bottom__item;
246
+ }
247
+
248
+ }
249
+
250
+ }
251
+
252
+
253
+
254
+
255
+
256
+ @if ($fortitude-enable-layout--right == true) {
257
+
258
+ /**
259
+ * Make the layout items fill up from the right hand side.
260
+ */
261
+
262
+ .#{$fortitude-namespace}layout--right {
263
+ @include fortitude-layout--right;
264
+
265
+ > .#{$fortitude-namespace}layout__item {
266
+ @include fortitude-layout--right__item;
267
+ }
268
+
269
+ }
270
+
271
+ }
272
+
273
+ @if ($fortitude-enable-layout--center == true) {
274
+
275
+ /**
276
+ * Make the layout items fill up from the center outward.
277
+ */
278
+
279
+ .#{$fortitude-namespace}layout--center {
280
+ @include fortitude-layout--center;
281
+
282
+ > .#{$fortitude-namespace}layout__item {
283
+ @include fortitude-layout--center__item;
284
+ }
285
+
286
+ }
287
+
288
+ }