flint-gs 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b485e8f5a531a62d571916c16297761d3f6cbc8
4
- data.tar.gz: fc241b91b94453da341a1634f34a10b21880b4e1
3
+ metadata.gz: 96a5437a526794df1dffe1366c95cf0b41ee7e67
4
+ data.tar.gz: cb8efd439872d835a5c2ad37648065d1890bc5d3
5
5
  SHA512:
6
- metadata.gz: 3d390061be82a075ae1204ba1267f8a02fe98ca1201d8e90e6bab56cb06d8e46b9b1a099bca5b4007d513666f4e3eb7fa7efe5ed28daa9da478b61ada139c6b1
7
- data.tar.gz: f7fbed87cc04eba5f1c4e53b83e8c99704fa8ed601cfa130f4f676ecf15d946febc6a6fa478711f390efc2f7d827e10df11f7a28ea415c8d6b4d8d21d2e43bce
6
+ metadata.gz: a5075d609d928f9d4dedafa643428899cb734bfa4f3fa5ee0636164965f441fecb284c892b3b26b38c1bf6310ad673ada0f2fa2a7cf90b79884ccabeeecd4796
7
+ data.tar.gz: 1c9293adad9e2cc48ac458ad2e6d1f67b43b8a98f16904bb022e16e41f04011c712b132dafc7eddc1f1ae23db811bc44e695ef7e45295bff976e92a6200e13cd
data/README.md CHANGED
@@ -238,7 +238,7 @@ Whatever your `default` is set to, **flint** will not wrap those styles in media
238
238
 
239
239
  ###Recursive shorthand with identical context
240
240
 
241
- Use this if your nested context is *identical* across all breakpoints. The `context` is the span of the elements parent. ***Update:*** You can now use `$context: auto`, and we'll do all the calculations for you. Just be sure a parent element with a Flint `instance` actually exists or you'll get some weird output, or none at all. **Context is not needed on `fixed` grids.**
241
+ Use this if your nested context is *identical* across all breakpoints. The `context` is the span of the elements parent. ***Update:*** You can now use `$context: auto`, and we'll do all the calculations for you. Just be sure a parent element with a Flint `instance` actually exists or you'll get some weird output, or none at all. **Using `$context: auto` on fixed grids, the width with will be calculated by the parents width, instead of using the base breakpoints width.**
242
242
 
243
243
  ```scss
244
244
  // `auto` will work
@@ -823,6 +823,10 @@ This will allow the instance functions to properly fallback from `.block .block_
823
823
 
824
824
  Going to start keeping a log of changes starting (4/11/14).**
825
825
 
826
+ ####5/16/14
827
+ * Added `$context: auto` to for fixed grids. It will automatically get the parent instance's width, and calculate on that instead of the base breakpoint.
828
+ * This fixes issues where parents couldn't contain children of the same span, and the further you would nest, the worse the issue would get.
829
+
826
830
  ####5/14/14
827
831
  * Fixed issue with `_(greater than y)` not outputting the correct calculations on `fixed` grids
828
832
  * Issue was that when you used for example: `_(greater than laptop)`, `laptop` would actually be included, instead of ommitted. It now acts as 'anything above laptops breakpoint', the same way `less than y` works.
data/lib/flint.rb CHANGED
@@ -5,8 +5,8 @@ Compass::Frameworks.register('flint', :path => extension_path)
5
5
  # Version is a number. If a version contains alphas, it will be created as a prerelease version
6
6
  # Date is in the form of YYYY-MM-DD
7
7
  module Flint
8
- VERSION = "1.2.0"
9
- DATE = "2014-05-14"
8
+ VERSION = "1.3.0"
9
+ DATE = "2014-05-16"
10
10
  end
11
11
 
12
12
  # Custom functions
@@ -15,11 +15,7 @@
15
15
  // @return [Boolean]
16
16
 
17
17
  @function is-map($n) {
18
- @if type-of($n) == "map" {
19
- @return true;
20
- } @else {
21
- @return false;
22
- }
18
+ @return type-of($n) == "map";
23
19
  }
24
20
 
25
21
  // Checks if item is list
@@ -29,11 +25,7 @@
29
25
  // @return [Boolean]
30
26
 
31
27
  @function is-list($n) {
32
- @if type-of($n) == "list" {
33
- @return true;
34
- } @else {
35
- @return false;
36
- }
28
+ @return type-of($n) == "list";
37
29
  }
38
30
 
39
31
  // Checks if item is number
