piecss 0.2.0.0 → 0.3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/lib/piecss.rb +16 -5
  3. data/sass/piecss/_settings.scss +6 -3
  4. data/sass/piecss/_utilities.scss +3 -0
  5. data/sass/piecss/behavior/_anchor.scss +1 -1
  6. data/sass/piecss/settings/_base.scss +5 -25
  7. data/sass/piecss/settings/_breakpoint.scss +112 -18
  8. data/sass/piecss/settings/_button.scss +2 -2
  9. data/sass/piecss/settings/_colour.scss +152 -0
  10. data/sass/piecss/settings/_constants.scss +0 -143
  11. data/sass/piecss/settings/_font.scss +0 -21
  12. data/sass/piecss/settings/_form.scss +7 -9
  13. data/sass/piecss/settings/{_grid.scss → _layout.scss} +43 -44
  14. data/sass/piecss/settings/_list.scss +1 -1
  15. data/sass/piecss/settings/_miscellaneous.scss +5 -0
  16. data/sass/piecss/settings/_rhythm.scss +0 -0
  17. data/sass/piecss/settings/_typography.scss +13 -0
  18. data/sass/piecss/settings/fonts/_example.scss +36 -36
  19. data/sass/piecss/settings/fonts/_monospace.scss +33 -33
  20. data/sass/piecss/settings/fonts/_sans-serif.scss +33 -33
  21. data/sass/piecss/settings/fonts/_serif.scss +33 -33
  22. data/sass/piecss/settings/fonts/_verdana.scss +34 -34
  23. data/sass/piecss/utilities/_breakpoint.scss +5 -5
  24. data/sass/piecss/utilities/_cache.scss +8 -4
  25. data/sass/piecss/utilities/_colour.scss +37 -0
  26. data/sass/piecss/utilities/_element.scss +85 -88
  27. data/sass/piecss/utilities/_image.scss +20 -22
  28. data/sass/piecss/utilities/_layout.scss +382 -213
  29. data/sass/piecss/utilities/_list.scss +2 -0
  30. data/sass/piecss/utilities/_miscellaneous.scss +161 -99
  31. data/sass/piecss/utilities/_rhythm.scss +27 -59
  32. data/sass/piecss/utilities/_side.scss +155 -154
  33. data/sass/piecss/utilities/_string.scss +68 -0
  34. data/sass/piecss/utilities/_svg.scss +47 -0
  35. data/sass/piecss/utilities/_typography.scss +96 -107
  36. data/sass/piecss/utilities/_unit.scss +85 -50
  37. data/templates/project/_sets/_button.scss +1 -1
  38. data/templates/project/_sets/_form.scss +1 -1
  39. data/templates/project/_sets.scss +1 -1
  40. data/templates/project/_settings.scss +1 -1
  41. metadata +13 -40
  42. data/sass/piecss/settings/fonts/_asap.scss +0 -44
  43. data/sass/piecss/settings/fonts/_bree-serif.scss +0 -23
  44. data/sass/piecss/settings/fonts/_lato.scss +0 -32
  45. data/sass/piecss/settings/fonts/_pt-sans.scss +0 -40
  46. data/sass/piecss/settings/fonts/_raleway.scss +0 -31
  47. data/sass/piecss/settings/fonts/_righteous.scss +0 -23
  48. data/sass/piecss/settings/fonts/_roboto-slab.scss +0 -37
  49. data/sass/piecss/settings/fonts/_roboto.scss +0 -35
  50. data/sass/piecss/settings/fonts/_sofia-pro.scss +0 -40
  51. data/sass/piecss/settings/fonts/_varela-round.scss +0 -24
  52. data/sass/piecss/settings/fonts/icon-fonts/_fontawesome.scss +0 -33
  53. data/sass/piecss/settings/fonts/icon-fonts/_foundation-accessability.scss +0 -75
  54. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_bootstrap.scss +0 -84
  55. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_core.scss +0 -129
  56. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_extras.scss +0 -93
  57. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_icons.scss +0 -381
  58. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_mixins.scss +0 -48
  59. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_path.scss +0 -14
  60. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_variables.scss +0 -734
  61. data/sass/piecss/settings/fonts/icon-fonts/foundation-accessability/_settings.scss +0 -28
@@ -6,6 +6,7 @@
6
6
  // 1. Functions
7
7
  // percentage
8
8
  // fraction-to-text
9
+ // gutters
9
10
  // 2. Mixins
10
11
  // 2a. Columns
11
12
  // column
@@ -36,10 +37,11 @@
36
37
  /// @return {Number} - The resulting percentage value
