flint-gs 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adefc77ec25fe16ff919991e24879bc0f4dc759f
4
- data.tar.gz: 14f25ce075162d8c41598646bbba8758325c66df
3
+ metadata.gz: 301e82276044ec3edab3bfb8e4f8bbfce2d51ecf
4
+ data.tar.gz: 4b4d85d4177a1a226030b7ff06c93e881c39fbef
5
5
  SHA512:
6
- metadata.gz: 0651467cea2967bfb00279911a5bd7931160764ae0016e3d39021f8370a4932497ef33961dd331cc387f6c0600fbc0ac711bb4737b0559bfbac2498c331dc7e5
7
- data.tar.gz: caa94185ced8f076b0a8c7c80d6d39e72a3840aedc5cf1de42eebe8f948f4ea6760586a27ad3fbdb0efdbfce83ede28e1785ddf159bb6343666fc90cb63832b7
6
+ metadata.gz: d0930c264816cf32f4b27380ed421613b18dc4b35f9cff3d417040f057b812a38bfb2bed5b4fcd28562ac6a4e7acdcfb3015c36cea01532a8d59806418c83fa8
7
+ data.tar.gz: 54060b0c7d3943a359438e42f79819d672f398efa2711961079431f2087590238a3a0eb1e4cfe9f9c60d82bb3a70012542e4ef4e7c49c803135be783134d93c0
data/README.md CHANGED
@@ -10,15 +10,15 @@ Enjoy.
10
10
 
11
11
  ###Installation
12
12
 
13
- [1] `gem install flint-gs`
14
- [2] Add `require "flint"` to your `config.rb`
15
- [3] Import it in your stylesheets with `@import "flint";`
13
+ 1. `gem install flint-gs`
14
+ 2. Add `require "flint"` to your `config.rb`
15
+ 3. Import it in your stylesheets with `@import "flint";`
16
16
 
17
17
  If you don't want to install the gem, download/clone the current build files and 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 'script `&`' [returns to Sass](https://gist.github.com/nex3/8050187). Adjust the paths according to your project.
18
18
 
19
19
  ###Config
20
20
 
21
- Flint's `config map` is unique in the ability that you may define an unlimited number of breakpoints for your project. Whether that be 2 breakpoints, or even 12. You're in full control of your columns as well. Also, unlike most frameworks, you may name these anything that you like. Flint is smart and will figure out which one you're talking about.
21
+ Flint's `config map` is unique in the ability that you may define an unlimited number of breakpoints for your project. Whether that be 2 breakpoints, or even 12. You're in full control of your columns as well. Also, unlike most frameworks, you may name these anything that you like. Flint is smart and will figure out which one you're talking about. To begin, you can either use the default config (below) which comes baked in, or you can define your own using the `$flint` variable using the template below.
22
22
 
23
23
  Settings may be entered in `px` or `em`, and Flint will do the rest.
24
24
 
@@ -138,34 +138,34 @@ Outputs, *(with debug mode on)*
138
138
  width: 17.1875%;
139
139
  margin-right: 0.78125%;
140
140
  margin-left: 0.78125%;
141
- -flint-instance-count: 1;
142
- -flint-key: desktop;
143
- -flint-breakpoint: 1280px;
144
- -flint-columns: 16;
145
- -flint-span: 3;
146
- -flint-context: NULL;
147
- -flint-gutter: NULL;
148
- -flint-shift: NULL;
149
- -flint-output-width: 17.1875%;
150
- -flint-output-margin-right: 0.78125%;
151
- -flint-output-margin-left: 0.78125%;
141
+ -flint--instance-count: 1;
142
+ -flint--key: desktop;
143
+ -flint--breakpoint: 1280px;
144
+ -flint--columns: 16;
145
+ -flint--span: 3;
146
+ -flint--context: NULL;
147
+ -flint--gutter: NULL;
148
+ -flint--shift: NULL;
149
+ -flint--output-width: 17.1875%;
150
+ -flint--output-margin-right: 0.78125%;
151
+ -flint--output-margin-left: 0.78125%;
152
152
  }
