flint-gs 2.0.1 → 2.0.2
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 +4 -4
- data/lib/flint.rb +33 -15
- data/stylesheets/flint/config/_config.scss +3 -0
- data/stylesheets/flint/functions/lib/_instance.scss +1 -1
- data/stylesheets/flint/functions/lib/_map-fetch.scss +15 -5
- data/stylesheets/flint/functions/lib/_replace-substring.scss +1 -1
- data/stylesheets/flint/functions/lib/_string-to-list.scss +2 -2
- data/stylesheets/flint/functions/lib/_support-syntax.scss +2 -4
- data/stylesheets/flint/functions/lib/_types-in-list.scss +1 -8
- data/stylesheets/flint/globals/_globals.scss +33 -33
- data/stylesheets/flint/mixins/lib/_main.scss +101 -167
- 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: 95fa317058ad844a74cbbf2ff08163f19c7023ad
|
4
|
+
data.tar.gz: 62700564e898e68da19ce762a7f89560cb59429b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7751705093073a2812b4f492041ee8fdae176d543e77a4a86f4c86320c1cb9f56b93d1c5149ca0bb39ac23dd4be04582e2ef5c7744b1d075642fa3a246ff9236
|
7
|
+
data.tar.gz: 867230aeb048f0d6eb01d6ec1f143ffd7e543bcbf37e6c26f49599c4085cbe0b859848e766006d31f924e9e87f66f148a910a083d562d0b724d2400505dfffcf
|
data/lib/flint.rb
CHANGED
@@ -10,8 +10,8 @@ else
|
|
10
10
|
end
|
11
11
|
|
12
12
|
module Flint
|
13
|
-
VERSION = "2.0.
|
14
|
-
DATE = "2014-
|
13
|
+
VERSION = "2.0.2"
|
14
|
+
DATE = "2014-10-01"
|
15
15
|
end
|
16
16
|
|
17
17
|
module Sass::Script::Functions
|
@@ -26,29 +26,46 @@ module Sass::Script::Functions
|
|
26
26
|
end
|
27
27
|
|
28
28
|
###
|
29
|
-
#
|
29
|
+
# Fetch value from map
|
30
30
|
#
|
31
|
-
# @param {
|
31
|
+
# @param {Map} map - map to fetch value from
|
32
|
+
# @param {ArgList} keys - list of keys to traverse
|
33
|
+
#
|
34
|
+
# @return {String | False}
|
35
|
+
###
|
36
|
+
def flint_ruby_map_fetch(map, *keys)
|
37
|
+
assert_type map, :Map, :map
|
38
|
+
result = map
|
39
|
+
keys.each {|key| result != nil ? result = result.to_h.fetch(key, nil) : break}
|
40
|
+
return result != nil ? result : Sass::Script::Bool.new(false)
|
41
|
+
end
|
42
|
+
declare :flint_ruby_map_fetch, :args => [:map, :keys], :var_args => true
|
43
|
+
|
44
|
+
###
|
45
|
+
# Turn string into a flat list
|
46
|
+
#
|
47
|
+
# @param {String} string - string to operate on
|
32
48
|
# @param {String} separator - item to find which separates substrings
|
33
49
|
# @param {String} ignore - removes remaining string beyond item
|
34
50
|
#
|
35
51
|
# @return {List}
|
36
52
|
###
|
37
|
-
def
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
53
|
+
def flint_ruby_string_to_list(string, separator, ignore)
|
54
|
+
assert_type string, :String, :string
|
55
|
+
assert_type separator, :String, :separator
|
56
|
+
assert_type ignore, :String, :ignore
|
57
|
+
# Remove everything after ignore, split with separator
|
58
|
+
items = string.value[/[^#{ignore}]+/].split(separator.value)
|
43
59
|
if items.count == 1
|
44
60
|
Sass::Script::String.new(items[0], :comma)
|
45
61
|
else
|
46
62
|
Sass::Script::List.new(items.map { |i| Sass::Script::String.new(i) }, :comma)
|
47
63
|
end
|
48
64
|
end
|
65
|
+
declare :flint_ruby_string_to_list, :args => [:string, :separator, :ignore]
|
49
66
|
|
50
67
|
###
|
51
|
-
# Replace substring
|
68
|
+
# Replace substring with string
|
52
69
|
#
|
53
70
|
# @param {String} string - string that contains substring
|
54
71
|
# @param {String} find - substring to replace
|
@@ -56,11 +73,12 @@ module Sass::Script::Functions
|
|
56
73
|
#
|
57
74
|
# @return {String}
|
58
75
|
###
|
59
|
-
def
|
76
|
+
def flint_ruby_replace_substring(string, find, replace)
|
77
|
+
assert_type string, :String, :string
|
78
|
+
assert_type find, :String, :find
|
79
|
+
assert_type replace, :String, :replace
|
60
80
|
Sass::Script::String.new(string.value.gsub(find.value, replace.value))
|
61
81
|
end
|
62
|
-
|
63
|
-
declare :string_to_list, [:string, :separator, :ignore]
|
64
|
-
declare :replace_substring, [:string, :find, :replace]
|
82
|
+
declare :flint_ruby_replace_substring, :args => [:string, :find, :replace]
|
65
83
|
|
66
84
|
end
|
@@ -1,10 +1,13 @@
|
|
1
1
|
/**
|
2
2
|
* Configuration map
|
3
3
|
*
|
4
|
+
* @type Map
|
5
|
+
*
|
4
6
|
* @prop {Map} breakpoints - map of breakpoints, follow DSC order
|
5
7
|
* @prop {Map} breakpoints.alias - named map of breakpoint settings
|
6
8
|
* @prop {Number} breakpoints.alias.columns - column count for breakpoint
|
7
9
|
* @prop {Number} breakpoints.alias.breakpoint - breakpoint value for breakpoint
|
10
|
+
*
|
8
11
|
* @prop {Map} settings - map of settings for grid
|
9
12
|
* @prop {String} settings.default - alias of breakpoint to be grid default
|
10
13
|
* @prop {String} settings.grid - type of grid
|
@@ -9,11 +9,21 @@
|
|
9
9
|
* @return {String | False}
|
10
10
|
*/
|
11
11
|
@function flint-map-fetch($map, $keys...) {
|
12
|
-
$result: $map;
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
// Use Ruby function if available
|
14
|
+
@if $flint__use-ruby-functions {
|
15
|
+
@return flint_ruby_map_fetch($map, $keys...);
|
16
|
+
} @else {
|
17
|
+
$result: $map;
|
18
|
+
|
19
|
+
@each $key in $keys {
|
20
|
+
@if $result {
|
21
|
+
$result: flint-is-map($result) and map-has-key($result, $key) and map-get($result, $key) or false;
|
22
|
+
} @else {
|
23
|
+
@return false;
|
24
|
+
}
|
25
|
+
}
|
17
26
|
|
18
|
-
|
27
|
+
@return $result;
|
28
|
+
}
|
19
29
|
}
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
// Use Ruby function if available
|
15
15
|
@if $flint__use-ruby-functions {
|
16
|
-
@return
|
16
|
+
@return flint_ruby_replace_substring($string, $substring, $new-substring);
|
17
17
|
} @else {
|
18
18
|
// Loop through length of string
|
19
19
|
@for $i from 1 through str-length($string) {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
*
|
4
4
|
* @access private
|
5
5
|
*
|
6
|
-
* @param {String} $string
|
6
|
+
* @param {String} $string - string to perform on
|
7
7
|
* @param {String} $find (" ") - item to find which separates substrings
|
8
8
|
* @param {String} $ignore (",") - removes remaining string beyond item
|
9
9
|
*
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
// Use Ruby function if available
|
16
16
|
@if $flint__use-ruby-functions {
|
17
|
-
@return
|
17
|
+
@return flint_ruby_string_to_list($string, $find, $ignore);
|
18
18
|
} @else {
|
19
19
|
$string-list: ();
|
20
20
|
$space-indexes: ();
|
@@ -12,13 +12,11 @@
|
|
12
12
|
$syntax: to-lower-case($syntax);
|
13
13
|
|
14
14
|
// Make sure syntax is supported
|
15
|
-
// ----
|
16
15
|
@if function-exists("flint-support-syntax-#{$syntax}") {
|
17
16
|
|
18
17
|
// Support syntax
|
19
|
-
//
|
20
|
-
//
|
21
|
-
// ----
|
18
|
+
//
|
19
|
+
// WARNING: Be sure you have created a custom function to support an unknown syntax
|
22
20
|
@return call("flint-support-syntax-#{$syntax}", $selectors);
|
23
21
|
|
24
22
|
} @else {
|
@@ -13,11 +13,9 @@
|
|
13
13
|
@if flint-is-list($list) {
|
14
14
|
|
15
15
|
// Assert types in list?
|
16
|
-
// ----
|
17
16
|
@if $assert-types {
|
18
17
|
|
19
18
|
// Assert length of list?
|
20
|
-
// ----
|
21
19
|
@if $assert-length {
|
22
20
|
// Get length of list
|
23
21
|
$length: length($list);
|
@@ -28,11 +26,9 @@
|
|
28
26
|
$types: ();
|
29
27
|
|
30
28
|
// List of asserted types?
|
31
|
-
// ----
|
32
29
|
@if flint-is-list($assert-types) {
|
33
30
|
|
34
31
|
// Make sure length of types match list
|
35
|
-
// ----
|
36
32
|
@if length($assert-types) == $length {
|
37
33
|
|
38
34
|
// Loop over each item in list
|
@@ -49,13 +45,11 @@
|
|
49
45
|
}
|
50
46
|
|
51
47
|
// Lengths did not match
|
52
|
-
// ----
|
53
48
|
} @else {
|
54
49
|
@return false;
|
55
50
|
}
|
56
51
|
|
57
52
|
// Assert a single type across list
|
58
|
-
// ----
|
59
53
|
} @else {
|
60
54
|
// Assert single type
|
61
55
|
$type: nth($assert-types, 1);
|
@@ -82,7 +76,6 @@
|
|
82
76
|
}
|
83
77
|
|
84
78
|
// Just assert types in list, any length
|
85
|
-
// ----
|
86
79
|
} @else {
|
87
80
|
// Get asserted type
|
88
81
|
$type: $assert-types;
|
@@ -100,7 +93,6 @@
|
|
100
93
|
}
|
101
94
|
|
102
95
|
// Just assert type of first item in list
|
103
|
-
// ----
|
104
96
|
} @else {
|
105
97
|
// Get type of first item in list
|
106
98
|
$type: type-of(nth($list, 1));
|
@@ -115,6 +107,7 @@
|
|
115
107
|
|
116
108
|
@return true;
|
117
109
|
}
|
110
|
+
|
118
111
|
// Was not a list, return false
|
119
112
|
} @else {
|
120
113
|
@return false;
|
@@ -1,100 +1,100 @@
|
|
1
|
-
|
1
|
+
/**
|
2
2
|
* Use development mode to silence fatal errors
|
3
3
|
*
|
4
4
|
* @access private
|
5
5
|
*
|
6
|
-
* @type
|
6
|
+
* @type Bool
|
7
7
|
*/
|
8
8
|
$flint__development-mode: false !global;
|
9
9
|
|
10
|
-
|
10
|
+
/**
|
11
11
|
* Set global variable to check if foundation has been set
|
12
12
|
*
|
13
13
|
* @access private
|
14
14
|
*
|
15
|
-
* @type
|
15
|
+
* @type String
|
16
16
|
*/
|
17
17
|
$flint__foundation: "non-existent" !global;
|
18
18
|
|
19
|
-
|
20
|
-
* Gather all keys, breakpoints and column counts
|
21
|
-
*
|
22
|
-
* @access private
|
23
|
-
*
|
24
|
-
* @type {List}
|
25
|
-
*/
|
26
|
-
$flint__all-keys: flint-get-all-keys() !global;
|
27
|
-
$flint__all-breakpoints: flint-get-all-breakpoints() !global;
|
28
|
-
$flint__all-columns: flint-get-all-columns() !global;
|
29
|
-
|
30
|
-
/*
|
19
|
+
/**
|
31
20
|
* Keep count of all instances
|
32
21
|
*
|
33
22
|
* @access private
|
34
23
|
*
|
35
|
-
* @type
|
24
|
+
* @type Number
|
36
25
|
*/
|
37
26
|
$flint__instance-count: 0 !global;
|
38
27
|
|
39
|
-
|
28
|
+
/**
|
40
29
|
* Keep map of all instances
|
41
30
|
*
|
42
31
|
* @access private
|
43
32
|
*
|
44
|
-
* @type
|
33
|
+
* @type Map
|
45
34
|
*/
|
46
35
|
$flint__instances: () !global;
|
47
36
|
|
48
|
-
|
37
|
+
/**
|
49
38
|
* Font size for em calculation
|
50
39
|
*
|
51
40
|
* @access private
|
52
41
|
*
|
53
|
-
* @type
|
42
|
+
* @type Number
|
54
43
|
*/
|
55
44
|
$flint__base-font-size: 16px !global;
|
56
45
|
|
57
|
-
|
46
|
+
/**
|
47
|
+
* Detect if Ruby functions are available
|
48
|
+
*
|
49
|
+
* @access private
|
50
|
+
*
|
51
|
+
* @type Bool
|
52
|
+
*/
|
53
|
+
$flint__use-ruby-functions: if(flint-use-ruby-functions() == true, true, false) !global;
|
54
|
+
|
55
|
+
/**
|
58
56
|
* Global syntax support
|
59
57
|
*
|
60
58
|
* @access private
|
61
59
|
*
|
62
|
-
* @type
|
60
|
+
* @type String
|
63
61
|
*/
|
64
62
|
$flint__support-syntax: flint-get-value("settings", "support-syntax") !global;
|
65
63
|
|
66
|
-
|
67
|
-
*
|
64
|
+
/**
|
65
|
+
* Gather all keys, breakpoints and column counts
|
68
66
|
*
|
69
67
|
* @access private
|
70
68
|
*
|
71
|
-
* @type
|
69
|
+
* @type List
|
72
70
|
*/
|
73
|
-
$
|
71
|
+
$flint__all-keys: flint-get-all-keys() !global;
|
72
|
+
$flint__all-breakpoints: flint-get-all-breakpoints() !global;
|
73
|
+
$flint__all-columns: flint-get-all-columns() !global;
|
74
74
|
|
75
|
-
|
75
|
+
/**
|
76
76
|
* Cache selector instance lists
|
77
77
|
*
|
78
78
|
* @access private
|
79
79
|
*
|
80
|
-
* @type
|
80
|
+
* @type Map
|
81
81
|
*/
|
82
82
|
$flint__cached-instances: () !global;
|
83
83
|
|
84
|
-
|
84
|
+
/**
|
85
85
|
* Cache calculated values
|
86
86
|
*
|
87
87
|
* @access private
|
88
88
|
*
|
89
|
-
* @type
|
89
|
+
* @type Map
|
90
90
|
*/
|
91
91
|
$flint__cached-values: () !global;
|
92
92
|
|
93
|
-
|
93
|
+
/**
|
94
94
|
* Cache calculation results
|
95
95
|
*
|
96
96
|
* @access private
|
97
97
|
*
|
98
|
-
* @type
|
98
|
+
* @type Map
|
99
99
|
*/
|
100
100
|
$flint__cache-results: () !global;
|
@@ -8,6 +8,78 @@
|
|
8
8
|
* @param {String | Number | List} $context - context value of span
|
9
9
|
* @param {String | List} $gutter - alias for gutter modifier
|
10
10
|
*
|
11
|
+
* @throws error if list lengths do not match number of breakpoints
|
12
|
+
*
|
13
|
+
* @example scss - Clearfix
|
14
|
+
* _(clear)
|
15
|
+
*
|
16
|
+
* @example scss - Foundation
|
17
|
+
* _(foundation)
|
18
|
+
*
|
19
|
+
* @example scss - Container
|
20
|
+
* _(container)
|
21
|
+
*
|
22
|
+
* @example scss - Recursive shorthand with no context
|
23
|
+
* _(2)
|
24
|
+
*
|
25
|
+
* @example scss - Recursive shorthand with identical context
|
26
|
+
* _(2, 4)
|
27
|
+
*
|
28
|
+
* @example scss - Recursive shorthand with differing context
|
29
|
+
* _(1, 2 4 6 8)
|
30
|
+
* _(1, auto)
|
31
|
+
*
|
32
|
+
* @example scss - Variable shorthand with no context
|
33
|
+
* _(1 2 3 4)
|
34
|
+
*
|
35
|
+
* @example scss - Variable shorthand with identical context
|
36
|
+
* _(1 2 3 4, 4)
|
37
|
+
* _(1 2 3 4, auto)
|
38
|
+
*
|
39
|
+
* @example scss - Variable shorthand with differing context
|
40
|
+
* _(4 3 2 1, 8 6 4 2)
|
41
|
+
* _(4 3 2 1, auto)
|
42
|
+
*
|
43
|
+
* @example scss - Call by alias with no context
|
44
|
+
* _(desktop, 2)
|
45
|
+
*
|
46
|
+
* @example scss - Call by alias with context
|
47
|
+
* _(desktop, 2, 4)
|
48
|
+
* _(desktop, 2, auto)
|
49
|
+
*
|
50
|
+
* @example scss - Call $key breakpoint by alias
|
51
|
+
* _($key)
|
52
|
+
*
|
53
|
+
* @example scss - From $key breakpoint to infinity
|
54
|
+
* _(from $key to infinity)
|
55
|
+
*
|
56
|
+
* @example scss - From $key-x breakpoint to $key-y breakpoint
|
57
|
+
* _(from $key-x to $key-y)
|
58
|
+
*
|
59
|
+
* @example scss - From $num-x to $num-y
|
60
|
+
* _(from $num-x to $num-y)
|
61
|
+
*
|
62
|
+
* @example scss - Greater than $key breakpoint
|
63
|
+
* _(greater than $key)
|
64
|
+
*
|
65
|
+
* @example scss - Greater than number
|
66
|
+
* _(greater than $num)
|
67
|
+
*
|
68
|
+
* @example scss - Number greater than $key breakpoint
|
69
|
+
* _($num greater than $key)
|
70
|
+
*
|
71
|
+
* @example scss - Less than $key breakpoint
|
72
|
+
* _(less than $key)
|
73
|
+
*
|
74
|
+
* @example scss - Less than number
|
75
|
+
* _(less than $num)
|
76
|
+
*
|
77
|
+
* @example scss - Number less than $key breakpoint
|
78
|
+
* _($num less than $key)
|
79
|
+
*
|
80
|
+
* @example scss - For $key-x $key-y $key-z
|
81
|
+
* _(for $key-x $key-y $key-z)
|
82
|
+
*
|
11
83
|
* @author Ezekiel Gabrielse
|
12
84
|
* @link http://flint.gs
|
13
85
|
*/
|
@@ -18,15 +90,8 @@
|
|
18
90
|
$gutter: null
|
19
91
|
) {
|
20
92
|
|
21
|
-
|
22
|
-
* Clearfix
|
23
|
-
* Uses `clearfix` mixin if one already exists,
|
24
|
-
* else falls back to packaged.
|
25
|
-
*
|
26
|
-
* @param {String}
|
27
|
-
*
|
28
|
-
* @example scss
|
29
|
-
* _(clear)
|
93
|
+
/*
|
94
|
+
* Clearfix
|
30
95
|
*/
|
31
96
|
@if $key == "clear" or $span == "clear" or $context == "clear" {
|
32
97
|
|
@@ -70,15 +135,8 @@
|
|
70
135
|
}
|
71
136
|
}
|
72
137
|
|
73
|
-
|
74
|
-
* Foundation
|
75
|
-
* Uses `box-sizing` mixin if one already exists,
|
76
|
-
* else falls back to packaged.
|
77
|
-
*
|
78
|
-
* @param {String}
|
79
|
-
*
|
80
|
-
* @example scss
|
81
|
-
* _(foundation)
|
138
|
+
/*
|
139
|
+
* Foundation
|
82
140
|
*/
|
83
141
|
@if $key == "foundation" {
|
84
142
|
|
@@ -97,13 +155,8 @@
|
|
97
155
|
}
|
98
156
|
}
|
99
157
|
|
100
|
-
|
101
|
-
* Container
|
102
|
-
*
|
103
|
-
* @param {String}
|
104
|
-
*
|
105
|
-
* @example scss
|
106
|
-
* _(container)
|
158
|
+
/*
|
159
|
+
* Container
|
107
160
|
*/
|
108
161
|
} @else if $key == "container" or $span == "container" or $context == "container" {
|
109
162
|
|
@@ -209,78 +262,36 @@
|
|
209
262
|
@include _("foundation");
|
210
263
|
}
|
211
264
|
|
212
|
-
|
265
|
+
/*
|
213
266
|
* Recursive shorthand with no context
|
214
|
-
*
|
215
|
-
* @param {Number} $key - single span value for all breakpoints
|
216
|
-
* @param {Null} $span - null context value
|
217
|
-
*
|
218
|
-
* @example scss
|
219
|
-
* _(2)
|
220
267
|
*/
|
221
268
|
@if flint-is-number($key) and length($key) == 1 and $span == null
|
222
269
|
|
223
|
-
|
270
|
+
/*
|
224
271
|
* Recursive shorthand with identical context
|
225
|
-
*
|
226
|
-
* @param {Number} $key - single span value for all breakpoints
|
227
|
-
* @param {Number | String} $span - single context value for all breakpoints
|
228
|
-
*
|
229
|
-
* @example scss
|
230
|
-
* _(2, 4)
|
231
272
|
*/
|
232
273
|
or flint-is-number($key) and length($key) == 1 and flint-is-number($span) and length($span) == 1
|
233
274
|
or flint-is-number($key) and length($key) == 1 and $span == "auto"
|
234
275
|
|
235
|
-
|
276
|
+
/*
|
236
277
|
* Recursive shorthand with differing context
|
237
|
-
*
|
238
|
-
* @param {Number} $key - single span value for all breakpoints
|
239
|
-
* @param {List | String} $span - context value of span for each breakpoint
|
240
|
-
*
|
241
|
-
* @example scss
|
242
|
-
* _(1, 2 4 6 8) | _(1, auto)
|
243
|
-
*
|
244
|
-
* @throws error if lengths do not match number of breakpoints
|
245
278
|
*/
|
246
279
|
or flint-is-number($key) and length($key) == 1 and flint-types-in-list($span, "number")
|
247
280
|
or flint-is-number($key) and length($key) == 1 and $span == "auto"
|
248
281
|
|
249
|
-
|
282
|
+
/*
|
250
283
|
* Variable shorthand with no context
|
251
|
-
*
|
252
|
-
* @param {List} $key - span value for each breakpoint
|
253
|
-
* @param {Null} $span - null context value
|
254
|
-
*
|
255
|
-
* @example scss
|
256
|
-
* _(1 2 3 4)
|
257
|
-
*
|
258
|
-
* @throws error if lengths do not match number of breakpoints
|
259
284
|
*/
|
260
285
|
or flint-types-in-list($key, "number") and $span == null
|
261
286
|
|
262
|
-
|
287
|
+
/*
|
263
288
|
* Variable shorthand with identical context
|
264
|
-
*
|
265
|
-
* @param {List} $key - span value for each breakpoint
|
266
|
-
* @param {Number | String} $span - context value for each breakpoint
|
267
|
-
*
|
268
|
-
* @example scss
|
269
|
-
* _(1 2 3 4, 4) | _(1 2 3 4, auto)
|
270
289
|
*/
|
271
290
|
or flint-types-in-list($key, "number") and flint-is-number($span) and length($span) == 1
|
272
291
|
or flint-types-in-list($key, "number") and $span == "auto"
|
273
292
|
|
274
|
-
|
293
|
+
/*
|
275
294
|
* Variable shorthand with differing context
|
276
|
-
*
|
277
|
-
* @param {List} $key - span value for each breakpoint
|
278
|
-
* @param {List | String} $span - context value for each breakpoint
|
279
|
-
*
|
280
|
-
* @example scss
|
281
|
-
* _(4 3 2 1, 8 6 4 2) | _(4 3 2 1, auto)
|
282
|
-
*
|
283
|
-
* @throws error if lengths do not match number of breakpoints
|
284
295
|
*/
|
285
296
|
or flint-types-in-list($key, "number") and flint-types-in-list($span, "number")
|
286
297
|
or flint-types-in-list($key, "number") and $span == "auto" {
|
@@ -360,36 +371,18 @@
|
|
360
371
|
}
|
361
372
|
}
|
362
373
|
|
363
|
-
|
374
|
+
/*
|
364
375
|
* Call by alias with no context
|
365
|
-
*
|
366
|
-
* @param {String} $key - breakpoint alias
|
367
|
-
* @param {Number} $span - span value for breakpoint
|
368
|
-
* @param {Null} $context - null context value
|
369
|
-
*
|
370
|
-
* @example scss
|
371
|
-
* _(desktop, 2)
|
372
|
-
*
|
373
|
-
* @throws error if breakpoint alias does not exist
|
374
376
|
*/
|
375
377
|
} @else if flint-is-string($key) and flint-is-number($span) and $context == null
|
376
378
|
|
377
|
-
|
379
|
+
/*
|
378
380
|
* Call by alias with context
|
379
|
-
*
|
380
|
-
* @param {String} $key - breakpoint alias
|
381
|
-
* @param {Number} $span - span value for breakpoint
|
382
|
-
* @param {Number | String} $context - context value for breakpoint
|
383
|
-
*
|
384
|
-
* @example scss
|
385
|
-
* _(desktop, 2, 4) | _(desktop, 2, auto)
|
386
|
-
*
|
387
|
-
* @throws error if breakpoint alias does not exist
|
388
381
|
*/
|
389
382
|
or flint-is-string($key) and flint-is-number($span) and flint-is-number($context)
|
390
383
|
or flint-is-string($key) and flint-is-number($span) and $context == "auto" {
|
391
384
|
|
392
|
-
//
|
385
|
+
// Throw error for invalid argument lengths
|
393
386
|
@if not flint-exists($flint, $key) {
|
394
387
|
@if not $flint__development-mode {
|
395
388
|
@error "Invalid argument: #{$key}. Breakpoint does not exist. Please provide a valid argument.";
|
@@ -457,21 +450,14 @@
|
|
457
450
|
}
|
458
451
|
}
|
459
452
|
|
460
|
-
|
461
|
-
* Wrap
|
462
|
-
*
|
463
|
-
* @param {String | List} $key - defines how to make up media query
|
453
|
+
/*
|
454
|
+
* Wrap content in media query
|
464
455
|
*/
|
465
456
|
} @else if flint-exists($flint, $key) and $span == null and $context == null
|
466
457
|
or flint-is-list($key) and $span == null and $context == null {
|
467
458
|
|
468
|
-
|
459
|
+
/*
|
469
460
|
* Call $key breakpoint by alias
|
470
|
-
*
|
471
|
-
* @param {String} $key - only for $key breakpoint
|
472
|
-
*
|
473
|
-
* @example scss
|
474
|
-
* _($key)
|
475
461
|
*/
|
476
462
|
@if length($key) == 1 {
|
477
463
|
|
@@ -501,13 +487,8 @@
|
|
501
487
|
}
|
502
488
|
}
|
503
489
|
|
504
|
-
|
490
|
+
/*
|
505
491
|
* From $key breakpoint to infinity
|
506
|
-
*
|
507
|
-
* @param {List} $key - min-width from $key breakpoint
|
508
|
-
*
|
509
|
-
* @example scss
|
510
|
-
* _(from $key to infinity)
|
511
492
|
*/
|
512
493
|
} @else if flint-types-in-list($key, "string", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" and nth($key, 4) == "infinity" {
|
513
494
|
|
@@ -525,13 +506,8 @@
|
|
525
506
|
}
|
526
507
|
}
|
527
508
|
|
528
|
-
|
509
|
+
/*
|
529
510
|
* From $key-x breakpoint to $key-y breakpoint
|
530
|
-
*
|
531
|
-
* @param {List} $key - from $key-x breakpoint to $key-y
|
532
|
-
*
|
533
|
-
* @example scss
|
534
|
-
* _(from $key-x to $key-y)
|
535
511
|
*/
|
536
512
|
} @else if flint-types-in-list($key, "string", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" {
|
537
513
|
|
@@ -549,13 +525,8 @@
|
|
549
525
|
}
|
550
526
|
}
|
551
527
|
|
552
|
-
|
528
|
+
/*
|
553
529
|
* From $num-x to $num-y
|
554
|
-
*
|
555
|
-
* @param {List} $key - arbitrary media query
|
556
|
-
*
|
557
|
-
* @example scss
|
558
|
-
* _(from $num-x to $num-y)
|
559
530
|
*/
|
560
531
|
} @else if flint-types-in-list($key, "string" "number" "string" "number", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" {
|
561
532
|
// Make sure passed units match units used in config
|
@@ -570,13 +541,8 @@
|
|
570
541
|
}
|
571
542
|
}
|
572
543
|
|
573
|
-
|
544
|
+
/*
|
574
545
|
* Greater than $key breakpoint
|
575
|
-
*
|
576
|
-
* @param {List} $key - anything above $key breakpoint
|
577
|
-
*
|
578
|
-
* @example scss
|
579
|
-
* _(greater than $key)
|
580
546
|
*/
|
581
547
|
} @else if flint-types-in-list($key, "string", 3) and nth($key, 1) == "greater" and nth($key, 2) == "than" {
|
582
548
|
|
@@ -594,13 +560,8 @@
|
|
594
560
|
}
|
595
561
|
}
|
596
562
|
|
597
|
-
|
563
|
+
/*
|
598
564
|
* Greater than number
|
599
|
-
*
|
600
|
-
* @param {List} $key - anything above number
|
601
|
-
*
|
602
|
-
* @example scss
|
603
|
-
* _(greater than $num)
|
604
565
|
*/
|
605
566
|
} @else if flint-types-in-list($key, "string" "string" "number", 3) and nth($key, 1) == "greater" and nth($key, 2) == "than" {
|
606
567
|
|
@@ -614,13 +575,8 @@
|
|
614
575
|
}
|
615
576
|
}
|
616
577
|
|
617
|
-
|
578
|
+
/*
|
618
579
|
* Number greater than $key breakpoint
|
619
|
-
*
|
620
|
-
* @param {List} $key - unit value greater than $key breakpoint
|
621
|
-
*
|
622
|
-
* @example scss
|
623
|
-
* _($num greater than $key)
|
624
580
|
*/
|
625
581
|
} @else if flint-types-in-list($key, "number" "string" "string" "string", 4) and nth($key, 2) == "greater" and nth($key, 3) == "than" {
|
626
582
|
|
@@ -634,13 +590,8 @@
|
|
634
590
|
}
|
635
591
|
}
|
636
592
|
|
637
|
-
|
593
|
+
/*
|
638
594
|
* Less than $key breakpoint
|
639
|
-
*
|
640
|
-
* @param {List} $key - anything below $key breakpoint
|
641
|
-
*
|
642
|
-
* @example scss
|
643
|
-
* _(less than $key)
|
644
595
|
*/
|
645
596
|
} @else if flint-types-in-list($key, "string", 3) and nth($key, 1) == "less" and nth($key, 2) == "than" {
|
646
597
|
|
@@ -658,13 +609,8 @@
|
|
658
609
|
}
|
659
610
|
}
|
660
611
|
|
661
|
-
|
612
|
+
/*
|
662
613
|
* Less than number
|
663
|
-
*
|
664
|
-
* @param {List} $key - anything below number
|
665
|
-
*
|
666
|
-
* @example scss
|
667
|
-
* _(less than $num)
|
668
614
|
*/
|
669
615
|
} @else if flint-types-in-list($key, "string" "string" "number", 3) and nth($key, 1) == "less" and nth($key, 2) == "than" {
|
670
616
|
|
@@ -678,13 +624,8 @@
|
|
678
624
|
}
|
679
625
|
}
|
680
626
|
|
681
|
-
|
627
|
+
/*
|
682
628
|
* Number less than $key breakpoint
|
683
|
-
*
|
684
|
-
* @param {List} $key - unit value less than $key breakpoint
|
685
|
-
*
|
686
|
-
* @example scss
|
687
|
-
* _($num less than $key)
|
688
629
|
*/
|
689
630
|
} @else if flint-types-in-list($key, "number" "string" "string" "string", 4) and nth($key, 2) == "less" and nth($key, 3) == "than" {
|
690
631
|
|
@@ -698,13 +639,8 @@
|
|
698
639
|
}
|
699
640
|
}
|
700
641
|
|
701
|
-
|
642
|
+
/*
|
702
643
|
* For $key-x $key-y $key-z
|
703
|
-
*
|
704
|
-
* @param {List} $key - comma delimited list of queries
|
705
|
-
*
|
706
|
-
* @example scss
|
707
|
-
* _(for $key-x $key-y $key-z)
|
708
644
|
*/
|
709
645
|
} @else if flint-types-in-list($key, "string") and nth($key, 1) == "for" {
|
710
646
|
// Define empty query list
|
@@ -748,10 +684,8 @@
|
|
748
684
|
}
|
749
685
|
}
|
750
686
|
|
751
|
-
|
687
|
+
/*
|
752
688
|
* Invalid argument
|
753
|
-
*
|
754
|
-
* @throw invalid argument error
|
755
689
|
*/
|
756
690
|
} @else {
|
757
691
|
@if $key != "clear" {
|
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: 2.0.
|
4
|
+
version: 2.0.2
|
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-
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|