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 +4 -4
- data/README.md +48 -48
- data/lib/flint.rb +1 -1
- data/stylesheets/flint/config/_config.scss +1 -1
- data/stylesheets/flint/functions/_functions.scss +1 -1
- data/stylesheets/flint/functions/helpers/_helpers.scss +10 -10
- data/stylesheets/flint/functions/lib/{_family-instance-exists.scss → _get-family-instance.scss} +1 -1
- data/stylesheets/flint/functions/lib/_get-instance-value.scss +2 -2
- data/stylesheets/flint/functions/lib/_string-to-list.scss +2 -2
- data/stylesheets/flint/mixins/lib/_flint-calculate.scss +2 -3
- data/stylesheets/flint/mixins/lib/_flint-main.scss +7 -23
- data/stylesheets/flint/mixins/lib/_print-instance.scss +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 301e82276044ec3edab3bfb8e4f8bbfce2d51ecf
|
4
|
+
data.tar.gz: 4b4d85d4177a1a226030b7ff06c93e881c39fbef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
14
|
-
|
15
|
-
|
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
|
142
|
-
-flint
|
143
|
-
-flint
|
144
|
-
-flint
|
145
|
-
-flint
|
146
|
-
-flint
|
147
|
-
-flint
|
148
|
-
-flint
|
149
|
-
-flint
|
150
|
-
-flint
|
151
|
-
-flint
|
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
|
159
|
-
-flint
|
160
|
-
-flint
|
161
|
-
-flint
|
162
|
-
-flint
|
163
|
-
-flint
|
164
|
-
-flint
|
165
|
-
-flint
|
166
|
-
-flint
|
167
|
-
-flint
|
168
|
-
-flint
|
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
|
177
|
-
-flint
|
178
|
-
-flint
|
179
|
-
-flint
|
180
|
-
-flint
|
181
|
-
-flint
|
182
|
-
-flint
|
183
|
-
-flint
|
184
|
-
-flint
|
185
|
-
-flint
|
186
|
-
-flint
|
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
|
195
|
-
-flint
|
196
|
-
-flint
|
197
|
-
-flint
|
198
|
-
-flint
|
199
|
-
-flint
|
200
|
-
-flint
|
201
|
-
-flint
|
202
|
-
-flint
|
203
|
-
-flint
|
204
|
-
-flint
|
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.
|
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;
|
@@ -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
|
}
|
data/stylesheets/flint/functions/lib/{_family-instance-exists.scss → _get-family-instance.scss}
RENAMED
@@ -11,7 +11,7 @@
|
|
11
11
|
// -------------------------------------------------------------------------------
|
12
12
|
// @return [Selectors] | false
|
13
13
|
|
14
|
-
@function family-instance
|
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
|
15
|
+
@return map-fetch($flint__instances, get-family-instance($key) $value);
|
16
16
|
} @else {
|
17
|
-
@return map-fetch($flint__instances, family-instance
|
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
|
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
|
-
//
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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)) {
|
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.
|
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
|