153
153
  @media only screen and (min-width: 641px) and (max-width: 960px) {
154
154
  .recursive {
155
155
  width: 22.91667%;
156
156
  margin-right: 1.04167%;
157
157
  margin-left: 1.04167%;
158
- -flint-instance-count: 2;
159
- -flint-key: laptop;
160
- -flint-breakpoint: 960px;
161
- -flint-columns: 12;
162
- -flint-span: 3;
163
- -flint-context: NULL;
164
- -flint-gutter: NULL;
165
- -flint-shift: NULL;
166
- -flint-output-width: 22.91667%;
167
- -flint-output-margin-right: 1.04167%;
168
- -flint-output-margin-left: 1.04167%;
158
+ -flint--instance-count: 2;
159
+ -flint--key: laptop;
160
+ -flint--breakpoint: 960px;
161
+ -flint--columns: 12;
162
+ -flint--span: 3;
163
+ -flint--context: NULL;
164
+ -flint--gutter: NULL;
165
+ -flint--shift: NULL;
166
+ -flint--output-width: 22.91667%;
167
+ -flint--output-margin-right: 1.04167%;
168
+ -flint--output-margin-left: 1.04167%;
169
169
  }
170
170
  }
171
171
  @media only screen and (min-width: 321px) and (max-width: 640px) {
@@ -173,17 +173,17 @@ Outputs, *(with debug mode on)*
173
173
  width: 34.375%;
174
174
  margin-right: 1.5625%;
175
175
  margin-left: 1.5625%;
176
- -flint-instance-count: 3;
177
- -flint-key: tablet;
178
- -flint-breakpoint: 640px;
179
- -flint-columns: 8;
180
- -flint-span: 3;
181
- -flint-context: NULL;
182
- -flint-gutter: NULL;
183
- -flint-shift: NULL;
184
- -flint-output-width: 34.375%;
185
- -flint-output-margin-right: 1.5625%;
186
- -flint-output-margin-left: 1.5625%;
176
+ -flint--instance-count: 3;
177
+ -flint--key: tablet;
178
+ -flint--breakpoint: 640px;
179
+ -flint--columns: 8;
180
+ -flint--span: 3;
181
+ -flint--context: NULL;
182
+ -flint--gutter: NULL;
183
+ -flint--shift: NULL;
184
+ -flint--output-width: 34.375%;
185
+ -flint--output-margin-right: 1.5625%;
186
+ -flint--output-margin-left: 1.5625%;
187
187
  }
188
188
  }
189
189
  @media only screen and (min-width: 0) and (max-width: 320px) {
@@ -191,17 +191,17 @@ Outputs, *(with debug mode on)*
191
191
  width: 68.75%;
192
192
  margin-right: 3.125%;
193
193
  margin-left: 3.125%;
194
- -flint-instance-count: 4;
195
- -flint-key: mobile;
196
- -flint-breakpoint: 320px;
197
- -flint-columns: 4;
198
- -flint-span: 3;
199
- -flint-context: NULL;
200
- -flint-gutter: NULL;
201
- -flint-shift: NULL;
202
- -flint-output-width: 68.75%;
203
- -flint-output-margin-right: 3.125%;
204
- -flint-output-margin-left: 3.125%;
194
+ -flint--instance-count: 4;
195
+ -flint--key: mobile;
196
+ -flint--breakpoint: 320px;
197
+ -flint--columns: 4;
198
+ -flint--span: 3;
199
+ -flint--context: NULL;
200
+ -flint--gutter: NULL;
201
+ -flint--shift: NULL;
202
+ -flint--output-width: 68.75%;
203
+ -flint--output-margin-right: 3.125%;
204
+ -flint--output-margin-left: 3.125%;
205
205
  }