37
38
  ///
38
39
 
39
- @function fraction-to-percentage($fraction: 1/3)
40
- {
41
- @return percentage($fraction);
40
+ // scss-lint:disable SpaceAroundOperator
41
+ @function fraction-to-percentage($fraction: 1/3) {
42
+ @return percentage($fraction);
42
43
  }
44
+ // scss-lint:enable SpaceAroundOperator
43
45
 
44
46
 
45
47
  ///
@@ -61,96 +63,134 @@
61
63
  /// @return {String}
62
64
  ///
63
65
 
64
- @function fraction-to-text($fraction)
65
- {
66
- @if type-of($fraction)==string {
67
- @warn "The function fraction-to-text only accepts unquoted fractions (1/2 and not \"1/2\")";
66
+ // scss-lint:disable SpaceAroundOperator
67
+ @function fraction-to-text($fraction) {
68
+ @if type-of($fraction) == string {
69
+ @warn 'The function fraction-to-text only accepts unquoted fractions (1/2 and not \"1/2\")';
70
+ }
71
+
72
+ @if $fraction == 1/1 { @return "full"; }
73
+ @if $fraction == 1/2 { @return "half"; }
74
+ @if $fraction == 1/3 { @return "third"; }
75
+ @if $fraction == 1/4 { @return "fourth"; }
76
+ @if $fraction == 1/5 { @return "fifth"; }
77
+ @if $fraction == 1/6 { @return "sixth"; }
78
+ @if $fraction == 1/7 { @return "seventh"; }
79
+ @if $fraction == 1/8 { @return "eighth"; }
80
+ @if $fraction == 1/9 { @return "ninth"; }
81
+ @if $fraction == 1/10 { @return "tenth"; }
82
+ @if $fraction == 1/11 { @return "eleventh"; }
83
+ @if $fraction == 1/12 { @return "twelfth"; }
84
+ @if $fraction == 1/13 { @return "thirteenth"; }
85
+ @if $fraction == 1/14 { @return "fourteenth"; }
86
+ @if $fraction == 1/15 { @return "fifteenth"; }
87
+ @if $fraction == 1/16 { @return "sixteenth"; }
88
+ @if $fraction == 2/3 { @return "two-third"; }
89
+ @if $fraction == 3/4 { @return "three-fourth"; }
90
+ @if $fraction == 2/5 { @return "two-fifth"; }
91
+ @if $fraction == 3/5 { @return "three-fifth"; }
92
+ @if $fraction == 4/5 { @return "four-fifth"; }
93
+ @if $fraction == 5/6 { @return "five-sixth"; }
94
+ @if $fraction == 2/7 { @return "two-seventh"; }
95
+ @if $fraction == 3/7 { @return "three-seventh"; }
96
+ @if $fraction == 4/7 { @return "four-seventh"; }
97
+ @if $fraction == 5/7 { @return "five-seventh"; }
98
+ @if $fraction == 6/7 { @return "six-seventh"; }
99
+ @if $fraction == 3/8 { @return "three-eighth"; }
100
+ @if $fraction == 5/8 { @return "five-eighth"; }
101
+ @if $fraction == 7/8 { @return "seven-eighth"; }
102
+ @if $fraction == 2/9 { @return "two-ninth"; }
103
+ @if $fraction == 4/9 { @return "four-ninth"; }
104
+ @if $fraction == 5/9 { @return "five-ninth"; }
105
+ @if $fraction == 7/9 { @return "seven-ninth"; }
106
+ @if $fraction == 8/9 { @return "eight-ninth"; }
107
+ @if $fraction == 3/10 { @return "three-tenth"; }
108
+ @if $fraction == 7/10 { @return "seven-tenth"; }
109
+ @if $fraction == 9/10 { @return "nine-tenth"; }
110
+ @if $fraction == 2/11 { @return "two-eleventh"; }
111
+ @if $fraction == 3/11 { @return "three-eleventh"; }
112
+ @if $fraction == 4/11 { @return "four-eleventh"; }
113
+ @if $fraction == 5/11 { @return "five-eleventh"; }
114
+ @if $fraction == 6/11 { @return "six-eleventh"; }
115
+ @if $fraction == 7/11 { @return "seven-eleventh"; }
116
+ @if $fraction == 8/11 { @return "eight-eleventh"; }
117
+ @if $fraction == 9/11 { @return "nine-eleventh"; }
118
+ @if $fraction == 10/11 { @return "ten-eleventh"; }
119
+ @if $fraction == 5/12 { @return "five-twelfth"; }
120
+ @if $fraction == 7/12 { @return "seven-twelfth"; }
121
+ @if $fraction == 9/12 { @return "nine-twelfth"; }
122
+ @if $fraction == 11/12 { @return "eleven-twelfth"; }
123
+ @if $fraction == 2/13 { @return "two-thirteenth"; }
124
+ @if $fraction == 3/13 { @return "three-thirteenth"; }
125
+ @if $fraction == 4/13 { @return "four-thirteenth"; }
126
+ @if $fraction == 5/13 { @return "five-thirteenth"; }
127
+ @if $fraction == 6/13 { @return "six-thirteenth"; }
128
+ @if $fraction == 7/13 { @return "seven-thirteenth"; }
129
+ @if $fraction == 8/13 { @return "eight-thirteenth"; }
130
+ @if $fraction == 9/13 { @return "nine-thirteenth"; }
131
+ @if $fraction == 10/13 { @return "ten-thirteenth"; }
132
+ @if $fraction == 11/13 { @return "twelve-thirteenth"; }
133
+ @if $fraction == 12/13 { @return "thirteen-thirteenth"; }
134
+ @if $fraction == 3/14 { @return "three-fourteenth"; }
135
+ @if $fraction == 5/14 { @return "five-fourteenth"; }
136
+ @if $fraction == 9/14 { @return "nine-fourteenth"; }
137
+ @if $fraction == 11/14 { @return "eleven-fourteenth"; }
138
+ @if $fraction == 13/14 { @return "thirteen-fourteenth"; }
139
+ @if $fraction == 2/15 { @return "two-fifteenth"; }
140
+ @if $fraction == 4/15 { @return "four-fifteenth"; }
141
+ @if $fraction == 7/15 { @return "seven-fifteenth"; }
142
+ @if $fraction == 8/15 { @return "eight-fifteenth"; }
143
+ @if $fraction == 11/15 { @return "eleven-fifteenth"; }
144
+ @if $fraction == 13/15 { @return "thirteen-fifteenth"; }
145
+ @if $fraction == 14/15 { @return "fourteen-fifteenth"; }
146
+ @if $fraction == 3/16 { @return "three-sixteenth"; }
147
+ @if $fraction == 5/16 { @return "five-sixteenth"; }
148
+ @if $fraction == 7/16 { @return "seven-sixteenth"; }
149
+ @if $fraction == 9/16 { @return "nine-sixteenth"; }
150
+ @if $fraction == 11/16 { @return "eleven-sixteenth"; }
151
+ @if $fraction == 13/16 { @return "thirteen-sixteenth"; }
152
+ @if $fraction == 15/16 { @return "sixteen-sixteenth"; }
153
+
154
+ @return "full";
155
+ }
156
+ // scss-lint:enable SpaceAroundOperator
157
+
158
+ ///
159
+ /// Return a value based on the gutter-width. The gutter width is set as a property of the layouts map.
160
+ /// If no breakpoint is set, the function will return the default gutter width.
161
+ ///
162
+ /// @param {Arglist} $args - An argument list, may contain 2 values (a fraction and/or a valid breakpoint)
163
+ ///
164
+ /// @return {Number} - The resulting value in px
165
+ ///
166
+
167
+ // scss-lint:disable SpaceAroundOperator
168
+ @function gutter($args...) {
169
+
170
+ $_fraction: 1/2;
171
+ $_breakpoint: false;
172
+
173
+ // Process arguments
174
+ @if length($args) {
175
+ @each $var in $args {
176
+ @if type-of($var) == number {
177
+ $_fraction: $var;
178
+ }
179
+ @if type-of($var) == list {
180
+ $_breakpoint: $var;
181
+ }
68
182
  }
183
+ }
184
+
185
+ $gutter-width: get-layout-gutter-width($layouts);
186
+
187
+ @if $_breakpoint {
188
+ $gutter-width: get-layout-gutter-width(get-layout($_breakpoint));
189
+ }
69
190
 
70
- @if $fraction == 1/1 { @return "full"; }
71
- @if $fraction == 1/2 { @return "half"; }
72
- @if $fraction == 1/3 { @return "third"; }
73
- @if $fraction == 1/4 { @return "fourth"; }
74
- @if $fraction == 1/5 { @return "fifth"; }
75
- @if $fraction == 1/6 { @return "sixth"; }
76
- @if $fraction == 1/7 { @return "seventh"; }
77
- @if $fraction == 1/8 { @return "eighth"; }
78
- @if $fraction == 1/9 { @return "ninth"; }
79
- @if $fraction == 1/10 { @return "tenth"; }
80
- @if $fraction == 1/11 { @return "eleventh"; }
81
- @if $fraction == 1/12 { @return "twelfth"; }
82
- @if $fraction == 1/13 { @return "thirteenth"; }
83
- @if $fraction == 1/14 { @return "fourteenth"; }
84
- @if $fraction == 1/15 { @return "fifteenth"; }
85
- @if $fraction == 1/16 { @return "sixteenth"; }
86
- @if $fraction == 2/3 { @return "two-third"; }
87
- @if $fraction == 3/4 { @return "three-fourth"; }
88
- @if $fraction == 2/5 { @return "two-fifth"; }
89
- @if $fraction == 3/5 { @return "three-fifth"; }
90
- @if $fraction == 4/5 { @return "four-fifth"; }
91
- @if $fraction == 5/6 { @return "five-sixth"; }
92
- @if $fraction == 2/7 { @return "two-seventh"; }
93
- @if $fraction == 3/7 { @return "three-seventh"; }
94
- @if $fraction == 4/7 { @return "four-seventh"; }
95
- @if $fraction == 5/7 { @return "five-seventh"; }
96
- @if $fraction == 6/7 { @return "six-seventh"; }
97
- @if $fraction == 3/8 { @return "three-eighth"; }
98
- @if $fraction == 5/8 { @return "five-eighth"; }
99
- @if $fraction == 7/8 { @return "seven-eighth"; }
100
- @if $fraction == 2/9 { @return "two-ninth"; }
101
- @if $fraction == 4/9 { @return "four-ninth"; }
102
- @if $fraction == 5/9 { @return "five-ninth"; }
103
- @if $fraction == 7/9 { @return "seven-ninth"; }
104
- @if $fraction == 8/9 { @return "eight-ninth"; }
105
- @if $fraction == 3/10 { @return "three-tenth"; }
106
- @if $fraction == 7/10 { @return "seven-tenth"; }
107
- @if $fraction == 9/10 { @return "nine-tenth"; }
108
- @if $fraction == 2/11 { @return "two-eleventh"; }
109
- @if $fraction == 3/11 { @return "three-eleventh"; }
110
- @if $fraction == 4/11 { @return "four-eleventh"; }
111
- @if $fraction == 5/11 { @return "five-eleventh"; }
112
- @if $fraction == 6/11 { @return "six-eleventh"; }
113
- @if $fraction == 7/11 { @return "seven-eleventh"; }
114
- @if $fraction == 8/11 { @return "eight-eleventh"; }
115
- @if $fraction == 9/11 { @return "nine-eleventh"; }
116
- @if $fraction == 10/11 { @return "ten-eleventh"; }
117
- @if $fraction == 5/12 { @return "five-twelfth"; }
118
- @if $fraction == 7/12 { @return "seven-twelfth"; }
119
- @if $fraction == 9/12 { @return "nine-twelfth"; }
120
- @if $fraction == 11/12 { @return "eleven-twelfth"; }
121
- @if $fraction == 2/13 { @return "two-thirteenth"; }
122
- @if $fraction == 3/13 { @return "three-thirteenth"; }
123
- @if $fraction == 4/13 { @return "four-thirteenth"; }
124
- @if $fraction == 5/13 { @return "five-thirteenth"; }
125
- @if $fraction == 6/13 { @return "six-thirteenth"; }
126
- @if $fraction == 7/13 { @return "seven-thirteenth"; }
127
- @if $fraction == 8/13 { @return "eight-thirteenth"; }
128
- @if $fraction == 9/13 { @return "nine-thirteenth"; }
129
- @if $fraction == 10/13 { @return "ten-thirteenth"; }
130
- @if $fraction == 11/13 { @return "twelve-thirteenth"; }
131
- @if $fraction == 12/13 { @return "thirteen-thirteenth"; }
132
- @if $fraction == 3/14 { @return "three-fourteenth"; }
133
- @if $fraction == 5/14 { @return "five-fourteenth"; }
134
- @if $fraction == 9/14 { @return "nine-fourteenth"; }
135
- @if $fraction == 11/14 { @return "eleven-fourteenth"; }
136
- @if $fraction == 13/14 { @return "thirteen-fourteenth"; }
137
- @if $fraction == 2/15 { @return "two-fifteenth"; }
138
- @if $fraction == 4/15 { @return "four-fifteenth"; }
139
- @if $fraction == 7/15 { @return "seven-fifteenth"; }
140
- @if $fraction == 8/15 { @return "eight-fifteenth"; }
141
- @if $fraction == 11/15 { @return "eleven-fifteenth"; }
142
- @if $fraction == 13/15 { @return "thirteen-fifteenth"; }
143
- @if $fraction == 14/15 { @return "fourteen-fifteenth"; }
144
- @if $fraction == 3/16 { @return "three-sixteenth"; }
145
- @if $fraction == 5/16 { @return "five-sixteenth"; }
146
- @if $fraction == 7/16 { @return "seven-sixteenth"; }
147
- @if $fraction == 9/16 { @return "nine-sixteenth"; }
148
- @if $fraction == 11/16 { @return "eleven-sixteenth"; }
149
- @if $fraction == 13/16 { @return "thirteen-sixteenth"; }
150
- @if $fraction == 15/16 { @return "sixteen-sixteenth"; }
151
-
152
- @return "full";
191
+ @return $_fraction * $gutter-width;
153
192
  }
193
+ // scss-lint:enable SpaceAroundOperator
154
194
 
155
195
 
156
196
  ///
@@ -163,15 +203,41 @@
163
203
  /// @return {Map} - A breakpoint global layout, or a breakpoint nested page layout from [$layouts map](./#variable-layouts)
164
204
  ///
165
205
 
166
- @function get-layout($breakpoint, $page: null) {
167
- $layout: map-get($layouts, $breakpoint);
168
- @if $page {
169
- $layout: map-get($layout, $page);
170
- }
171
- @return $layout;
206
+ @function get-layout($breakpoint: null, $page: null) {
207
+
208
+ $layout: map-get($layouts, $breakpoint);
209
+
210
+ @if $page {
211
+ $layout: map-get($layout, $page);
212
+ }
213
+
214
+ @return $layout;
215
+ }
216
+
217
+
218
+ ///
219
+ /// Get layout settings from a layout map
220
+ ///
221
+ ///
222
+ /// @param {String} $breakpoints - A valid breakpoint
223
+ /// @param {Map} $page - An optional page layout
224
+ ///
225
+ /// @return {Map} - A breakpoint global layout, or a breakpoint nested page layout from [$layouts map](./#variable-layouts)
226
+ ///
227
+
228
+ @function get($key, $breakpoint) {
229
+
230
+ @if not( map-has-key($layout, $breakpoint) ) {
231
+ @error "Unknown breakpoint: #{$breakpoint}";
232
+ }
233
+
234
+ $config: map-get($layout, $breakpoint);
235
+
236
+ @return map-get($config, "columns");
172
237
  }
173
238
 
174
239
 
240
+
175
241
  // 2. MIXINS
176
242
 
177
243
 
@@ -180,48 +246,52 @@
180
246
  /// Uses padding by default, can be overridden to use margins instead which is especially helpful when assigning backgrounds or borders.
181
247
  ///
182
248
  /// @since 0.1
183
- ///
249
+ ///
184
250
  /// @param {Number} $fraction (1/1) - A fraction, e.g. 1/2
185
251
  /// @param {Number | Bool} $apply-padding (1/2) - A fraction, e.g. 1/2, or false
186
252
  /// @param {Number | Bool} $apply-margin (false) - A fraction, e.g. 1/2, or false
187
253
  ///
188
254
 
189
- @mixin column($fraction: 1/1, $apply-padding: 1/2, $apply-margin: false)
190
- {
191
- @include column-behavior();
192
- @include column-width($fraction);
255
+ // scss-lint:disable SpaceAroundOperator
256
+ @mixin column($fraction: 1/1, $apply-padding: 1/2, $apply-margin: false) {
193
257
 
194
- @if $apply-padding {
195
- @include gutters($apply-padding);
196
- }
258
+ @include column-behavior();
259
+ @include column-width($fraction);
197
260
 
198
- @if $apply-margin {
199
- @include gutters($apply-margin, true);
200
- }
261
+ @if $apply-padding {
262
+ @include gutters($apply-padding);
263
+ }
264
+
265
+ @if $apply-margin {
266
+ @include gutters($apply-margin, true);
267
+ }
201
268
  }
269
+ // scss-lint:enable SpaceAroundOperator
202
270
 
203
271
 
204
272
  ///
205
273
  /// Mixin column-behavior: prepares an element to behave as a column. Widths must be set separately with [column-width](./#mixin-column-width).
206
274
  ///
207
275
  /// @since 0.1
208
- ///
276
+ ///
209
277
  /// @param {Bool} $column-float (false) - If true, render columns as left floated block element. If false, render as inline-blocks.
210
278
  /// @param {Bool | Number} $negative-right-margin (false) - If set, applies a negative right margin to force inline-blocks to render without gaps. Only use this if you cannot minify your markup.
211
279
  ///
212
280
 
213
- @mixin column-behavior($column-float: $column-float, $negative-right-margin: $negative-right-margin)
214
- {
215
- @if $column-float {
216
- display: block;
217
- float: left;
218
- }
219
- @else {
220
- @include inline-block(top);
221
- @if $negative-right-margin {
222
- margin-right: $negative-right-margin !important;
223
- }
281
+ @mixin column-behavior($column-float: $column-float, $negative-right-margin: $negative-right-margin) {
282
+
283
+ @if $column-float {
284
+ display: block;
285
+ float: left;
286
+ }
287
+ @else {
288
+ @include inline-block(top);
289
+ @if $negative-right-margin {
290
+ // scss-lint:disable ImportantRule
291
+ margin-right: $negative-right-margin !important;
292
+ // scss-lint:enable ImportantRule
224
293
  }
294
+ }
225
295
  }
226
296
 
227
297
 
@@ -229,76 +299,80 @@
229
299
  /// Mixin column-width. If [$negative-right-margin]() is set, it will automatically remove if from columns that span the full width of their containers.
230
300
  ///
231
301
  /// @since 0.1
232
- ///
302
+ ///
233
303
  /// @param {Number} $fraction (1/1) - A fraction, e.g. 1/2
234
304
  ///
235
305
 
236
- @mixin column-width($fraction: $column-width-default)
237
- {
238
- width: percentage($fraction);
306
+ // scss-lint:disable SpaceAroundOperator
307
+ @mixin column-width($fraction: $column-width-default) {
239
308
 
240
- // Remove negative margin on elements that span full width of their container
241
- @if $fraction == 1/1 and $negative-right-margin {
242
- margin-right: 0;
243
- }
309
+ width: percentage($fraction);
310
+
311
+ // Remove negative margin on elements that span full width of their container
312
+ @if $fraction == 1/1 and $negative-right-margin {
313
+ margin-right: 0;
314
+ }
244
315
  }
316
+ // scss-lint:enable SpaceAroundOperator
245
317
 
246
318
 
247
319
  ///
248
320
  /// Mixes in gutter properties. Gutters are declared inside the column (padding) by default, on both sides. Can be overridden to use margins instead, which is helpful when assigning backgrounds or borders
249
321
  ///
250
322
  /// @since 0.1
251
- ///
323
+ ///
252
324
  /// @param {Number} $fraction (1/2) - A fraction, e.g. 1/2
253
325
  /// @param {Bool} $use-margin (false) - If true, will render gutters outside the column using margins
254
326
  ///
255
327
 
256
- @mixin gutters($fraction: 1/2, $use-margin: false)
257
- {
258
- $both: length($fraction);
328
+ // scss-lint:disable SpaceAroundOperator
329
+ @mixin gutters($fraction: 1/2, $use-margin: false) {
259
330
 
260
- $left: $fraction;
261
- $right: $fraction;
331
+ $both: length($fraction);
262
332
 
263
- @if $both > 1 {
264
- $left: nth($fraction,1);
265
- $right: nth($fraction,2);
266
- }
333
+ $left: $fraction;
334
+ $right: $fraction;
335
+
336
+ @if $both > 1 {
337
+ $left: nth($fraction, 1);
338
+ $right: nth($fraction, 2);
339
+ }
267
340
 
268
- @if ($use-margin) {
269
- @if $left != false {
270
- margin-left: $gutter-width * $left;
271
- }
272
- @if $right != false {
273
- margin-right: $gutter-width * $right;
274
- }
341
+ @if ($use-margin) {
342
+ @if $left != false {
343
+ margin-left: $gutter-width * $left;
275
344
  }
276
- @else {
277
- @if $left != false {
278
- padding-left: $gutter-width * $left;
279
- }
280
- @if $right != false {
281
- padding-right: $gutter-width * $right;
282
- }
345
+ @if $right != false {
346
+ margin-right: $gutter-width * $right;
283
347
  }
348
+ }
349
+ @else {
350
+ @if $left != false {
351
+ padding-left: $gutter-width * $left;
352
+ }
353
+ @if $right != false {
354
+ padding-right: $gutter-width * $right;
355
+ }
356
+ }
284
357
  }
358
+ // scss-lint:enable SpaceAroundOperator
285
359
 
286
360
 
287
361
  ///
288
362
  /// Fixes content width and aligns in viewport. [$root-position](./#variable-root-position) is defind in grid settings. Centers content inside the viewport by default.
289
363
  ///
290
364
  /// @since 0.1
291
- ///
365
+ ///
292
366
  /// @param {Number} $root-max-width (72em) - The maximum width of your content
293
367
  ///
294
368
 
295
- @mixin root($root-max-width: $root-max-width, $set-display: false)
296
- {
297
- @if $root-position==center {
298
- margin: 0 auto;
299
- }
369
+ @mixin root($root-max-width: $root-max-width, $set-display: false) {
370
+
371
+ @if $root-position == center {
372
+ margin: 0 auto;
373
+ }
300
374
 
301
- max-width: $root-max-width;
375
+ max-width: $root-max-width;
302
376
  }
303
377
 
304
378
 
@@ -306,20 +380,20 @@
306
380
  /// Use it to remove column spacing on columns
307
381
  ///
308
382
  /// @since 0.1
309
- ///
383
+ ///
310
384
  /// @param {Bool} $use-margin (false)
311
385
  ///
312
386
 
313
- @mixin container-behavior($use-margin: false)
314
- {
315
- @if $use-margin {
316
- margin-left: 0;
317
- margin-right: 0;
318
- }
319
- @else {
320
- padding-left: 0;
321
- padding-right: 0;
322
- }
387
+ @mixin container-behavior($use-margin: false) {
388
+
389
+ @if $use-margin {
390
+ margin-left: 0;
391
+ margin-right: 0;
392
+ }
393
+ @else {
394
+ padding-left: 0;
395
+ padding-right: 0;
396
+ }
323
397
  }
324
398
 
325
399
 
@@ -328,48 +402,52 @@
328
402
  /// Use it to remove padded column spacing on columns, helpful when nesting columns and when applying backgrounds.
329
403
  ///
330
404
  /// @since 0.1
331
- ///
405
+ ///
332
406
  /// @param {Number} $fraction (1/2) - A fraction, e.g. 1/2
333
407
  ///
334
408
 
335
- @mixin bleed($fraction: -1/2)
336
- {
337
- @include gutters($fraction, true);
409
+ // scss-lint:disable SpaceAroundOperator
410
+ @mixin bleed($fraction: -1/2) {
411
+ @include gutters($fraction, true);
338
412
  }
413
+ // scss-lint:enable SpaceAroundOperator
339
414
 
340
415
 
341
416
  ///
342
417
  /// Mixin for soure ordering
343
418
  ///
344
419
  /// @since 0.1
345
- ///
420
+ ///
346
421
  /// @param {Number} $fraction (1/2) - A fraction, e.g. 1/2
347
422
  ///
348
423
 
349
- @mixin move($fraction)
350
- {
351
- left: percentage($fraction);
424
+ // scss-lint:disable SpaceAroundOperator
425
+ @mixin move($fraction) {
426
+ left: percentage($fraction);
352
427
  }
428
+ // scss-lint:enable SpaceAroundOperator
353
429
 
354
430
 
355
431
  ///
356
432
  /// @alias move
357
433
  ///
358
434
 
359
- @mixin push($fraction)
360
- {
361
- @include move($fraction);
435
+ // scss-lint:disable SpaceAroundOperator
436
+ @mixin push($fraction) {
437
+ @include move($fraction);
362
438
  }
439
+ // scss-lint:enable SpaceAroundOperator
363
440
 
364
441
 
365
442
  ///
366
443
  /// @alias move
367
444
  ///
368
445
 
369
- @mixin pull($fraction)
370
- {
371
- @include move(-1*$fraction);
446
+ // scss-lint:disable SpaceAroundOperator
447
+ @mixin pull($fraction) {
448
+ @include move(-1 * $fraction);
372
449
  }
450
+ // scss-lint:enable SpaceAroundOperator
373
451
 
374
452
 
375
453
  ///
@@ -379,14 +457,14 @@
379
457
  /// @since 0.1
380
458
  ///
381
459
 
382
- @mixin reset-source-order()
383
- {
384
- @if $column-breakpoint {
385
- @include breakpoint( $column-breakpoint ) {
386
- position: static;
387
- position: initial;
388
- }
460
+ @mixin reset-source-order() {
461
+
462
+ @if $column-breakpoint {
463
+ @include breakpoint($column-breakpoint) {
464
+ position: static;
465
+ position: initial;
389
466
  }
467
+ }
390
468
  }
391
469
 
392
470
 
@@ -396,28 +474,119 @@
396
474
  /// @since 0.1
397
475
  ///
398
476
 
399
- @mixin debug-layout($columns: $columns, $color: #000, $gutter-width: $gutter-width)
400
- {
401
- background-size: percentage(1 / $columns) 100%;
402
- background-image:
403
- linear-gradient(to right,
404
- rgba($color,.1) 0,
405
- rgba($color,.1) $gutter-width / 2,
406
- transparent $gutter-width / 2,
407
- transparent percentage($columns / $columns)
408
- ),
409
- linear-gradient(to left,
410
- rgba($color,.1) 0,
411
- rgba($color,.1) $gutter-width / 2,
412
- transparent $gutter-width / 2,
413
- transparent percentage($columns / $columns)
414
- ),
415
- linear-gradient(to left,
416
- transparent 0%,
417
- rgba(0,0,0,.5) 1px,
418
- transparent 1px,
419
- transparent percentage($columns / $columns)
420
- )
421
- ;
477
+ @mixin debug-layout($columns: $columns, $color: $black, $gutter-width: $gutter-width) {
478
+ background-size: percentage(1 / $columns) 100%;
479
+ // scss-lint:disable SpaceAfterPropertyColon TrailingWhitespace
480
+ background-image:
481
+ linear-gradient(to right,
482
+ rgba($color, .1) 0,
483
+ rgba($color, .1) $gutter-width / 2,
484
+ transparent $gutter-width / 2,
485
+ transparent percentage($columns / $columns)
486
+ ),
487
+ linear-gradient(to left,
488
+ rgba($color, .1) 0,
489
+ rgba($color, .1) $gutter-width / 2,
490
+ transparent $gutter-width / 2,
491
+ transparent percentage($columns / $columns)
492
+ ),
493
+ linear-gradient(to left,
494
+ transparent 0%,
495
+ rgba($black, .5) 1px,
496
+ transparent 1px,
497
+ transparent percentage($columns / $columns)
498
+ );
499
+ // scss-lint:enable SpaceAfterPropertyColon TrailingWhitespace
500
+ }
501
+
502
+
503
+
504
+ ///
505
+ /// Retrieves the layout settings for a specific breakpoint
506
+ ///
507
+ /// @since 1.0
508
+ ///
509
+
510
+ @function get-layout($breakpoint) {
511
+ @return map-get($layouts, $breakpoint);
422
512
  }
423
513
 
514
+
515
+ ///
516
+ /// Retrieves the column setting for a specific breakpoint
517
+ ///
518
+ /// @since 1.0
519
+ ///
520
+
521
+ @function get-layout-columns($breakpoint: false) {
522
+ @return get-layout-property("columns", $breakpoint);
523
+ }
524
+
525
+
526
+ ///
527
+ /// Retrieves the gutter-width setting for a specific breakpoint
528
+ ///
529
+ /// @since 1.0
530
+ ///
531
+
532
+ @function get-layout-gutter-width($breakpoint: false) {
533
+ @return get-layout-property("gutter-width", $breakpoint);
534
+ }
535
+
536
+
537
+ ///
538
+ /// Retrieves the rhythm settings for a specific breakpoint
539
+ ///
540
+ /// @since 1.0
541
+ ///
542
+
543
+ @function get-layout-rhythm($breakpoint: false) {
544
+ @return get-layout-property("rhythm", $breakpoint);
545
+ }
546
+
547
+
548
+ ///
549
+ /// Retrieves the debug colour settings for a specific breakpoint
550
+ ///
551
+ /// @since 1.0
552
+ ///
553
+
554
+ @function get-layout-debug-color($breakpoint: false) {
555
+ @return get-layout-property("debug-color", $breakpoint);
556
+ }
557
+
558
+
559
+ ///
560
+ /// Retrieves a property setting for a specific breakpoint
561
+ ///
562
+ /// @since 1.0
563
+ ///
564
+ /// @example
565
+ /// $columns: get-layout-property($columns);
566
+ ///
567
+ /// @param {String} $property - The layout-map property to retrieve
568
+ /// @param {String | Bool} $breakpoint (false) - A valid breakpoint string, or false to retrieve the default value
569
+ ///
570
+ /// @return {*}
571
+ ///
572
+
573
+ @function get-layout-property($property, $breakpoint: false, $layouts: $layouts) {
574
+
575
+ $_value: null;
576
+
577
+ // Retrieve the layout – default values are not nested in a breakpoint
578
+ $_layout: $layouts;
579
+
580
+ @if $breakpoint and map-has-key($layouts, $breakpoint) {
581
+ $_layout: map-get($layouts, $breakpoint);
582
+ }
583
+
584
+ @if map-has-key($_layout, $property) {
585
+ $_value: map-get($_layout, $property);
586
+ }
587
+ @else {
588
+ @error "Unknown layout property: #{$property}";
589
+ }
590
+
591
+ @return $_value;
592
+ }