@@ -43,11 +35,7 @@
43
35
  // @return [Boolean]
44
36
 
45
37
  @function is-number($n) {
46
- @if type-of($n) == "number" {
47
- @return true;
48
- } @else {
49
- @return false;
50
- }
38
+ @return type-of($n) == "number";
51
39
  }
52
40
 
53
41
  // Checks if item is string
@@ -57,11 +45,7 @@
57
45
  // @return [Boolean]
58
46
 
59
47
  @function is-string($n) {
60
- @if type-of($n) == "string" {
61
- @return true;
62
- } @else {
63
- @return false;
64
- }
48
+ @return type-of($n) == "string";
65
49
  }
66
50
 
67
51
  // Checks if item is not string
@@ -71,11 +55,7 @@
71
55
  // @return [Boolean]
72
56
 
73
57
  @function is-not-string($n) {
74
- @if type-of($n) != "string" {
75
- @return true;
76
- } @else {
77
- @return false;
78
- }
58
+ @return type-of($n) != "string";
79
59
  }
80
60
 
81
61
  // Gets each breakpoint's key
@@ -166,5 +146,7 @@
166
146
  $all-columns: append($all-columns, $value, 'comma');
167
147
  }
168
148
  }
169
- } @return $all-columns;
149
+ }
150
+
151
+ @return $all-columns;
170
152
  }
@@ -20,7 +20,7 @@
20
20
  @for $i from 1 through $length {
21
21
  // Make sure that we're not counting the current selector string
22
22
  @if exists($flint__instances, "#{list-to-string($selector-list, " ")}::#{$key}") and $selector-string != list-to-string($selector-list, " ") {
23
- // If true, return the maching instance key
23
+ // If true, return the matching instance key
24
24
  @return "#{list-to-string($selector-list, " ")}::#{$key}";
25
25
  } @else {
26
26
  // Else, remove the last selector and loop again
@@ -27,7 +27,7 @@
27
27
  "context": #{if($context == "auto", get-instance-value($key, span), $context)},
28
28
  "gutter": #{$gutter},
29
29
  "shift": #{$shift},
30
- "outputted": (
30
+ "output": (
31
31
  "width": #{$outputWidth},
32
32
  "margin-right": #{$outputMarginRight},
33
33
  "margin-left": #{$outputMarginLeft},
@@ -156,35 +156,53 @@
156
156
  }
157
157
 
158
158
  } @else if $calcContext != NULL {
159
- // Check if context of parent instance exists
159
+ // Check if parent instance exists
160
160
  $exists: get-family-instance($calcKey);
161
161
 
162
162
  @if $calcShift != NULL {
163
163
  @if $calcGutter == NULL or $calcGutter == "normal" or $calcGutter == "default" or $calcGutter == "regular" and get-value(settings, gutter) != false {
164
164
  // Check if context is set to auto
165
- @if $calcContext == "auto" {
165
+ @if $calcContext == "auto"{
166
166
  // Does parent exist?
167
167
  @if $exists != false {
168
+ @if get-value(settings, grid) == "fluid" {
169
+
170
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*2);
171
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
172
+ $outputMarginLeft: ( if( $calcShift > 0,
173
+ (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
174
+ (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
175
+ ));
176
+
177
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
178
+ @content;
179
+ }
180
+
181
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
182
+ @include debugPrintInstance($calcKey);
183
+
184
+ } @else if get-value(settings, grid) == "fixed" {
185
+ // Get parent width instead of parent span for fixed grids
186
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*2);
187
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
188
+ $outputMarginLeft: ( if( $calcShift > 0,
189
+ (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
190
+ (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
191
+ ));
192
+
193
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
194
+ @content;
195
+ }
196
+
197
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
198
+ @include debugPrintInstance($calcKey);
168
199
 
169
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*2);
170
- $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
171
- $outputMarginLeft: ( if( $calcShift > 0,
172
- (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
173
- (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
174
- ));
175
-
176
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
177
- @content;
178
200
  }
179
-
180
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
181
- @include debugPrintInstance($calcKey);
182
-
183
201
  } @else {
184
202
  // Else warn that context should not be set to `auto`
185
203
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
186
204
  }
187
- // Output styles normally if not set to auto
205
+ // Output styles normally if not set to auto
188
206
  } @else {
189
207
 
190
208
  $outputWidth: (calc-width($calcKey, $calcSpan, $calcContext)) - ((calc-margin($calcKey, $calcSpan, $calcContext))*2);
@@ -206,21 +224,39 @@
206
224
 
207
225
  @if $calcContext == "auto" {
208
226
  @if $exists != false {
227
+ @if get-value(settings, grid) == "fluid" {
209
228
 
210
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*4);
211
- $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
212
- $outputMarginLeft: ( if( $calcShift > 0,
213
- (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
214
- (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
215
- ));
229
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*4);
230
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
231
+ $outputMarginLeft: ( if( $calcShift > 0,
232
+ (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
233
+ (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
234
+ ));
216
235
 
217
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
218
- @content;
219
- }
236
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
237
+ @content;
238
+ }
239
+
240
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
241
+ @include debugPrintInstance($calcKey);
242
+
243
+ } @else if get-value(settings, grid) == "fixed" {
244
+
245
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*4);
246
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
247
+ $outputMarginLeft: ( if( $calcShift > 0,
248
+ (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
249
+ (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
250
+ ));
220
251
 
221
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
222
- @include debugPrintInstance($calcKey);
223
-
252
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
253
+ @content;
254
+ }
255
+
256
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
257
+ @include debugPrintInstance($calcKey);
258
+
259
+ }
224
260
  } @else {
225
261
  // Else warn that context should not be set to `auto`
226
262
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
@@ -247,21 +283,39 @@
247
283
 
248
284
  @if $calcContext == "auto" {
249
285
  @if $exists != false {
286
+ @if get-value(settings, grid) == "fluid" {
250
287
 
251
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))));
252
- $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
253
- $outputMarginLeft: ( if( $calcShift > 0,
254
- calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))),
255
- calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))
256
- ));
288
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))));
289
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
290
+ $outputMarginLeft: ( if( $calcShift > 0,
291
+ calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))),
292
+ calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))
293
+ ));
257
294
 