206
206
  }
207
207
  ```
data/lib/flint.rb CHANGED
@@ -5,7 +5,7 @@ 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.0.2"
8
+ VERSION = "1.0.3"
9
9
  DATE = "2014-04-21"
10
10
  end
11
11
 
@@ -27,7 +27,7 @@ $flint: (
27
27
  "max-width": false, // [true : uses highest breakpoint | false | value(unit)]
28
28
  "center-container": true, // [true | false]
29
29
  "border-box-sizing": true, // [true | false]
30
- "debug-mode": true, // [true | false]
30
+ "debug-mode": true, // [true | false ]
31
31
  ),
32
32
  ),
33
33
  ) !default;
@@ -21,6 +21,6 @@
21
21
  @import "lib/purge";
22
22
  @import "lib/replace";
23
23
  @import "lib/remove";
24
- @import "lib/family-instance-exists";
24
+ @import "lib/get-family-instance";
25
25
  @import "lib/get-instance-value";
26
26
  @import "lib/string-to-number";
@@ -1,3 +1,13 @@
1
+ // Returns truthiness of a value
2
+ // -------------------------------------------------------------------------------
3
+ // @param $value [Literal] : value
4
+ // -------------------------------------------------------------------------------
5
+ // @return [Boolean]
6
+
7
+ @function is-true($value) {
8
+ @return if($value == null, false, $value and $value != null and $value != "" and $value != ());
9
+ }
10
+
1
11
  // Checks if item is map
2
12
  //--------------------------------------------------------------------------------
3
13
  // @param $n [Value] : value
@@ -129,14 +139,4 @@
129
139
  }
130
140
  }
131
141
  } @return $all-columns;
132
- }
133
-
134
- // Returns truthiness of a value
135
- // -------------------------------------------------------------------------------
136
- // @param $value [Literal] : value
137
- // -------------------------------------------------------------------------------
138
- // @return [Boolean]
139
-
140
- @function is-true($value) {
141
- @return if($value == null, false, $value and $value != null and $value != "" and $value != ());
142
142
  }
@@ -11,7 +11,7 @@
11
11
  // -------------------------------------------------------------------------------
12
12
  // @return [Selectors] | false
13
13
 
14
- @function family-instance-exists($key: get-value(settings, default)) {
14
+ @function get-family-instance($key: get-value(settings, default)) {
15
15
  $selector-string: selector_string();
16
16
  $selector-list: string-to-list($selector-string);
17
17
  $length: length($selector-list);
@@ -12,8 +12,8 @@
12
12
 
13
13
  @function get-instance-value($key, $value, $deep: NULL) {
14
14
  @if $deep == NULL {
15
- @return map-fetch($flint__instances, family-instance-exists($key) $value);
15
+ @return map-fetch($flint__instances, get-family-instance($key) $value);
16
16
  } @else {
17
- @return map-fetch($flint__instances, family-instance-exists($key) $value $deep);
17
+ @return map-fetch($flint__instances, get-family-instance($key) $value $deep);
18
18
  }
19
19
  }
@@ -1,14 +1,14 @@
1
1
  // Turns string into a flat list
2
2
  // -------------------------------------------------------------------------------
3
3
  // @param $string [String] : string
4
+ // @param $find [Separator] : item to find which separates substrings (default is single space [" "])
4
5
  // -------------------------------------------------------------------------------
5
6
  // @return [List] | error
6
7
 
7
- @function string-to-list($string) {
8
+ @function string-to-list($string, $find: " ") {
8
9
  @if is-string($string) {
9
10
  $string-list: ();
10
11
  $space-indexes: ();
11
- $find: " ";
12
12
  $length: str-length($string);
13
13
  // Find all spaces and their indices by looking over each character in string
14
14
  @for $i from 1 through $length {
@@ -9,7 +9,6 @@
9
9
  // -------------------------------------------------------------------------------
10
10
  // @output [Styles...]
11
11
 
12
- // Calculates width and margins based on passed arguments
13
12
  @mixin calcFlint ($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $i: NULL) {
14
13
 
15
14
  @if $i != NULL {
@@ -110,13 +109,13 @@
110
109
 
111
110
  } @else if $calcContext != NULL {
112
111
  // Check if context of parent instance exists
113
- $exists: family-instance-exists($calcKey);
112
+ $exists: get-family-instance($calcKey);
114
113
 
115
114
  @if $calcShift != NULL {
116
115
  @if $calcGutter == NULL and get-value(settings, gutter) != false {
117
116
  // Check if context is set to auto
118
117
  @if $calcContext == "auto" {
119
- // Did it exist?
118
+ // Does parent exist?
120
119
  @if $exists != false {
121
120
 
122
121
  $outputWidth: (calc-width($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span)))) - ((calc-margin($calcKey, $calcSpan, to-number(get-instance-value($calcKey, span))))*2);
@@ -15,13 +15,11 @@
15
15
  @if $key == "foundation" {
16
16
 
17
17
  // apply global border-box-sizing if true
18
-
19
18
  @if get-value(settings, border-box-sizing) == true {
20
19
  $foundation: "existant" !global;
21
20
  }
22
21
 
23
22
  // foundation is now globally existant
24
-
25
23
  @if $foundation == "existant" {
26
24
  @at-root *, *:before, *:after {
27
25
  -moz-box-sizing: border-box;
@@ -45,7 +43,6 @@
45
43
  {
46
44
 
47
45
  // only apply display rule if the key is the default
48
-
49
46
  @if $key == get-value(settings, default) or $key == "container" {
50
47
 
51
48
  display: block;
@@ -62,25 +59,21 @@
62
59
  }
63
60
 
64
61
  // apply individually if foundation is not set globally, but is set to true in config
65
-
66
62
  @if get-value(settings, border-box-sizing) == true and $foundation == "nonexistant" {
67
63
  -moz-box-sizing: border-box;
68
64
  -webkit-box-sizing: border-box;
69
65
  box-sizing: border-box;
70
66
 
71
67
  // warn to either set a global foundation, or turn border-box-sizing off
72
-
73
68
  @if global-variable-exists(global-foundation-is-set) == false {
74
69
  @warn "Global foundation is #{$foundation}. To avoid repeated box-sizing incidents, set a global flint(foundation) rule, or turn border-box-sizing to false in your config file.";
75
70
 
76
71
  // declare global variable so only a single warning prints out
77
-
78
72
  $global-foundation-is-set: true !global;
79
73
  }
80
74
  }
81
75
 
82
76
  // check if max-width is set
83
-
84
77
  @if get-value(settings, max-width) == true {
85
78
  max-width: max(get-all-breakpoints()...);
86
79
  } @else if type-of(get-value(settings, max-width)) == number {
@@ -88,7 +81,6 @@
88
81
  }
89
82
 
90
83
  // check if center container is set to true
91
-
92
84
  @if $key == "container" {
93
85
  float: none;
94
86
 
@@ -437,7 +429,6 @@
437
429
  } @else if exists($flint, $key) and $span == NULL and $context == NULL or length($key) > 1 {
438
430
 
439
431
  // only key-x breakpoint
440
-
441
432
  @if length($key) == 1 {
442
433
 
443
434
  @if is-highest-breakpoint($key) == true {
@@ -450,22 +441,19 @@
450
441
  }
451
442
  }
452
443
 
453
- // from key breakpoint to infinity
454
-
444
+ // from key breakpoint to infinity
455
445
  } @else if length($key) > 1 and nth($key, 1) == "from" and nth($key, 3) == "to" and nth($key, 4) == "infinity" {
456
446
  @media only screen and ( min-width: calc-breakpoint(from, nth($key, 2), get-index(nth($key, 2))) ) {
457
447
  @content;
458
448
  }
459
449
 
460
- // from key-x breakpoint to key-y breakpoint
461
-
450
+ // from key-x breakpoint to key-y breakpoint
462
451
  } @else if length($key) > 1 and nth($key, 1) == "from" and nth($key, 3) == "to" {
463
452
  @media only screen and ( min-width: calc-breakpoint(from, nth($key, 2), get-index(nth($key, 2))) ) and ( max-width: calc-breakpoint(to, nth($key, 4), get-index(nth($key, 4))) ) {
464
453
  @content;
465
454
  }
466
455
 
467
- // greater than key-x breakpoint
468
-
456
+ // greater than key-x breakpoint
469
457
  } @else if length($key) > 1 and nth($key, 1) == "greater" and nth($key, 2) == "than" {
470
458
  @if get-value(settings, grid) == "fluid" {
471
459
  @media only screen and ( min-width: (calc-breakpoint(to, nth($key, 3), get-index(nth($key, 3))) + 1) ) {
@@ -477,15 +465,13 @@
477
465
  }
478
466
  }
479
467
 
480
- // (y)px greater than key-x breakpoint
481
-
468
+ // (y)px greater than key-x breakpoint
482
469
  } @else if length($key) > 1 and nth($key, 2) == "greater" and nth($key, 3) == "than" {
483
470
  @media only screen and ( min-width: (calc-breakpoint(to, nth($key, 4), get-index(nth($key, 4))) + nth($key, 1)) ) {
484
471
  @content;
485
472
  }
486
473
 
487
- // less than key-x breakpoint
488
-
474
+ // less than key-x breakpoint
489
475
  } @else if length($key) > 1 and nth($key, 1) == "less" and nth($key, 2) == "than" {
490
476
  @if get-value(settings, grid) == "fluid" {
491
477
  @media only screen and ( max-width: (calc-breakpoint(to, nth($key, 3), get-index(nth($key, 3))) - 1) ) {
@@ -497,15 +483,13 @@
497
483
  }
498
484
  }
499
485
 
500
- // (y)px less than key-x breakpoint
501
-
486
+ // (y)px less than key-x breakpoint
502
487
  } @else if length($key) > 1 and nth($key, 2) == "less" and nth($key, 3) == "than" {
503
488
  @media only screen and ( max-width: (calc-breakpoint(to, nth($key, 4), get-index(nth($key, 4))) - nth($key, 1)) ) {
504
489
  @content;
505
490
  }
506
491
 
507
- // for key-x key-y key-z
508
-
492
+ // for key-x key-y key-z
509
493
  } @else if length($key) > 1 and nth($key, 1) == "for" {
510
494
  @for $i from 1 through length($key) {
511
495
  @if exists($flint, nth($key, $i)) {
@@ -25,7 +25,7 @@
25
25
  @each $property, $value in $instance {
26
26
 
27
27
  // Check if value is output map
28
- @if is_map($value) {
28
+ @if is-map($value) {
29
29
  @each $mod_property, $mod_value in $value {
30
30
  -flint--output-#{$mod_property}: #{$mod_value};
31
31
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flint-gs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse
@@ -59,8 +59,8 @@ files:
59
59
  - stylesheets/flint/functions/lib/_calc-margin.scss
60
60
  - stylesheets/flint/functions/lib/_calc-width.scss
61
61
  - stylesheets/flint/functions/lib/_exists.scss
62
- - stylesheets/flint/functions/lib/_family-instance-exists.scss
63
62
  - stylesheets/flint/functions/lib/_fluid-width.scss
63
+ - stylesheets/flint/functions/lib/_get-family-instance.scss
64
64
  - stylesheets/flint/functions/lib/_get-index.scss
65
65
  - stylesheets/flint/functions/lib/_get-instance-value.scss
66
66
  - stylesheets/flint/functions/lib/_get-substring.scss