flint-gs 1.8.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/flint.rb +17 -6
- data/stylesheets/flint/mixins/lib/_calculate.scss +29 -19
- data/stylesheets/flint/mixins/lib/_main.scss +26 -25
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a150c2e0da9a945396df9ad56fe361761678278c
|
4
|
+
data.tar.gz: 06f27376ed86dfe4b14c6ed8e0ba000a8312dfa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b28f695620f39fae5cdbcff2e5021d33861bc391f299a6b8e7fd51fd5e1c7b96b3da20839ee826d6dfbdd14552fef6a2decb6f953633d9e11c7795c210ac091f
|
7
|
+
data.tar.gz: 718c30f212093b9d7753335f519e7b72a75c33124437bcbe5efa4b7868cbece05f204b9cbc7bc5fe0538d9afe056f18cfcc58d6c0a9bee4afe30a42ff666cac4
|
data/README.md
CHANGED
@@ -31,15 +31,15 @@ Enjoy.
|
|
31
31
|
## Requirements
|
32
32
|
|
33
33
|
* Sass ~> `3.3.0`
|
34
|
-
*
|
34
|
+
* Ruby ~> `1.8.7`
|
35
35
|
|
36
36
|
## Installation
|
37
37
|
|
38
38
|
1. Install via Ruby `gem install flint-gs`, or Bower `bower install flint --save-dev`
|
39
|
-
2.
|
40
|
-
3. Import it
|
39
|
+
2. If you're using Compass, add `require "flint"` to your `config.rb`
|
40
|
+
3. Import it into your stylesheet with `@import "flint"`
|
41
41
|
|
42
|
-
If you don't want to install it, then simply download or clone the current build files. Use the starter `config.rb` to require any custom functions Flint uses; currently this is required, as we're making use of custom SassScript functions until the
|
42
|
+
If you don't want to install it, then simply download or clone the current build files. Use the starter `config.rb` to require any custom functions Flint uses; currently this is required, as we're making use of custom SassScript functions until the SassScript `&` [returns to Sass](https://gist.github.com/nex3/8050187). Adjust the paths according to your project.
|
43
43
|
|
44
44
|
## Documentation
|
45
45
|
|
data/lib/flint.rb
CHANGED
@@ -1,12 +1,23 @@
|
|
1
|
-
require '
|
1
|
+
require 'sass'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
base_directory = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
4
|
+
flint_stylesheets_path = File.join(base_directory, 'sass')
|
5
5
|
|
6
|
-
|
6
|
+
if (defined? Compass)
|
7
|
+
Compass::Frameworks.register('flint', :path => base_directory)
|
8
|
+
else
|
9
|
+
# Compass not found, register on the Sass path via the environment
|
10
|
+
if ENV.has_key?("SASS_PATH")
|
11
|
+
ENV["SASS_PATH"] = ENV["SASS_PATH"] + File::PATH_SEPARATOR + flint_stylesheets_path
|
12
|
+
else
|
13
|
+
ENV["SASS_PATH"] = flint_stylesheets_path
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# Date is in the form of YYYY-MM-DD
|
7
18
|
module Flint
|
8
|
-
VERSION = "1.
|
9
|
-
DATE = "2014-08-
|
19
|
+
VERSION = "1.9.1"
|
20
|
+
DATE = "2014-08-04"
|
10
21
|
end
|
11
22
|
|
12
23
|
# Custom functions
|
@@ -18,9 +18,9 @@
|
|
18
18
|
// @param $calc-key [string] : breakpoint key
|
19
19
|
// @param $calc-span [number] : span value
|
20
20
|
// @param $calc-context [number] : context value
|
21
|
-
// @param $calc-gutter [
|
22
|
-
// @param $calc-shift [number] : shift
|
23
|
-
// @param $i [number] : index if variable length is > 1
|
21
|
+
// @param $calc-gutter [string] : gutter modifier
|
22
|
+
// @param $calc-shift [number] : shift modifier
|
23
|
+
// @param $i [number | null] : index if variable length is > 1
|
24
24
|
// -------------------------------------------------------------------------------
|
25
25
|
// @output calculated styles
|
26
26
|
|
@@ -44,9 +44,19 @@
|
|
44
44
|
// Default value for cache search result
|
45
45
|
$cached: false;
|
46
46
|
|
47
|
+
// Check lengths, if invalid throw error
|
48
|
+
// ----
|
49
|
+
@if flint-types-in-list($calc-gutter, "string") and length($calc-gutter) != length($flint__all__keys) {
|
50
|
+
@warn "Invalid argument length of #{length($calc-gutter)} for gutter. If you're using a shorthand, please provide an argument for each breakpoint in your config (#{length($flint__all__keys)}). Your argument was: #{$calc-gutter}";
|
51
|
+
$errors: true;
|
52
|
+
} @else if flint-types-in-list($calc-shift, "number") and length($calc-shift) != length($flint__all__keys) {
|
53
|
+
@warn "Invalid argument length of #{length($calc-shift)} for shift. If you're using a shorthand, please provide an argument for each breakpoint in your config (#{length($flint__all__keys)}). Your argument was: #{$calc-shift}";
|
54
|
+
$errors: true;
|
55
|
+
}
|
56
|
+
|
47
57
|
// Check if any arguments are lists if called from loop
|
48
58
|
// ----
|
49
|
-
@if $i
|
59
|
+
@if $i and not $errors {
|
50
60
|
|
51
61
|
@if flint-types-in-list($calc-key, "number") {
|
52
62
|
$calc-key: nth($calc-key, $i);
|
@@ -68,7 +78,7 @@
|
|
68
78
|
|
69
79
|
// Check for cached results
|
70
80
|
// ----
|
71
|
-
@if $calc-context != "auto" and $calc-span != 0 {
|
81
|
+
@if $calc-context != "auto" and $calc-span != 0 and not $errors {
|
72
82
|
@if map-has-key($flint__cache-results, "#{$calc-key, $calc-span, $calc-context, $calc-gutter, $calc-shift, $i}") {
|
73
83
|
|
74
84
|
// Get results
|
@@ -83,7 +93,7 @@
|
|
83
93
|
|
84
94
|
// Hide if span is zero
|
85
95
|
// ----
|
86
|
-
@if $calc-span == 0 {
|
96
|
+
@if $calc-span == 0 and not $errors {
|
87
97
|
|
88
98
|
// First check if it's the default, so we don't hide the element on all breakpoints
|
89
99
|
@if $calc-key == flint-get-value("settings", "default") {
|
@@ -110,7 +120,7 @@
|
|
110
120
|
}
|
111
121
|
|
112
122
|
// Only run through if cache search was unsuccessful
|
113
|
-
@if $cached
|
123
|
+
@if not $cached and not $errors {
|
114
124
|
|
115
125
|
// Shift, no context
|
116
126
|
// ----
|
@@ -203,7 +213,7 @@
|
|
203
213
|
}
|
204
214
|
} @else {
|
205
215
|
// Else warn that context should not be set to `auto`
|
206
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
216
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
207
217
|
// Throw error
|
208
218
|
$errors: true;
|
209
219
|
}
|
@@ -245,7 +255,7 @@
|
|
245
255
|
}
|
246
256
|
} @else {
|
247
257
|
// Else warn that context should not be set to `auto`
|
248
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
258
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
249
259
|
$errors: true;
|
250
260
|
}
|
251
261
|
// Output styles normally if not set to auto
|
@@ -284,7 +294,7 @@
|
|
284
294
|
|
285
295
|
}
|
286
296
|
} @else {
|
287
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
297
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
288
298
|
$errors: true;
|
289
299
|
}
|
290
300
|
} @else {
|
@@ -322,7 +332,7 @@
|
|
322
332
|
|
323
333
|
}
|
324
334
|
} @else {
|
325
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
335
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
326
336
|
$errors: true;
|
327
337
|
}
|
328
338
|
} @else {
|
@@ -360,7 +370,7 @@
|
|
360
370
|
|
361
371
|
}
|
362
372
|
} @else {
|
363
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
373
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
364
374
|
$errors: true;
|
365
375
|
}
|
366
376
|
} @else {
|
@@ -395,7 +405,7 @@
|
|
395
405
|
|
396
406
|
}
|
397
407
|
} @else {
|
398
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
408
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
399
409
|
$errors: true;
|
400
410
|
}
|
401
411
|
} @else {
|
@@ -425,7 +435,7 @@
|
|
425
435
|
}
|
426
436
|
|
427
437
|
} @else {
|
428
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
438
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
429
439
|
$errors: true;
|
430
440
|
}
|
431
441
|
} @else {
|
@@ -454,7 +464,7 @@
|
|
454
464
|
|
455
465
|
}
|
456
466
|
} @else {
|
457
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
467
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
458
468
|
$errors: true;
|
459
469
|
}
|
460
470
|
} @else {
|
@@ -483,7 +493,7 @@
|
|
483
493
|
|
484
494
|
}
|
485
495
|
} @else {
|
486
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
496
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
487
497
|
$errors: true;
|
488
498
|
}
|
489
499
|
} @else {
|
@@ -512,7 +522,7 @@
|
|
512
522
|
|
513
523
|
}
|
514
524
|
} @else {
|
515
|
-
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string()}`";
|
525
|
+
@warn "You set context to `#{$calc-context}`, but a parent instance could not be found for `#{selector_string() + '::' + $calc-key}`";
|
516
526
|
$errors: true;
|
517
527
|
}
|
518
528
|
} @else {
|
@@ -565,10 +575,10 @@
|
|
565
575
|
|
566
576
|
// Make sure there are no errors
|
567
577
|
// ----
|
568
|
-
@if $errors
|
578
|
+
@if not $errors {
|
569
579
|
|
570
580
|
// Cache result
|
571
|
-
@if $calc-context != "auto" and $calc-span != 0 and $cached
|
581
|
+
@if $calc-context != "auto" and $calc-span != 0 and not $cached {
|
572
582
|
$flint__cache-results: map-merge($flint__cache-results, (
|
573
583
|
"#{$calc-key, $calc-span, $calc-context, $calc-gutter, $calc-shift, $i}": ($output-width, $output-margin-right, $output-margin-left)
|
574
584
|
)) !global;
|
@@ -200,14 +200,10 @@
|
|
200
200
|
or flint-types-in-list($key, "number") and $span == "auto" {
|
201
201
|
|
202
202
|
// Emit warning for invalid argument lengths
|
203
|
-
@if flint-
|
204
|
-
@
|
205
|
-
@warn "Invalid argument: #{$key}. Breakpoint does not exist. Please provide a valid argument.";
|
206
|
-
}
|
207
|
-
} @else if flint-types-in-list($key, "number") and length($key) != length($flint__all__keys) {
|
208
|
-
@warn "Invalid argument length for column: #{length($key)}. Please provide an argument for each breakpoint in your config (#{length($flint__all__keys)}). Your argument was: #{$key}";
|
203
|
+
@if flint-types-in-list($key, "number") and length($key) != length($flint__all__keys) {
|
204
|
+
@warn "Invalid argument length of #{length($key)} for span. Please provide an argument for each breakpoint in your config (#{length($flint__all__keys)}). Your argument was: #{$key}";
|
209
205
|
} @else if flint-types-in-list($span, "number") and length($span) != length($flint__all__keys) {
|
210
|
-
@warn "Invalid argument length
|
206
|
+
@warn "Invalid argument length of #{length($span)} for context. Please provide an argument for each breakpoint in your config (#{length($flint__all__keys)}). Your argument was: #{$span}";
|
211
207
|
} @else {
|
212
208
|
|
213
209
|
@for $i from 1 through length($flint__all__keys) {
|
@@ -280,7 +276,7 @@
|
|
280
276
|
// @param $context [null] : context value of span
|
281
277
|
// -------------------------------------------------------------------------------
|
282
278
|
// @output calculated styles
|
283
|
-
} @else if flint-
|
279
|
+
} @else if flint-is-string($key) and flint-is-number($span) and $context == null
|
284
280
|
|
285
281
|
// Call by alias with context
|
286
282
|
// -------------------------------------------------------------------------------
|
@@ -289,14 +285,12 @@
|
|
289
285
|
// @param $context [number | string] : context value of span
|
290
286
|
// -------------------------------------------------------------------------------
|
291
287
|
// @output calculated styles
|
292
|
-
or flint-
|
293
|
-
or flint-
|
288
|
+
or flint-is-string($key) and flint-is-number($span) and flint-is-number($context)
|
289
|
+
or flint-is-string($key) and flint-is-number($span) and $context == "auto" {
|
294
290
|
|
295
291
|
// Emit warning for invalid argument lengths
|
296
|
-
@if not
|
297
|
-
@warn "Invalid argument
|
298
|
-
} @else if not length($context) == 1 {
|
299
|
-
@warn "Invalid argument length for context: #{length($context)}. Please provide a single argument for your breakpoint. Your argument was: #{$context}";
|
292
|
+
@if not flint-exists($flint, $key) {
|
293
|
+
@warn "Invalid argument: #{$key}. Breakpoint does not exist. Please provide a valid argument.";
|
300
294
|
} @else {
|
301
295
|
|
302
296
|
$calc-key: $key;
|
@@ -361,7 +355,7 @@
|
|
361
355
|
|
362
356
|
// Wrap @content in media queries
|
363
357
|
// -------------------------------------------------------------------------------
|
364
|
-
// @param $key [list] : defines how to make up media query
|
358
|
+
// @param $key [string | list] : defines how to make up media query
|
365
359
|
// -------------------------------------------------------------------------------
|
366
360
|
// @output styles wrapped in media query
|
367
361
|
} @else if flint-exists($flint, $key) and $span == null and $context == null
|
@@ -399,7 +393,7 @@
|
|
399
393
|
|
400
394
|
// From $key breakpoint to infinity
|
401
395
|
// -------------------------------------------------------------------------------
|
402
|
-
// @param $key [from key to infinity] : min-width from $key breakpoint
|
396
|
+
// @param $key [list : from key to infinity] : min-width from $key breakpoint
|
403
397
|
// -------------------------------------------------------------------------------
|
404
398
|
} @else if flint-types-in-list($key, "string", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" and nth($key, 4) == "infinity" {
|
405
399
|
|
@@ -417,7 +411,7 @@
|
|
417
411
|
|
418
412
|
// From $key-x breakpoint to $key-y breakpoint
|
419
413
|
// -------------------------------------------------------------------------------
|
420
|
-
// @param $key [from key-x to key-y] : from $key-x breakpoint to $key-y
|
414
|
+
// @param $key [list : from key-x to key-y] : from $key-x breakpoint to $key-y
|
421
415
|
// -------------------------------------------------------------------------------
|
422
416
|
} @else if flint-types-in-list($key, "string", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" {
|
423
417
|
|
@@ -435,7 +429,7 @@
|
|
435
429
|
|
436
430
|
// From $num-x to $num-y
|
437
431
|
// -------------------------------------------------------------------------------
|
438
|
-
// @param $key [from number to number] : arbitrary media query
|
432
|
+
// @param $key [list : from number to number] : arbitrary media query
|
439
433
|
// -------------------------------------------------------------------------------
|
440
434
|
} @else if flint-types-in-list($key, "string" "number" "string" "number", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" {
|
441
435
|
// Make sure passed units match units used in config
|
@@ -450,7 +444,7 @@
|
|
450
444
|
|
451
445
|
// Greater than $key breakpoint
|
452
446
|
// -------------------------------------------------------------------------------
|
453
|
-
// @param $key [greater than key] : anything above $key breakpoint
|
447
|
+
// @param $key [list : greater than key] : anything above $key breakpoint
|
454
448
|
// -------------------------------------------------------------------------------
|
455
449
|
} @else if flint-types-in-list($key, "string", 3) and nth($key, 1) == "greater" and nth($key, 2) == "than" {
|
456
450
|
|
@@ -468,7 +462,7 @@
|
|
468
462
|
|
469
463
|
// Greater than number
|
470
464
|
// -------------------------------------------------------------------------------
|
471
|
-
// @param $key [greater than number] : anything above number
|
465
|
+
// @param $key [list : greater than number] : anything above number
|
472
466
|
// -------------------------------------------------------------------------------
|
473
467
|
} @else if flint-types-in-list($key, "string" "string" "number", 3) and nth($key, 1) == "greater" and nth($key, 2) == "than" {
|
474
468
|
|
@@ -482,7 +476,7 @@
|
|
482
476
|
|
483
477
|
// Number greater than $key breakpoint
|
484
478
|
// -------------------------------------------------------------------------------
|
485
|
-
// @param $key [number greater than key] : unit value greater than $key breakpoint
|
479
|
+
// @param $key [list : number greater than key] : unit value greater than $key breakpoint
|
486
480
|
// -------------------------------------------------------------------------------
|
487
481
|
} @else if flint-types-in-list($key, "number" "string" "string" "string", 4) and nth($key, 2) == "greater" and nth($key, 3) == "than" {
|
488
482
|
|
@@ -496,7 +490,7 @@
|
|
496
490
|
|
497
491
|
// Less than $key breakpoint
|
498
492
|
// -------------------------------------------------------------------------------
|
499
|
-
// @param $key [less than key] : anything below $key breakpoint
|
493
|
+
// @param $key [list : less than key] : anything below $key breakpoint
|
500
494
|
// -------------------------------------------------------------------------------
|
501
495
|
} @else if flint-types-in-list($key, "string", 3) and nth($key, 1) == "less" and nth($key, 2) == "than" {
|
502
496
|
|
@@ -514,7 +508,7 @@
|
|
514
508
|
|
515
509
|
// Less than number
|
516
510
|
// -------------------------------------------------------------------------------
|
517
|
-
// @param $key [less than number] : anything below number
|
511
|
+
// @param $key [list : less than number] : anything below number
|
518
512
|
// -------------------------------------------------------------------------------
|
519
513
|
} @else if flint-types-in-list($key, "string" "string" "number", 3) and nth($key, 1) == "less" and nth($key, 2) == "than" {
|
520
514
|
|
@@ -528,7 +522,7 @@
|
|
528
522
|
|
529
523
|
// Number less than $key breakpoint
|
530
524
|
// -------------------------------------------------------------------------------
|
531
|
-
// @param $key [number less than key] : unit value less than $key breakpoint
|
525
|
+
// @param $key [list : number less than key] : unit value less than $key breakpoint
|
532
526
|
// -------------------------------------------------------------------------------
|
533
527
|
} @else if flint-types-in-list($key, "number" "string" "string" "string", 4) and nth($key, 2) == "less" and nth($key, 3) == "than" {
|
534
528
|
|
@@ -542,7 +536,7 @@
|
|
542
536
|
|
543
537
|
// For $key-x $key-y $key-z
|
544
538
|
// -------------------------------------------------------------------------------
|
545
|
-
// @param $key [for list of
|
539
|
+
// @param $key [list : for list of keys] : comma delimited list of queries
|
546
540
|
// -------------------------------------------------------------------------------
|
547
541
|
} @else if flint-types-in-list($key, "string") and nth($key, 1) == "for" {
|
548
542
|
// Define empty query list
|
@@ -580,6 +574,13 @@
|
|
580
574
|
@content;
|
581
575
|
}
|
582
576
|
}
|
577
|
+
|
578
|
+
// Invalid argument
|
579
|
+
// -------------------------------------------------------------------------------
|
580
|
+
// @throw : invalid argument warning
|
581
|
+
// -------------------------------------------------------------------------------
|
582
|
+
} @else {
|
583
|
+
@warn "Invalid argument(s). Please double check and provide a valid argument. If you're calling by alias, please provide a single span argument for your breakpoint. See documentation for additional details.";
|
583
584
|
}
|
584
585
|
}
|
585
586
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flint-gs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.3.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: compass
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.12.1
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.12.1
|
41
27
|
description: Flint is designed to be a flexible layout toolkit that developers can
|
42
28
|
use for any responsive grid-based project.
|
43
29
|
email:
|