258
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
259
- @content;
260
- }
295
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
296
+ @content;
297
+ }
298
+
299
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
300
+ @include debugPrintInstance($calcKey);
301
+
302
+ } @else if get-value(settings, grid) == "fixed" {
303
+
304
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))));
305
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
306
+ $outputMarginLeft: ( if( $calcShift > 0,
307
+ calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))),
308
+ calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))
309
+ ));
310
+
311
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
312
+ @content;
313
+ }
261
314
 
262
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
263
- @include debugPrintInstance($calcKey);
315
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
316
+ @include debugPrintInstance($calcKey);
264
317
 
318
+ }
265
319
  } @else {
266
320
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
267
321
  }
@@ -286,21 +340,39 @@
286
340
 
287
341
  @if $calcContext == "auto" {
288
342
  @if $exists != false {
343
+ @if get-value(settings, grid) == "fluid" {
289
344
 
290
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))));
291
- $outputMarginRight: 0;
292
- $outputMarginLeft: ( if( $calcShift > 0,
293
- (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
294
- (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
295
- ));
345
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))));
346
+ $outputMarginRight: 0;
347
+ $outputMarginLeft: ( if( $calcShift > 0,
348
+ (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
349
+ (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
350
+ ));
296
351
 
297
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
298
- @content;
299
- }
352
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
353
+ @content;
354
+ }
355
+
356
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
357
+ @include debugPrintInstance($calcKey);
358
+
359
+ } @else if get-value(settings, grid) == "fixed" {
300
360
 
301
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
302
- @include debugPrintInstance($calcKey);
361
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))));
362
+ $outputMarginRight: 0;
363
+ $outputMarginLeft: ( if( $calcShift > 0,
364
+ (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))),
365
+ (calc-margin($calcKey, -$calcSpan, to-number(get-instance-value($calcKey, span)))) + (calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))))
366
+ ));
303
367
 
368
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
369
+ @content;
370
+ }
371
+
372
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
373
+ @include debugPrintInstance($calcKey);
374
+
375
+ }
304
376
  } @else {
305
377
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
306
378
  }
@@ -325,21 +397,39 @@
325
397
 
326
398
  @if $calcContext == "auto" {
327
399
  @if $exists != false {
400
+ @if get-value(settings, grid) == "fluid" {
328
401
 
329
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))));
330
- $outputMarginRight: 0;
331
- $outputMarginLeft: ( if( $calcShift > 0,
332
- calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))),
333
- calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))
334
- ));
402
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))));
403
+ $outputMarginRight: 0;
404
+ $outputMarginLeft: ( if( $calcShift > 0,
405
+ calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))),
406
+ calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))
407
+ ));
335
408
 
336
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
337
- @content;
338
- }
409
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
410
+ @content;
411
+ }
339
412
 
