flint-gs 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -23
- data/lib/flint.rb +2 -2
- data/stylesheets/_flint.scss +3 -10
- data/stylesheets/flint/functions/_functions.scss +4 -1
- data/stylesheets/flint/functions/helpers/_helpers.scss +3 -3
- data/stylesheets/flint/functions/lib/_calc-width.scss +15 -1
- data/stylesheets/flint/functions/lib/_map-fetch.scss +1 -1
- data/stylesheets/flint/functions/lib/_types-in-list.scss +120 -0
- data/stylesheets/flint/globals/_globals.scss +4 -0
- data/stylesheets/flint/mixins/_mixins.scss +3 -2
- data/stylesheets/flint/mixins/lib/{_flint-calculate.scss → _calculate.scss} +0 -0
- data/stylesheets/flint/mixins/lib/_main.scss +911 -0
- metadata +5 -4
- data/stylesheets/flint/mixins/lib/_flint-main.scss +0 -824
File without changes
|
@@ -0,0 +1,911 @@
|
|
1
|
+
// Main API
|
2
|
+
// -------------------------------------------------------------------------------
|
3
|
+
// @param $key [string | number | list] : key of breakpoint [shorthand: span]
|
4
|
+
// @param $span [string | number | list] : value of span of column [shorthand: context]
|
5
|
+
// @param $context [number | list] : value of context of span
|
6
|
+
// @param $gutter [string | list] : alias for gutter modifier
|
7
|
+
// @param $shift [number | list] : value to shift column
|
8
|
+
// -------------------------------------------------------------------------------
|
9
|
+
// @output foundation styles | container styles | calculated styles
|
10
|
+
|
11
|
+
@mixin _(
|
12
|
+
$key: null,
|
13
|
+
$span: null,
|
14
|
+
$context: null,
|
15
|
+
$gutter: null,
|
16
|
+
$shift: null
|
17
|
+
) {
|
18
|
+
|
19
|
+
// Initial check to see what type of instance this is
|
20
|
+
// -------------------------------------------------------------------------------
|
21
|
+
// @param $key [string | number | list] : checks type of instance
|
22
|
+
// -------------------------------------------------------------------------------
|
23
|
+
// @output foundation styles | container styles | calculated styles
|
24
|
+
|
25
|
+
// Foundation
|
26
|
+
// ----
|
27
|
+
@if $key == "foundation" {
|
28
|
+
|
29
|
+
// Apply global border-box-sizing if set to true
|
30
|
+
@if get-value("settings", "border-box-sizing") {
|
31
|
+
$flint__foundation: "existant" !global;
|
32
|
+
}
|
33
|
+
|
34
|
+
// Foundation is now globally existant
|
35
|
+
// ----
|
36
|
+
@if $flint__foundation == "existant" {
|
37
|
+
@at-root *, *:before, *:after {
|
38
|
+
-moz-box-sizing: border-box;
|
39
|
+
-webkit-box-sizing: border-box;
|
40
|
+
box-sizing: border-box;
|
41
|
+
@content;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
// Clearfix
|
46
|
+
// ----
|
47
|
+
} @else if $key == "clear" {
|
48
|
+
|
49
|
+
@include clearfix();
|
50
|
+
|
51
|
+
// Instance
|
52
|
+
// ----
|
53
|
+
} @else {
|
54
|
+
|
55
|
+
@if $key == "container"
|
56
|
+
or exists($flint, $key) and $span != null
|
57
|
+
or types-in-list($span, "number") or type-of($span) == "number"
|
58
|
+
or types-in-list($key, "number") or type-of($key) == "number"
|
59
|
+
{
|
60
|
+
|
61
|
+
// Only apply display rule if the key is either default or container
|
62
|
+
@if is-default($key) or $key == "container" {
|
63
|
+
|
64
|
+
display: block;
|
65
|
+
|
66
|
+
// Only apply display rule to default breakpoint
|
67
|
+
} @else if length($key) > 1 or is-not-string($key) {
|
68
|
+
// Loop over all keys, set to default
|
69
|
+
@for $i from 1 through length($flint__all__keys) {
|
70
|
+
$calcKey: steal-key($i);
|
71
|
+
|
72
|
+
@if is-default($calcKey) {
|
73
|
+
display: block;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
// Apply individually if foundation is not set globally, but is set to true in config
|
79
|
+
@if get-value("settings", "border-box-sizing") and $flint__foundation == "nonexistant" {
|
80
|
+
-moz-box-sizing: border-box;
|
81
|
+
-webkit-box-sizing: border-box;
|
82
|
+
box-sizing: border-box;
|
83
|
+
|
84
|
+
// Warn to either set a global foundation, or turn border-box-sizing off
|
85
|
+
@if global-variable-exists(global-foundation-is-set) == false {
|
86
|
+
@warn "Global foundation is #{$flint__foundation}. To avoid repeated box-sizing incidents, set a global _(foundation) rule, or turn border-box-sizing to false in your config file.";
|
87
|
+
|
88
|
+
// Declare global variable so only a single warning prints out
|
89
|
+
$global-foundation-is-set: true !global;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
// Container
|
94
|
+
// -------------------------------------------------------------------------------
|
95
|
+
// @param $key [string] : container instance
|
96
|
+
// -------------------------------------------------------------------------------
|
97
|
+
// @output container styles
|
98
|
+
|
99
|
+
@if $key == "container" {
|
100
|
+
float: none;
|
101
|
+
|
102
|
+
// Fixed grid? Output container for each breakpoint
|
103
|
+
// ----
|
104
|
+
@if get-value("settings", "grid") == "fixed" {
|
105
|
+
|
106
|
+
@for $i from 1 through length($flint__all__keys) {
|
107
|
+
|
108
|
+
// Set up variables
|
109
|
+
$calcKey: steal-key($i);
|
110
|
+
$calcContainer: $key;
|
111
|
+
|
112
|
+
// Key is default, no media queries
|
113
|
+
@if is-default($calcKey) {
|
114
|
+
|
115
|
+
width: calc-width($calcKey, $calcContainer);
|
116
|
+
@content;
|
117
|
+
|
118
|
+
// Not default, wrap in media queries
|
119
|
+
} @else {
|
120
|
+
|
121
|
+
// Highest breakpoint? No max-width
|
122
|
+
@if is-highest-breakpoint($calcKey) {
|
123
|
+
|
124
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
125
|
+
width: calc-width($calcKey, $calcContainer);
|
126
|
+
@content;
|
127
|
+
}
|
128
|
+
|
129
|
+
} @else {
|
130
|
+
|
131
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) and ( max-width: (calc-breakpoint("prev", $calcKey, $i) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
132
|
+
width: calc-width($calcKey, $calcContainer);
|
133
|
+
@content;
|
134
|
+
}
|
135
|
+
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
// Check if max-width is set
|
142
|
+
// ----
|
143
|
+
@if get-value("settings", "max-width") {
|
144
|
+
|
145
|
+
// Check if it's an number
|
146
|
+
@if is-number(get-value("settings", "max-width")) {
|
147
|
+
max-width: get-value("settings", "max-width");
|
148
|
+
// Then use highest breakpoint
|
149
|
+
} @else {
|
150
|
+
max-width: max(get-all-breakpoints()...);
|
151
|
+
}
|
152
|
+
|
153
|
+
}
|
154
|
+
|
155
|
+
// Center container is set to true?
|
156
|
+
// ----
|
157
|
+
@if get-value("settings", "center-container") {
|
158
|
+
margin-right: auto;
|
159
|
+
margin-left: auto;
|
160
|
+
} @else {
|
161
|
+
margin-right: 0;
|
162
|
+
margin-left: 0;
|
163
|
+
}
|
164
|
+
|
165
|
+
// Not container
|
166
|
+
// ----
|
167
|
+
} @else {
|
168
|
+
|
169
|
+
// Make sure it's the default, output float
|
170
|
+
@if is-default($key) {
|
171
|
+
|
172
|
+
float: unquote(get-value("settings", "float-style"));
|
173
|
+
|
174
|
+
} @else if is-list($key) or is-not-string($key) {
|
175
|
+
|
176
|
+
@for $i from 1 through length($flint__all__keys) {
|
177
|
+
$calcKey: steal-key($i);
|
178
|
+
|
179
|
+
@if is-default($calcKey) {
|
180
|
+
float: unquote(get-value("settings", "float-style"));
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
// Recursive shorthand without context
|
188
|
+
// -------------------------------------------------------------------------------
|
189
|
+
// @param $span [number | null] : span value
|
190
|
+
// -------------------------------------------------------------------------------
|
191
|
+
// @output calculated styles
|
192
|
+
|
193
|
+
@if is-number($key) and length($key) == 1 {
|
194
|
+
|
195
|
+
@if $span == null {
|
196
|
+
|
197
|
+
@for $i from 1 through length($flint__all__keys) {
|
198
|
+
|
199
|
+
$calcKey: steal-key($i);
|
200
|
+
$calcSpan: $key;
|
201
|
+
$calcContext: $span;
|
202
|
+
$calcGutter: $gutter;
|
203
|
+
$calcShift: $shift;
|
204
|
+
|
205
|
+
@if is-default($calcKey) {
|
206
|
+
|
207
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
208
|
+
@content;
|
209
|
+
}
|
210
|
+
|
211
|
+
} @else {
|
212
|
+
|
213
|
+
@if get-value("settings", "grid") == "fluid" {
|
214
|
+
|
215
|
+
@if is-highest-breakpoint($calcKey) {
|
216
|
+
|
217
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
218
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
219
|
+
@content;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
} @else {
|
224
|
+
|
225
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(is-lowest-breakpoint($calcKey), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
226
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
227
|
+
@content;
|
228
|
+
}
|
229
|
+
}
|
230
|
+
|
231
|
+
}
|
232
|
+
|
233
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
234
|
+
|
235
|
+
@if is-highest-breakpoint($calcKey) {
|
236
|
+
|
237
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
238
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
239
|
+
@content;
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
} @else {
|
244
|
+
|
245
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) and ( max-width: (calc-breakpoint("prev", $calcKey, $i) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
246
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
247
|
+
@content;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
} @else {
|
254
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
255
|
+
}
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
// Recursive shorthand with identical context
|
260
|
+
// -------------------------------------------------------------------------------
|
261
|
+
// @param $key [number] : span value
|
262
|
+
// @param $span [number] : context value of span
|
263
|
+
// -------------------------------------------------------------------------------
|
264
|
+
// @output calculated styles
|
265
|
+
|
266
|
+
} @else if length($span) == 1 and is-number($span) or $span == "auto" {
|
267
|
+
|
268
|
+
@for $i from 1 through length($flint__all__keys) {
|
269
|
+
|
270
|
+
$calcKey: steal-key($i);
|
271
|
+
$calcSpan: $key;
|
272
|
+
$calcContext: $span;
|
273
|
+
$calcGutter: $gutter;
|
274
|
+
$calcShift: $shift;
|
275
|
+
|
276
|
+
@if is-default($calcKey) {
|
277
|
+
|
278
|
+
@include calcFlint ($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
279
|
+
@content;
|
280
|
+
}
|
281
|
+
|
282
|
+
} @else {
|
283
|
+
|
284
|
+
@if get-value("settings", "grid") == "fluid" {
|
285
|
+
|
286
|
+
@if is-highest-breakpoint($calcKey) {
|
287
|
+
|
288
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
289
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
290
|
+
@content;
|
291
|
+
}
|
292
|
+
}
|
293
|
+
|
294
|
+
} @else {
|
295
|
+
|
296
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(is-lowest-breakpoint($calcKey), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
297
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
298
|
+
@content;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
}
|
303
|
+
|
304
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
305
|
+
|
306
|
+
@if is-highest-breakpoint($calcKey) {
|
307
|
+
|
308
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
309
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
310
|
+
@content;
|
311
|
+
}
|
312
|
+
}
|
313
|
+
|
314
|
+
} @else {
|
315
|
+
|
316
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) and ( max-width: (calc-breakpoint("prev", $calcKey, $i) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
317
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
318
|
+
@content;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
|
322
|
+
}
|
323
|
+
|
324
|
+
} @else {
|
325
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
// Recursive shorthand with differing context
|
331
|
+
// -------------------------------------------------------------------------------
|
332
|
+
// @param $key [number] : span value
|
333
|
+
// @param $span [list] : context value of span for each breakpoint
|
334
|
+
// -------------------------------------------------------------------------------
|
335
|
+
// @output calculated styles
|
336
|
+
|
337
|
+
} @else if types-in-list($span, "number") or $span == "auto" {
|
338
|
+
|
339
|
+
@for $i from 1 through length($flint__all__keys) {
|
340
|
+
|
341
|
+
$calcKey: steal-key($i);
|
342
|
+
$calcSpan: $key;
|
343
|
+
$calcContext: $span;
|
344
|
+
$calcGutter: $gutter;
|
345
|
+
$calcShift: $shift;
|
346
|
+
|
347
|
+
@if is-default($calcKey) {
|
348
|
+
|
349
|
+
@include calcFlint ($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
350
|
+
@content;
|
351
|
+
}
|
352
|
+
|
353
|
+
} @else {
|
354
|
+
|
355
|
+
@if get-value("settings", "grid") == "fluid" {
|
356
|
+
|
357
|
+
@if is-highest-breakpoint($calcKey) {
|
358
|
+
|
359
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
360
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
361
|
+
@content;
|
362
|
+
}
|
363
|
+
}
|
364
|
+
|
365
|
+
} @else {
|
366
|
+
|
367
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(is-lowest-breakpoint($calcKey), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
368
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
369
|
+
@content;
|
370
|
+
}
|
371
|
+
}
|
372
|
+
|
373
|
+
}
|
374
|
+
|
375
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
376
|
+
|
377
|
+
@if is-highest-breakpoint($calcKey) {
|
378
|
+
|
379
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
380
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
381
|
+
@content;
|
382
|
+
}
|
383
|
+
}
|
384
|
+
|
385
|
+
} @else {
|
386
|
+
|
387
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) and ( max-width: (calc-breakpoint("prev", $calcKey, $i) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
388
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
389
|
+
@content;
|
390
|
+
}
|
391
|
+
}
|
392
|
+
|
393
|
+
}
|
394
|
+
|
395
|
+
} @else {
|
396
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
397
|
+
}
|
398
|
+
}
|
399
|
+
}
|
400
|
+
}
|
401
|
+
}
|
402
|
+
|
403
|
+
// Variable shorthand
|
404
|
+
// -------------------------------------------------------------------------------
|
405
|
+
// @param $key [list] : span value for each breakpoint
|
406
|
+
// -------------------------------------------------------------------------------
|
407
|
+
// @output calculated styles
|
408
|
+
|
409
|
+
@if types-in-list($key, "number") and $span == null {
|
410
|
+
|
411
|
+
@for $i from 1 through length($flint__all__keys) {
|
412
|
+
|
413
|
+
$calcKey: steal-key($i);
|
414
|
+
$calcSpan: $key;
|
415
|
+
$calcContext: $context;
|
416
|
+
$calcGutter: $gutter;
|
417
|
+
$calcShift: $shift;
|
418
|
+
|
419
|
+
@if is-default($calcKey) {
|
420
|
+
|
421
|
+
@include calcFlint ($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
422
|
+
@content;
|
423
|
+
}
|
424
|
+
|
425
|
+
} @else {
|
426
|
+
|
427
|
+
@if get-value("settings", "grid") == "fluid" {
|
428
|
+
|
429
|
+
@if is-highest-breakpoint($calcKey) {
|
430
|
+
|
431
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
432
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
433
|
+
@content;
|
434
|
+
}
|
435
|
+
}
|
436
|
+
|
437
|
+
} @else {
|
438
|
+
|
439
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(is-lowest-breakpoint($calcKey), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
440
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
441
|
+
@content;
|
442
|
+
}
|
443
|
+
}
|
444
|
+
|
445
|
+
}
|
446
|
+
|
447
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
448
|
+
|
449
|
+
@if is-highest-breakpoint($calcKey) {
|
450
|
+
|
451
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
452
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
453
|
+
@content;
|
454
|
+
}
|
455
|
+
}
|
456
|
+
|
457
|
+
} @else {
|
458
|
+
|
459
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) and ( max-width: (calc-breakpoint("prev", $calcKey, $i) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
460
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
461
|
+
@content;
|
462
|
+
}
|
463
|
+
}
|
464
|
+
|
465
|
+
}
|
466
|
+
|
467
|
+
} @else {
|
468
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
469
|
+
}
|
470
|
+
}
|
471
|
+
}
|
472
|
+
|
473
|
+
// Variable shorthand with context
|
474
|
+
// -------------------------------------------------------------------------------
|
475
|
+
// @param $key [list] : span value for each breakpoint
|
476
|
+
// @param $span [list] : context value for each breakpoint
|
477
|
+
// -------------------------------------------------------------------------------
|
478
|
+
// @output calculated styles
|
479
|
+
|
480
|
+
} @else if types-in-list($key, "number") and types-in-list($span, "number") or $span == "auto" {
|
481
|
+
|
482
|
+
@for $i from 1 through length($flint__all__keys) {
|
483
|
+
|
484
|
+
$calcKey: steal-key($i);
|
485
|
+
$calcSpan: $key;
|
486
|
+
$calcContext: $span;
|
487
|
+
$calcGutter: $gutter;
|
488
|
+
$calcShift: $shift;
|
489
|
+
|
490
|
+
@if is-default($calcKey) {
|
491
|
+
|
492
|
+
@include calcFlint ($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
493
|
+
@content;
|
494
|
+
}
|
495
|
+
|
496
|
+
} @else {
|
497
|
+
|
498
|
+
@if get-value("settings", "grid") == "fluid" {
|
499
|
+
|
500
|
+
@if is-highest-breakpoint($calcKey) {
|
501
|
+
|
502
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
503
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
504
|
+
@content;
|
505
|
+
}
|
506
|
+
}
|
507
|
+
|
508
|
+
} @else {
|
509
|
+
|
510
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, $i) + if(is-lowest-breakpoint($calcKey), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
511
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
512
|
+
@content;
|
513
|
+
}
|
514
|
+
}
|
515
|
+
|
516
|
+
}
|
517
|
+
|
518
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
519
|
+
|
520
|
+
@if is-highest-breakpoint($calcKey) {
|
521
|
+
|
522
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) {
|
523
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
524
|
+
@content;
|
525
|
+
}
|
526
|
+
}
|
527
|
+
|
528
|
+
} @else {
|
529
|
+
|
530
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, $i) ) and ( max-width: (calc-breakpoint("prev", $calcKey, $i) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
531
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i) {
|
532
|
+
@content;
|
533
|
+
}
|
534
|
+
}
|
535
|
+
|
536
|
+
}
|
537
|
+
|
538
|
+
} @else {
|
539
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
540
|
+
}
|
541
|
+
}
|
542
|
+
}
|
543
|
+
|
544
|
+
// Call by alias
|
545
|
+
// -------------------------------------------------------------------------------
|
546
|
+
// @param $key [string] : breakpoint alias
|
547
|
+
// @param $span [number] : span value
|
548
|
+
// -------------------------------------------------------------------------------
|
549
|
+
// @output calculated styles
|
550
|
+
|
551
|
+
} @else if exists($flint, $key) and is-number($span) and $context == null {
|
552
|
+
|
553
|
+
$calcKey: $key;
|
554
|
+
$calcSpan: $span;
|
555
|
+
$calcContext: $context;
|
556
|
+
$calcGutter: $gutter;
|
557
|
+
$calcShift: $shift;
|
558
|
+
|
559
|
+
@if is-default($calcKey) {
|
560
|
+
|
561
|
+
@include calcFlint ($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
562
|
+
@content;
|
563
|
+
}
|
564
|
+
|
565
|
+
} @else {
|
566
|
+
|
567
|
+
@if get-value("settings", "grid") == "fluid" {
|
568
|
+
|
569
|
+
@if is-highest-breakpoint($calcKey) {
|
570
|
+
|
571
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, get-index($calcKey)) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
572
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
573
|
+
@content;
|
574
|
+
}
|
575
|
+
}
|
576
|
+
|
577
|
+
} @else {
|
578
|
+
|
579
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, get-index($calcKey)) + if(is-lowest-breakpoint($calcKey), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) {
|
580
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
581
|
+
@content;
|
582
|
+
}
|
583
|
+
}
|
584
|
+
|
585
|
+
}
|
586
|
+
|
587
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
588
|
+
|
589
|
+
@if is-highest-breakpoint($calcKey) {
|
590
|
+
|
591
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) {
|
592
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
593
|
+
@content;
|
594
|
+
}
|
595
|
+
}
|
596
|
+
|
597
|
+
} @else {
|
598
|
+
|
599
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) and ( max-width: (calc-breakpoint("prev", $calcKey, get-index($calcKey)) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
600
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
601
|
+
@content;
|
602
|
+
}
|
603
|
+
}
|
604
|
+
|
605
|
+
}
|
606
|
+
|
607
|
+
} @else {
|
608
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
609
|
+
}
|
610
|
+
}
|
611
|
+
|
612
|
+
// Call by alias with context
|
613
|
+
// -------------------------------------------------------------------------------
|
614
|
+
// @param $key [string] : breakpoint alias
|
615
|
+
// @param $span [number] : span value
|
616
|
+
// @param $context [number] : context value of span
|
617
|
+
// -------------------------------------------------------------------------------
|
618
|
+
// @output calculated styles
|
619
|
+
|
620
|
+
} @else if exists($flint, $key) and is-number($span) and is-number($context) or $context == "auto" {
|
621
|
+
|
622
|
+
$calcKey: $key;
|
623
|
+
$calcSpan: $span;
|
624
|
+
$calcContext: $context;
|
625
|
+
$calcGutter: $gutter;
|
626
|
+
$calcShift: $shift;
|
627
|
+
|
628
|
+
@if is-default($calcKey) {
|
629
|
+
|
630
|
+
@include calcFlint ($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
631
|
+
@content;
|
632
|
+
}
|
633
|
+
|
634
|
+
} @else {
|
635
|
+
|
636
|
+
@if get-value("settings", "grid") == "fluid" {
|
637
|
+
|
638
|
+
@if is-highest-breakpoint($calcKey) {
|
639
|
+
|
640
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, get-index($calcKey)) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
641
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
642
|
+
@content;
|
643
|
+
}
|
644
|
+
}
|
645
|
+
|
646
|
+
} @else {
|
647
|
+
|
648
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, get-index($calcKey)) + if(is-lowest-breakpoint($calcKey), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) {
|
649
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
650
|
+
@content;
|
651
|
+
}
|
652
|
+
}
|
653
|
+
|
654
|
+
}
|
655
|
+
|
656
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
657
|
+
|
658
|
+
@if is-highest-breakpoint($calcKey) {
|
659
|
+
|
660
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) {
|
661
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
662
|
+
@content;
|
663
|
+
}
|
664
|
+
}
|
665
|
+
|
666
|
+
} @else {
|
667
|
+
|
668
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) and ( max-width: (calc-breakpoint("prev", $calcKey, get-index($calcKey)) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
669
|
+
@include calcFlint($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift) {
|
670
|
+
@content;
|
671
|
+
}
|
672
|
+
}
|
673
|
+
|
674
|
+
}
|
675
|
+
|
676
|
+
} @else {
|
677
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
// Wrap @content in media queries
|
682
|
+
// -------------------------------------------------------------------------------
|
683
|
+
// @param $key [list] : defines how to make up media query
|
684
|
+
// -------------------------------------------------------------------------------
|
685
|
+
// @output styles wrapped in media query
|
686
|
+
|
687
|
+
} @else if exists($flint, $key) or is-list($key) and $span == null and $context == null {
|
688
|
+
|
689
|
+
// Call $key breakpoint by alias
|
690
|
+
// -------------------------------------------------------------------------------
|
691
|
+
// @param $key [string] : only for $key breakpoint
|
692
|
+
// -------------------------------------------------------------------------------
|
693
|
+
|
694
|
+
@if length($key) == 1 {
|
695
|
+
|
696
|
+
@if get-value("settings", "grid") == "fluid" {
|
697
|
+
@if is-highest-breakpoint($key) {
|
698
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $key, get-index($key)) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
699
|
+
@content;
|
700
|
+
}
|
701
|
+
} @else {
|
702
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $key, get-index($key)) + if(is-lowest-breakpoint($key), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $key, get-index($key)) ) {
|
703
|
+
@content;
|
704
|
+
}
|
705
|
+
}
|
706
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
707
|
+
@if is-highest-breakpoint($key) {
|
708
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $key, get-index($key)) ) {
|
709
|
+
@content;
|
710
|
+
}
|
711
|
+
} @else {
|
712
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $key, get-index($key)) ) and ( max-width: (calc-breakpoint("prev", $key, get-index($key)) - 1) ) {
|
713
|
+
@content;
|
714
|
+
}
|
715
|
+
}
|
716
|
+
} @else {
|
717
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
718
|
+
}
|
719
|
+
|
720
|
+
// From $key breakpoint to infinity
|
721
|
+
// -------------------------------------------------------------------------------
|
722
|
+
// @param $key [from key to infinity] : min-width from $key breakpoint
|
723
|
+
// -------------------------------------------------------------------------------
|
724
|
+
|
725
|
+
} @else if types-in-list($key, "string", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" and nth($key, 4) == "infinity" {
|
726
|
+
|
727
|
+
@if get-value("settings", "grid") == "fluid" {
|
728
|
+
@media only screen and ( min-width: (calc-breakpoint("next", nth($key, 2), get-index(nth($key, 2))) + if(is-lowest-breakpoint(nth($key, 2)), 0, if(get-config-unit() == "em", em(1px), 1))) ) {
|
729
|
+
@content;
|
730
|
+
}
|
731
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
732
|
+
@media only screen and ( min-width: calc-breakpoint("alias", nth($key, 2), get-index(nth($key, 2))) ) {
|
733
|
+
@content;
|
734
|
+
}
|
735
|
+
} @else {
|
736
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
737
|
+
}
|
738
|
+
|
739
|
+
// From $key-x breakpoint to $key-y breakpoint
|
740
|
+
// -------------------------------------------------------------------------------
|
741
|
+
// @param $key [from key-x to key-y] : from $key-x breakpoint to $key-y
|
742
|
+
// -------------------------------------------------------------------------------
|
743
|
+
|
744
|
+
} @else if types-in-list($key, "string", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" {
|
745
|
+
|
746
|
+
@if get-value("settings", "grid") == "fluid" {
|
747
|
+
@media only screen and ( min-width: (calc-breakpoint("next", nth($key, 2), get-index(nth($key, 2))) + if(is-lowest-breakpoint(nth($key, 2)), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", nth($key, 4), get-index(nth($key, 4))) ) {
|
748
|
+
@content;
|
749
|
+
}
|
750
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
751
|
+
@media only screen and ( min-width: calc-breakpoint("alias", nth($key, 2), get-index(nth($key, 2))) ) and ( max-width: (calc-breakpoint("prev", nth($key, 4), get-index(nth($key, 4))) - if(is-highest-breakpoint(nth($key, 4)), 0, if(get-config-unit() == "em", em(1px), 1))) ) {
|
752
|
+
@content;
|
753
|
+
}
|
754
|
+
} @else {
|
755
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
756
|
+
}
|
757
|
+
|
758
|
+
// From $num-x to $num-y
|
759
|
+
// -------------------------------------------------------------------------------
|
760
|
+
// @param $key [from number to number] : arbitrary media query
|
761
|
+
// -------------------------------------------------------------------------------
|
762
|
+
|
763
|
+
} @else if types-in-list($key, "string" "number" "string" "number", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" {
|
764
|
+
// Make sure passed units match units used in config
|
765
|
+
@if get-config-unit() == unit(nth($key, 2)) and get-config-unit() == unit(nth($key, 4)) {
|
766
|
+
@media only screen and ( min-width: nth($key, 2) ) and ( max-width: nth($key, 4) ) {
|
767
|
+
@content;
|
768
|
+
}
|
769
|
+
// Throw error
|
770
|
+
} @else {
|
771
|
+
@warn "Passed units [#{unit(nth($key, 2))}, #{unit(nth($key, 4))}] do not match the unit used in your config map: #{get-config-unit()}";
|
772
|
+
}
|
773
|
+
|
774
|
+
// Greater than $key breakpoint
|
775
|
+
// -------------------------------------------------------------------------------
|
776
|
+
// @param $key [greater than key] : anything above $key breakpoint
|
777
|
+
// -------------------------------------------------------------------------------
|
778
|
+
|
779
|
+
} @else if types-in-list($key, "string", 3) and nth($key, 1) == "greater" and nth($key, 2) == "than" {
|
780
|
+
|
781
|
+
@if get-value("settings", "grid") == "fluid" {
|
782
|
+
@media only screen and ( min-width: (calc-breakpoint("alias", nth($key, 3), get-index(nth($key, 3))) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
783
|
+
@content;
|
784
|
+
}
|
785
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
786
|
+
@media only screen and ( min-width: calc-breakpoint("prev", nth($key, 3), get-index(nth($key, 3))) ) {
|
787
|
+
@content;
|
788
|
+
}
|
789
|
+
} @else {
|
790
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
791
|
+
}
|
792
|
+
|
793
|
+
// Greater than number
|
794
|
+
// -------------------------------------------------------------------------------
|
795
|
+
// @param $key [greater than number] : anything above number
|
796
|
+
// -------------------------------------------------------------------------------
|
797
|
+
|
798
|
+
} @else if types-in-list($key, "string" "string" "number", 3) and nth($key, 1) == "greater" and nth($key, 2) == "than" {
|
799
|
+
|
800
|
+
@if get-config-unit() == unit(nth($key, 3)) {
|
801
|
+
@media only screen and ( min-width: nth($key, 3) + if(get-config-unit() == "em", em(1px), 1) ) {
|
802
|
+
@content;
|
803
|
+
}
|
804
|
+
} @else {
|
805
|
+
@warn "Passed units [#{unit(nth($key, 3))}] do not match the unit used in your config map: #{get-config-unit()}";
|
806
|
+
}
|
807
|
+
|
808
|
+
// Number greater than $key breakpoint
|
809
|
+
// -------------------------------------------------------------------------------
|
810
|
+
// @param $key [number greater than key] : unit value greater than $key breakpoint
|
811
|
+
// -------------------------------------------------------------------------------
|
812
|
+
|
813
|
+
} @else if types-in-list($key, "number" "string" "string" "string", 4) and nth($key, 2) == "greater" and nth($key, 3) == "than" {
|
814
|
+
|
815
|
+
@if get-config-unit() == unit(nth($key, 1)) {
|
816
|
+
@media only screen and ( min-width: (calc-breakpoint("alias", nth($key, 4), get-index(nth($key, 4))) + nth($key, 1)) ) {
|
817
|
+
@content;
|
818
|
+
}
|
819
|
+
} @else {
|
820
|
+
@warn "Passed units [#{unit(nth($key, 1))}] do not match the unit used in your config map: #{get-config-unit()}";
|
821
|
+
}
|
822
|
+
|
823
|
+
// Less than $key breakpoint
|
824
|
+
// -------------------------------------------------------------------------------
|
825
|
+
// @param $key [less than key] : anything below $key breakpoint
|
826
|
+
// -------------------------------------------------------------------------------
|
827
|
+
|
828
|
+
} @else if types-in-list($key, "string", 3) and nth($key, 1) == "less" and nth($key, 2) == "than" {
|
829
|
+
|
830
|
+
@if get-value("settings", "grid") == "fluid" {
|
831
|
+
@media only screen and ( max-width: calc-breakpoint("next", nth($key, 3), get-index(nth($key, 3))) ) {
|
832
|
+
@content;
|
833
|
+
}
|
834
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
835
|
+
@media only screen and ( max-width: (calc-breakpoint("alias", nth($key, 3), get-index(nth($key, 3))) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
836
|
+
@content;
|
837
|
+
}
|
838
|
+
} @else {
|
839
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
840
|
+
}
|
841
|
+
|
842
|
+
// Less than number
|
843
|
+
// -------------------------------------------------------------------------------
|
844
|
+
// @param $key [less than number] : anything below number
|
845
|
+
// -------------------------------------------------------------------------------
|
846
|
+
|
847
|
+
} @else if types-in-list($key, "string" "string" "number", 3) and nth($key, 1) == "less" and nth($key, 2) == "than" {
|
848
|
+
|
849
|
+
@if get-config-unit() == unit(nth($key, 3)) {
|
850
|
+
@media only screen and ( max-width: nth($key, 3) - if(get-config-unit() == "em", em(1px), 1) ) {
|
851
|
+
@content;
|
852
|
+
}
|
853
|
+
} @else {
|
854
|
+
@warn "Passed units [#{unit(nth($key, 3))}] do not match the unit used in your config map: #{get-config-unit()}";
|
855
|
+
}
|
856
|
+
|
857
|
+
// Number less than $key breakpoint
|
858
|
+
// -------------------------------------------------------------------------------
|
859
|
+
// @param $key [number less than key] : unit value less than $key breakpoint
|
860
|
+
// -------------------------------------------------------------------------------
|
861
|
+
|
862
|
+
} @else if types-in-list($key, "number" "string" "string" "string", 4) and nth($key, 2) == "less" and nth($key, 3) == "than" {
|
863
|
+
|
864
|
+
@if get-config-unit() == unit(nth($key, 1)) {
|
865
|
+
@media only screen and ( max-width: (calc-breakpoint("alias", nth($key, 4), get-index(nth($key, 4))) - nth($key, 1)) ) {
|
866
|
+
@content;
|
867
|
+
}
|
868
|
+
} @else {
|
869
|
+
@warn "Passed units [#{unit(nth($key, 1))}] do not match the unit used in your config map: #{get-config-unit()}";
|
870
|
+
}
|
871
|
+
|
872
|
+
// For $key-x $key-y $key-z
|
873
|
+
// -------------------------------------------------------------------------------
|
874
|
+
// @param $key [for list of strings] : will duplicate styles for each passed $key breakpoint
|
875
|
+
// -------------------------------------------------------------------------------
|
876
|
+
|
877
|
+
} @else if types-in-list($key, "string") and nth($key, 1) == "for" {
|
878
|
+
|
879
|
+
@for $i from 1 through length($key) {
|
880
|
+
$calcKey: nth($key, $i);
|
881
|
+
|
882
|
+
@if exists($flint, $calcKey) {
|
883
|
+
@if get-value("settings", "grid") == "fluid" {
|
884
|
+
@if is-highest-breakpoint($calcKey) {
|
885
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, get-index($calcKey)) + if(get-config-unit() == "em", em(1px), 1)) ) {
|
886
|
+
@content;
|
887
|
+
}
|
888
|
+
} @else {
|
889
|
+
@media only screen and ( min-width: (calc-breakpoint("next", $calcKey, get-index($calcKey)) + if(is-lowest-breakpoint($calcKey), 0, if(get-config-unit() == "em", em(1px), 1))) ) and ( max-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) {
|
890
|
+
@content;
|
891
|
+
}
|
892
|
+
}
|
893
|
+
} @else if get-value("settings", "grid") == "fixed" {
|
894
|
+
@if is-highest-breakpoint($calcKey) {
|
895
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) {
|
896
|
+
@content;
|
897
|
+
}
|
898
|
+
} @else {
|
899
|
+
@media only screen and ( min-width: calc-breakpoint("alias", $calcKey, get-index($calcKey)) ) and ( max-width: (calc-breakpoint("prev", $calcKey, get-index($calcKey)) - if(get-config-unit() == "em", em(1px), 1)) ) {
|
900
|
+
@content;
|
901
|
+
}
|
902
|
+
}
|
903
|
+
} @else {
|
904
|
+
@warn "Invalid gutter settings in config map: #{get-value('settings', 'grid')}. Valid arguments: fluid | fixed";
|
905
|
+
}
|
906
|
+
}
|
907
|
+
}
|
908
|
+
}
|
909
|
+
}
|
910
|
+
}
|
911
|
+
}
|