flint-gs 2.0.6 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -11
- data/lib/flint/version.rb +1 -1
- data/stylesheets/_flint.scss +3 -3
- data/stylesheets/flint/config/_config.scss +24 -24
- data/stylesheets/flint/functions/_functions.scss +9 -9
- data/stylesheets/flint/functions/helpers/_helpers.scss +138 -138
- data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +13 -13
- data/stylesheets/flint/functions/lib/_calc-width.scss +17 -17
- data/stylesheets/flint/functions/lib/_exists.scss +12 -12
- data/stylesheets/flint/functions/lib/_fluid-width.scss +12 -12
- data/stylesheets/flint/functions/lib/_get-index.scss +11 -11
- data/stylesheets/flint/functions/lib/_get-instance-value.scss +12 -12
- data/stylesheets/flint/functions/lib/_get-value.scss +11 -11
- data/stylesheets/flint/functions/lib/_has-family-instance.scss +12 -12
- data/stylesheets/flint/functions/lib/_instance.scss +17 -17
- data/stylesheets/flint/functions/lib/_last.scss +11 -11
- data/stylesheets/flint/functions/lib/_list-to-string.scss +15 -15
- data/stylesheets/flint/functions/lib/_map-fetch.scss +12 -12
- data/stylesheets/flint/functions/lib/_next-index.scss +11 -11
- data/stylesheets/flint/functions/lib/_purge.scss +13 -13
- data/stylesheets/flint/functions/lib/_remove.scss +15 -15
- data/stylesheets/flint/functions/lib/_replace-substring.scss +13 -13
- data/stylesheets/flint/functions/lib/_replace.scss +15 -15
- data/stylesheets/flint/functions/lib/_steal-key.scss +11 -11
- data/stylesheets/flint/functions/lib/_steal-values.scss +12 -12
- data/stylesheets/flint/functions/lib/_string-to-list.scss +13 -13
- data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +11 -11
- data/stylesheets/flint/functions/lib/_support-syntax.scss +12 -12
- data/stylesheets/flint/functions/lib/_types-in-list.scss +13 -13
- data/stylesheets/flint/functions/lib/_use-syntax.scss +11 -11
- data/stylesheets/flint/globals/_globals.scss +80 -80
- data/stylesheets/flint/mixins/_mixins.scss +3 -3
- data/stylesheets/flint/mixins/lib/_box-sizing.scss +11 -11
- data/stylesheets/flint/mixins/lib/_calculate.scss +45 -45
- data/stylesheets/flint/mixins/lib/_clearfix.scss +11 -11
- data/stylesheets/flint/mixins/lib/_container.scss +10 -10
- data/stylesheets/flint/mixins/lib/_main.scss +511 -511
- data/stylesheets/flint/mixins/lib/_new-instance.scss +15 -15
- data/stylesheets/flint/mixins/lib/_print-instance.scss +17 -17
- data/tests/bootcamp/_bootcamp.scss +0 -0
- data/tests/bootcamp/bootcamp.coffee +101 -0
- data/tests/bootcamp/core/functions/_actual.scss +0 -0
- data/tests/bootcamp/core/functions/_error.scss +0 -0
- data/tests/bootcamp/core/functions/_expect.scss +0 -0
- data/tests/bootcamp/core/functions/_not-to.scss +0 -0
- data/tests/bootcamp/core/functions/_should.scss +0 -0
- data/tests/bootcamp/core/functions/_to.scss +0 -0
- data/tests/bootcamp/core/mixins/_describe.scss +0 -0
- data/tests/bootcamp/core/mixins/_it.scss +0 -0
- data/tests/bootcamp/core/mixins/_runner.scss +0 -0
- data/tests/bootcamp/core/mixins/_should.scss +0 -0
- data/tests/bootcamp/core/mixins/_xdescribe.scss +0 -0
- data/tests/bootcamp/core/mixins/_xit.scss +0 -0
- data/tests/bootcamp/core/variables/_helpers.scss +0 -0
- data/tests/bootcamp/core/variables/_settings.scss +0 -0
- data/tests/bootcamp/core/variables/_should.scss +0 -0
- data/tests/bootcamp/core/variables/_trackers.scss +0 -0
- data/tests/bootcamp/lib/_sassyjson.scss +0 -0
- data/tests/bootcamp/matchers/_be.scss +0 -0
- data/tests/bootcamp/matchers/_equal.scss +0 -0
- data/tests/bootcamp/matchers/lists/_be-empty.scss +0 -0
- data/tests/bootcamp/matchers/lists/_be-longer-than.scss +0 -0
- data/tests/bootcamp/matchers/lists/_be-shorter-than.scss +0 -0
- data/tests/bootcamp/matchers/lists/_contain.scss +0 -0
- data/tests/bootcamp/matchers/lists/_deep-contain.scss +0 -0
- data/tests/bootcamp/matchers/lists/_deep-equal.scss +0 -0
- data/tests/bootcamp/matchers/lists/_have-length-of.scss +0 -0
- data/tests/bootcamp/matchers/numbers/_be-close-to.scss +0 -0
- data/tests/bootcamp/matchers/numbers/_be-greater-than.scss +0 -0
- data/tests/bootcamp/matchers/numbers/_be-less-than.scss +0 -0
- data/tests/bootcamp/matchers/types/_be-falsy.scss +0 -0
- data/tests/bootcamp/matchers/types/_be-null.scss +0 -0
- data/tests/bootcamp/matchers/types/_be-truthy.scss +0 -0
- data/tests/bootcamp/matchers/types/_have-type-of.scss +0 -0
- data/tests/bootcamp/utils/_contain.scss +0 -0
- data/tests/bootcamp/utils/_equal.scss +0 -0
- data/tests/bootcamp/utils/_list-join.scss +0 -0
- data/tests/bootcamp/utils/_power.scss +0 -0
- data/tests/input/functions/_functions.scss +9 -9
- data/tests/input/functions/helpers/_helpers.scss +45 -45
- data/tests/input/functions/lib/_calc-breakpoint.scss +3 -3
- data/tests/input/functions/lib/_calc-width.scss +3 -3
- data/tests/input/functions/lib/_exists.scss +3 -3
- data/tests/input/functions/lib/_fluid-width.scss +3 -3
- data/tests/input/functions/lib/_get-index.scss +3 -3
- data/tests/input/functions/lib/_get-instance-value.scss +3 -3
- data/tests/input/functions/lib/_get-value.scss +3 -3
- data/tests/input/functions/lib/_has-family-instance.scss +3 -3
- data/tests/input/functions/lib/_instance.scss +3 -3
- data/tests/input/functions/lib/_last.scss +3 -3
- data/tests/input/functions/lib/_list-to-string.scss +3 -3
- data/tests/input/functions/lib/_map-fetch.scss +3 -3
- data/tests/input/functions/lib/_next-index.scss +3 -3
- data/tests/input/functions/lib/_purge.scss +3 -3
- data/tests/input/functions/lib/_remove.scss +3 -3
- data/tests/input/functions/lib/_replace-substring.scss +3 -3
- data/tests/input/functions/lib/_replace.scss +3 -3
- data/tests/input/functions/lib/_steal-key.scss +3 -3
- data/tests/input/functions/lib/_steal-values.scss +3 -3
- data/tests/input/functions/lib/_string-to-list.scss +3 -3
- data/tests/input/functions/lib/_support-syntax-bem.scss +3 -3
- data/tests/input/functions/lib/_support-syntax.scss +3 -3
- data/tests/input/functions/lib/_types-in-list.scss +3 -3
- data/tests/input/functions/lib/_use-syntax.scss +3 -3
- data/tests/input/output.scss +22 -22
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dad60492a22ed4c6e68d63a1259ac3f202d051db
|
4
|
+
data.tar.gz: ea0753745e39f131ca86ea433cc04b0ed698e752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8673ea60dcf096602b1ead2c718ad6c042c2430867c6ed42620f844919f31ec10422f48421daaf46dd5a27b051775bb18d15e28840b3833abd04bf1d7eb54575
|
7
|
+
data.tar.gz: f2ad842af93ad65c1ab72c0b706a3d7461b1d7eefc9386253a8dd424ed1ea8f7ceef8480657ce2c0b07e94987830879f8efc237695fa3092ab3ea3232307d7b2
|
data/README.md
CHANGED
@@ -43,6 +43,8 @@ scss --require ./lib/flint.rb example.scss > example.css
|
|
43
43
|
|
44
44
|
Documentation is located [here](http://flint.gs/docs).
|
45
45
|
|
46
|
+
_Tip: For simple projects, disable `instance-maps`, as it is has a large overhead and will increase your compile times._
|
47
|
+
|
46
48
|
## Syntax support
|
47
49
|
|
48
50
|
As of `1.6.0`, you can add syntax support for your preferred syntax. I built the system for BEM, but it should be easily extendable to
|
@@ -50,17 +52,17 @@ support your preferred syntax. Simply create a function which parses a string of
|
|
50
52
|
function parses the selector string (for example, `.block__element__element`) like so,
|
51
53
|
|
52
54
|
```scss
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
55
|
+
///
|
56
|
+
/// Parser to support BEM syntax
|
57
|
+
///
|
58
|
+
/// @access private
|
59
|
+
///
|
60
|
+
/// @param {List} $selectors - string of selectors to parse
|
61
|
+
///
|
62
|
+
/// @return {List} - parsed list of selectors according to syntax
|
63
|
+
///
|
64
|
+
/// @group Internal Functions
|
65
|
+
///
|
64
66
|
@function flint-support-syntax-bem($selectors) {
|
65
67
|
// Clean up selector, remove double underscores for spaces
|
66
68
|
// add pseudo character to differentiate selectors
|
data/lib/flint/version.rb
CHANGED
data/stylesheets/_flint.scss
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
///
|
2
|
+
/// Configuration map
|
3
|
+
///
|
4
|
+
/// @type Map
|
5
|
+
///
|
6
|
+
/// @prop {Map} breakpoints - map of breakpoints, follow DSC order
|
7
|
+
/// @prop {Map} breakpoints.alias - named map of breakpoint settings
|
8
|
+
/// @prop {Number} breakpoints.alias.columns - column count for breakpoint
|
9
|
+
/// @prop {Number} breakpoints.alias.breakpoint - breakpoint value for breakpoint
|
10
|
+
///
|
11
|
+
/// @prop {Map} settings - map of settings for grid
|
12
|
+
/// @prop {String} settings.default - alias of breakpoint to be grid default
|
13
|
+
/// @prop {String} settings.grid - type of grid
|
14
|
+
/// @prop {Number} settings.gutter - value for gutter
|
15
|
+
/// @prop {String} settings.float-direction - direction of float
|
16
|
+
/// @prop {Bool} settings.max-width - maximum width value
|
17
|
+
/// @prop {Bool} settings.center-container - center containers
|
18
|
+
/// @prop {Bool} settings.border-box-sizing - use `box-sizing: border-box`
|
19
|
+
/// @prop {Bool} settings.instance-maps - use instance maps for added features
|
20
|
+
/// @prop {Bool} settings.support-syntax - support syntax within instance functions
|
21
|
+
/// @prop {Bool} settings.debug-mode - enable debug mode
|
22
|
+
///
|
23
|
+
/// @group Configuration
|
24
|
+
///
|
25
25
|
$flint: (
|
26
26
|
"breakpoints": (
|
27
27
|
"desktop": (
|
@@ -1,11 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
//
|
2
|
+
// Helpers
|
3
|
+
//
|
4
4
|
@import "helpers/helpers";
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
//
|
7
|
+
// Functions
|
8
|
+
//
|
9
9
|
@import "lib/exists";
|
10
10
|
|
11
11
|
// Getters
|
@@ -38,9 +38,9 @@
|
|
38
38
|
@import "lib/replace-substring";
|
39
39
|
@import "lib/string-to-list";
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
//
|
42
|
+
// Support syntax
|
43
|
+
//
|
44
44
|
@import "lib/use-syntax";
|
45
45
|
@import "lib/support-syntax";
|
46
46
|
|
@@ -1,114 +1,114 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
////
|
2
|
+
/// @group Internal Helper Functions
|
3
|
+
////
|
4
|
+
|
5
|
+
///
|
6
|
+
/// Returns truthiness of a value
|
7
|
+
///
|
8
|
+
/// @access private
|
9
|
+
///
|
10
|
+
/// @param {*} $value
|
11
|
+
///
|
12
|
+
/// @return {Bool}
|
13
|
+
///
|
14
14
|
@function flint-is-true($value) {
|
15
15
|
@return if($value == null, false, $value and $value != null and $value != "" and $value != ());
|
16
16
|
}
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
///
|
19
|
+
/// Checks if item is map
|
20
|
+
///
|
21
|
+
/// @access private
|
22
|
+
///
|
23
|
+
/// @param {Map} $n
|
24
|
+
///
|
25
|
+
/// @return {Bool}
|
26
|
+
///
|
27
27
|
@function flint-is-map($n) {
|
28
28
|
@return type-of($n) == "map";
|
29
29
|
}
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
///
|
32
|
+
/// Checks if item is list
|
33
|
+
///
|
34
|
+
/// @access private
|
35
|
+
///
|
36
|
+
/// @param {List} $n
|
37
|
+
///
|
38
|
+
/// @return {Bool}
|
39
|
+
///
|
40
40
|
@function flint-is-list($n) {
|
41
41
|
@return type-of($n) == "list";
|
42
42
|
}
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
44
|
+
///
|
45
|
+
/// Checks if item is number
|
46
|
+
///
|
47
|
+
/// @access private
|
48
|
+
///
|
49
|
+
/// @param {Number} $n
|
50
|
+
///
|
51
|
+
/// @return {Bool}
|
52
|
+
///
|
53
53
|
@function flint-is-number($n) {
|
54
54
|
@return type-of($n) == "number";
|
55
55
|
}
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
57
|
+
///
|
58
|
+
/// Checks if item is string
|
59
|
+
///
|
60
|
+
/// @access private
|
61
|
+
///
|
62
|
+
/// @param {String} $n
|
63
|
+
///
|
64
|
+
/// @return {Bool}
|
65
|
+
///
|
66
66
|
@function flint-is-string($n) {
|
67
67
|
@return type-of($n) == "string";
|
68
68
|
}
|
69
69
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
70
|
+
///
|
71
|
+
/// Checks if item is not string
|
72
|
+
///
|
73
|
+
/// @access private
|
74
|
+
///
|
75
|
+
/// @param {String} $n
|
76
|
+
///
|
77
|
+
/// @return {Bool}
|
78
|
+
///
|
79
79
|
@function flint-is-not-string($n) {
|
80
80
|
@return type-of($n) != "string";
|
81
81
|
}
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
83
|
+
///
|
84
|
+
/// Get gutter value from config map
|
85
|
+
///
|
86
|
+
/// @access private
|
87
|
+
///
|
88
|
+
/// @return {Number}
|
89
|
+
///
|
90
90
|
@function flint-get-gutter() {
|
91
91
|
@return flint-get-value("settings", "gutter");
|
92
92
|
}
|
93
93
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
94
|
+
///
|
95
|
+
/// Gets list of each breakpoint's key
|
96
|
+
///
|
97
|
+
/// @access private
|
98
|
+
///
|
99
|
+
/// @return {List}
|
100
|
+
///
|
101
101
|
@function flint-get-all-keys() {
|
102
102
|
@return map-keys(flint-get-value("breakpoints"));
|
103
103
|
}
|
104
104
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
105
|
+
///
|
106
|
+
/// Gets list of all breakpoints
|
107
|
+
///
|
108
|
+
/// @access private
|
109
|
+
///
|
110
|
+
/// @return {List}
|
111
|
+
///
|
112
112
|
@function flint-get-all-breakpoints() {
|
113
113
|
$all-keys: flint-get-all-keys();
|
114
114
|
$all-breakpoints: ();
|
@@ -120,52 +120,52 @@
|
|
120
120
|
@return $all-breakpoints;
|
121
121
|
}
|
122
122
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
123
|
+
///
|
124
|
+
/// Checks if passed $key is the highest breakpoint
|
125
|
+
///
|
126
|
+
/// @access private
|
127
|
+
///
|
128
|
+
/// @param {String} $key - alias of breakpoint
|
129
|
+
///
|
130
|
+
/// @return {Bool}
|
131
|
+
///
|
132
132
|
@function flint-is-highest-breakpoint($key) {
|
133
133
|
@return flint-get-value("breakpoints", $key, "breakpoint") == max(flint-get-all-breakpoints()...);
|
134
134
|
}
|
135
135
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
136
|
+
///
|
137
|
+
/// Checks if passed $key is the lowest breakpoint
|
138
|
+
///
|
139
|
+
/// @access private
|
140
|
+
///
|
141
|
+
/// @param {String} $key - alias of breakpoint
|
142
|
+
///
|
143
|
+
/// @return {Bool}
|
144
|
+
///
|
145
145
|
@function flint-is-lowest-breakpoint($key) {
|
146
146
|
@return flint-get-value("breakpoints", $key, "breakpoint") == min(flint-get-all-breakpoints()...);
|
147
147
|
}
|
148
148
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
149
|
+
///
|
150
|
+
/// Checks if $key is grid default
|
151
|
+
///
|
152
|
+
/// @access private
|
153
|
+
///
|
154
|
+
/// @param {String} $key - alias of breakpoint
|
155
|
+
///
|
156
|
+
/// @return {Bool}
|
157
|
+
///
|
158
158
|
@function flint-is-default($key) {
|
159
159
|
@return $key == flint-get-value("settings", "default");
|
160
160
|
}
|
161
161
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
162
|
+
///
|
163
|
+
/// Gets all breakpoint column values
|
164
|
+
///
|
165
|
+
/// @access private
|
166
|
+
///
|
167
|
+
/// @return {List}
|
168
|
+
///
|
169
169
|
@function flint-get-all-columns() {
|
170
170
|
$all-keys: flint-get-all-keys();
|
171
171
|
$all-columns: ();
|
@@ -177,39 +177,39 @@
|
|
177
177
|
@return $all-columns;
|
178
178
|
}
|
179
179
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
180
|
+
///
|
181
|
+
/// Returns the unit used in config
|
182
|
+
///
|
183
|
+
/// @access private
|
184
|
+
///
|
185
|
+
/// @return {*}
|
186
|
+
///
|
187
187
|
@function flint-get-config-unit() {
|
188
188
|
@return unit(flint-get-value("settings", "gutter"));
|
189
189
|
}
|
190
190
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
191
|
+
///
|
192
|
+
/// Convert pixel value to em
|
193
|
+
///
|
194
|
+
/// @access private
|
195
|
+
///
|
196
|
+
/// @param {Number} $target - pixel value
|
197
|
+
/// @param {Number} $context - context to divide by
|
198
|
+
///
|
199
|
+
/// @return {Number} em value of target relative to context
|
200
|
+
///
|
201
201
|
@function flint-to-em($target, $context: $flint__base-font-size) {
|
202
202
|
@return ($target / $context) * 1em;
|
203
203
|
}
|
204
204
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
205
|
+
///
|
206
|
+
/// Use Ruby functions in place of Sass functions where possible
|
207
|
+
/// to speed up performance, especially with string functions
|
208
|
+
///
|
209
|
+
/// @access private
|
210
|
+
///
|
211
|
+
/// @return {Bool}
|
212
|
+
///
|
213
213
|
@function flint-use-ruby-functions() {
|
214
214
|
@return flint_use_ruby() == true;
|
215
215
|
}
|