340
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
341
- @include debugPrintInstance($calcKey);
413
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
414
+ @include debugPrintInstance($calcKey);
342
415
 
416
+ } @else if get-value(settings, grid) == "fixed" {
417
+
418
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan);
419
+ $outputMarginRight: 0;
420
+ $outputMarginLeft: ( if( $calcShift > 0,
421
+ calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span))),
422
+ calc-width($calcKey, $calcShift, to-number(get-instance-value($calcKey, span)))
423
+ ));
424
+
425
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
426
+ @content;
427
+ }
428
+
429
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
430
+ @include debugPrintInstance($calcKey);
431
+
432
+ }
343
433
  } @else {
344
434
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
345
435
  }
@@ -362,27 +452,38 @@
362
452
  }
363
453
  } @else {
364
454
  @if $calcGutter == NULL or $calcGutter == "normal" or $calcGutter == "default" or $calcGutter == "regular" and get-value(settings, gutter) != false {
365
- // Check if context is set to auto
366
455
  @if $calcContext == "auto" {
367
- // Did it exist?
368
456
  @if $exists != false {
457
+ @if get-value(settings, grid) == "fluid" {
369
458
 
370
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*2);
371
- $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
372
- $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
459
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*2);
460
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
461
+ $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
373
462
 
374
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
375
- @content;
376
- }
463
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
464
+ @content;
465
+ }
466
+
467
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
468
+ @include debugPrintInstance($calcKey);
377
469
 
378
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
379
- @include debugPrintInstance($calcKey);
470
+ } @else if get-value(settings, grid) == "fixed" {
380
471
 
472
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*2);
473
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
474
+ $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
475
+
476
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
477
+ @content;
478
+ }
479
+
480
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
481
+ @include debugPrintInstance($calcKey);
482
+
483
+ }
381
484
  } @else {
382
- // Else warn that context should not be set to `auto`
383
485
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
384
486
  }
385
- // Output styles normally if not set to auto
386
487
  } @else {
387
488
 
388
489
  $outputWidth: (calc-width($calcKey, $calcSpan, $calcContext)) - ((calc-margin($calcKey, $calcSpan, $calcContext))*2);
@@ -401,17 +502,33 @@
401
502
 
402
503
  @if $calcContext == "auto" {
403
504
  @if $exists != false {
505
+ @if get-value(settings, grid) == "fluid" {
404
506
 
405
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*4);
406
- $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
407
- $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
507
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*4);
508
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
509
+ $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
408
510
 
409
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
410
- @content;
411
- }
511
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
512
+ @content;
513
+ }
514
+
515
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
516
+ @include debugPrintInstance($calcKey);
412
517
 
413
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
414
- @include debugPrintInstance($calcKey);
518
+ } @else if get-value(settings, grid) == "fixed" {
519
+
520
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*4);
521
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
522
+ $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
523
+
524
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
525
+ @content;
526
+ }
527
+
528
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
529
+ @include debugPrintInstance($calcKey);
530
+
531
+ }
415
532
 
416
533
  } @else {
417
534
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
@@ -434,18 +551,33 @@
434
551
 
435
552
  @if $calcContext == "auto" {
436
553
  @if $exists != false {
554
+ @if get-value(settings, grid) == "fluid" {
437
555
 
438
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))));
439
- $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
440
- $outputMarginLeft: 0;
556
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))));
557
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
558
+ $outputMarginLeft: 0;
441
559
 
442
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
443
- @content;
444
- }
560
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
561
+ @content;
562
+ }
563
+
564
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
565
+ @include debugPrintInstance($calcKey);
566
+
567
+ } @else if get-value(settings, grid) == "fixed" {
445
568
 
446
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
447
- @include debugPrintInstance($calcKey);
569
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))));
570
+ $outputMarginRight: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
571
+ $outputMarginLeft: 0;
448
572
 
573
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
574
+ @content;
575
+ }
576
+
577
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
578
+ @include debugPrintInstance($calcKey);
579
+
580
+ }
449
581
  } @else {
450
582
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
451
583
  }
@@ -467,18 +599,33 @@
467
599
 
468
600
  @if $calcContext == "auto" {
469
601
  @if $exists != false {
602
+ @if get-value(settings, grid) == "fluid" {
470
603
 
471
- $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))));
472
- $outputMarginRight: 0;
473
- $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
604
+ $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - (calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))));
605
+ $outputMarginRight: 0;
606
+ $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
474
607
 
475
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
476
- @content;
477
- }
608
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
609
+ @content;
610
+ }
611
+
612
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
613
+ @include debugPrintInstance($calcKey);
614
+
615
+ } @else if get-value(settings, grid) == "fixed" {
616
+
617
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))));
618
+ $outputMarginRight: 0;
619
+ $outputMarginLeft: calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
620
+
621
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
622
+ @content;
623
+ }
478
624
 
479
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
480
- @include debugPrintInstance($calcKey);
625
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
626
+ @include debugPrintInstance($calcKey);
481
627
 
628
+ }
482
629
  } @else {
483
630
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
484
631
  }
@@ -500,18 +647,33 @@
500
647
 
501
648
  @if $calcContext == "auto" {
502
649
  @if $exists != false {
650
+ @if get-value(settings, grid) == "fluid" {
503
651
 
504
- $outputWidth: calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
505
- $outputMarginRight: 0;
506
- $outputMarginLeft: 0;
652
+ $outputWidth: calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)));
653
+ $outputMarginRight: 0;
654
+ $outputMarginLeft: 0;
507
655
 
508
- @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
509
- @content;
510
- }
656
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
657
+ @content;
658
+ }
659
+
660
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
661
+ @include debugPrintInstance($calcKey);
662
+
663
+ } @else if get-value(settings, grid) == "fixed" {
511
664
 
512
- @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
513
- @include debugPrintInstance($calcKey);
665
+ $outputWidth: (to-number(get-instance-value($calcKey, output, width)) / to-number(get-instance-value($calcKey, span)) * $calcSpan);
666
+ $outputMarginRight: 0;
667
+ $outputMarginLeft: 0;
514
668
 
669
+ @include outputFlint($outputWidth, $outputMarginRight, $outputMarginLeft) {
670
+ @content;
671
+ }
672
+
673
+ @include newInstance($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft);
674
+ @include debugPrintInstance($calcKey);
675
+
676
+ }
515
677
  } @else {
516
678
  @warn "You set context to `#{$calcContext}`, but a parent instance could not be found for `#{selector_string()}`";
517
679
  }
@@ -38,8 +38,8 @@
38
38
  or length($key) == 1 and exists($flint, $key) == false
39
39
  or length($span) > 1
40
40
  or length($key) > 1
41
- and type-of(nth($key, 1)) != "string"
42
- and type-of(nth($key, 2)) != "string"
41
+ and is-not-string(nth($key, 1))
42
+ and is-not-string(nth($key, 2))
43
43
  {
44
44
 
45
45
  // only apply display rule if the key is the default
@@ -47,7 +47,7 @@
47
47
 
48
48
  display: block;
49
49
 
50
- } @else if length($key) > 1 or type-of($key) != "string" {
50
+ } @else if length($key) > 1 or is-not-string($key) {
51
51
 
52
52
  @for $i from 1 through length($flint__all__keys) {
53
53
  $calcKey: steal-key($i);
@@ -78,13 +78,13 @@
78
78
  float: none;
79
79
 
80
80
  // check if max-width is set
81
- @if get-value(settings, max-width) == true {
81
+ @if get-value(settings, max-width) {
82
82
  max-width: max(get-all-breakpoints()...);
83
- } @else if type-of(get-value(settings, max-width)) == number {
83
+ } @else if is-number(get-value(settings, max-width)) {
84
84
  max-width: get-value(settings, max-width);
85
85
  }
86
86
 
87
- @if get-value(settings, center-container) == true {
87
+ @if get-value(settings, center-container) {
88
88
  margin-right: auto;
89
89
  margin-left: auto;
90
90
  } @else {
@@ -98,7 +98,7 @@
98
98
 
99
99
  float: unquote(get-value(settings, float-style));
100
100
 
101
- } @else if length($key) > 1 or type-of($key) != "string" {
101
+ } @else if length($key) > 1 or is-not-string($key) {
102
102
 
103
103
  @for $i from 1 through length($flint__all__keys) {
104
104
  $calcKey: steal-key($i);
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flint-gs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse
8
- - Jake Chapa
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-05-14 00:00:00.000000000 Z
11
+ date: 2014-05-16 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sass
@@ -43,7 +42,6 @@ description: Flint is designed to be a flexible layout toolkit that developers c
43
42
  use for any responsive grid-based project.
44
43
  email:
45
44
  - ezekg@yahoo.com
46
- - jakechapa@gmail.com
47
45
  executables: []
48
46
  extensions: []
49
47
  extra_rdoc_files: []