flint-gs 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/LICENSE +21 -21
  2. data/README.md +906 -906
  3. data/lib/flint.rb +77 -77
  4. data/stylesheets/_flint.scss +6 -6
  5. data/stylesheets/flint/config/_config.scss +83 -83
  6. data/stylesheets/flint/functions/_functions.scss +41 -41
  7. data/stylesheets/flint/functions/helpers/_helpers.scss +181 -187
  8. data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +33 -33
  9. data/stylesheets/flint/functions/lib/_calc-margin.scss +57 -57
  10. data/stylesheets/flint/functions/lib/_calc-width.scss +50 -50
  11. data/stylesheets/flint/functions/lib/_exists.scss +22 -22
  12. data/stylesheets/flint/functions/lib/_fluid-width.scss +10 -10
  13. data/stylesheets/flint/functions/lib/_get-index.scss +13 -13
  14. data/stylesheets/flint/functions/lib/_get-instance-value.scss +17 -17
  15. data/stylesheets/flint/functions/lib/_get-value.scss +14 -14
  16. data/stylesheets/flint/functions/lib/_has-family-instance.scss +74 -74
  17. data/stylesheets/flint/functions/lib/_instance.scss +46 -46
  18. data/stylesheets/flint/functions/lib/_last.scss +9 -9
  19. data/stylesheets/flint/functions/lib/_list-to-string.scss +25 -25
  20. data/stylesheets/flint/functions/lib/_map-fetch.scss +30 -30
  21. data/stylesheets/flint/functions/lib/_next-index.scss +15 -15
  22. data/stylesheets/flint/functions/lib/_purge.scss +19 -19
  23. data/stylesheets/flint/functions/lib/_remove.scss +13 -13
  24. data/stylesheets/flint/functions/lib/_replace-substring.scss +34 -34
  25. data/stylesheets/flint/functions/lib/_replace.scss +25 -25
  26. data/stylesheets/flint/functions/lib/_steal-key.scss +13 -13
  27. data/stylesheets/flint/functions/lib/_steal-values.scss +14 -14
  28. data/stylesheets/flint/functions/lib/_string-to-list.scss +90 -90
  29. data/stylesheets/flint/functions/lib/_string-to-number.scss +77 -77
  30. data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +31 -31
  31. data/stylesheets/flint/functions/lib/_support-syntax.scss +28 -28
  32. data/stylesheets/flint/functions/lib/_types-in-list.scss +119 -120
  33. data/stylesheets/flint/functions/lib/_use-syntax.scss +14 -14
  34. data/stylesheets/flint/globals/_globals.scss +38 -38
  35. data/stylesheets/flint/mixins/_mixins.scss +7 -7
  36. data/stylesheets/flint/mixins/lib/_calculate.scss +571 -571
  37. data/stylesheets/flint/mixins/lib/_clearfix.scss +19 -19
  38. data/stylesheets/flint/mixins/lib/_main.scss +935 -935
  39. data/stylesheets/flint/mixins/lib/_new-instance.scss +27 -27
  40. data/stylesheets/flint/mixins/lib/_print-instance.scss +42 -42
  41. metadata +22 -16
  42. checksums.yaml +0 -7
@@ -1,77 +1,77 @@
1
- require 'compass'
2
-
3
- extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
4
- Compass::Frameworks.register('flint', :path => extension_path)
5
-
6
- # Date is in the form of YYYY-MM-DD
7
- module Flint
8
- VERSION = "1.7.0"
9
- DATE = "2014-07-11"
10
- end
11
-
12
- # Custom functions
13
- module Sass::Script::Functions
14
-
15
- # Use ruby functions
16
- # ----
17
- def flint_use_ruby()
18
- Sass::Script::Bool.new(true)
19
- end
20
-
21
- # Returns stringified selector
22
- # ----
23
- # @return [string]
24
- def selector_string()
25
- Sass::Script::String.new(environment.selector.to_s)
26
- end
27
-
28
- # Turns string into a flat list
29
- # ----
30
- # @param string [string] : string
31
- # @param separator [string] : item to find which separates substrings
32
- # @param ignore [string] : removes remaining string beyond item
33
- # ----
34
- # @return [list] | error
35
- def string_to_list(string, separator, ignore)
36
- # Remove rest of string after ignore
37
- ignore = string.value[/[^#{ignore}]+/]
38
- # Get first set of strings, convert to array by separator
39
- items = ignore.split(separator.value)
40
- # Convert array to list
41
- if items.count == 1
42
- Sass::Script::String.new(items[0], :comma)
43
- else
44
- Sass::Script::List.new(items.map { |i| Sass::Script::String.new(i) }, :comma)
45
- end
46
- end
47
-
48
- # Replace substring
49
- # ----
50
- # @param string [string] : string that contains substring
51
- # @param find [string] : substring to replace
52
- # @param replace [string] : new string to replace sub with
53
- # ----
54
- # @return [string]
55
- def replace_substring(string, find, replace)
56
- # Assert types
57
- assert_type string, :String
58
- assert_type find, :String
59
- assert_type replace, :String
60
- # Return new string
61
- Sass::Script::String.new(string.value.gsub(find.value, replace.value))
62
- end
63
-
64
- # Converts string to number
65
- # ----
66
- # @param string [string] : string
67
- # ----
68
- # @return [number]
69
- def string_to_number(string)
70
- Sass::Script::Number.new(string.value.to_i)
71
- end
72
-
73
- declare :string_to_list, [:string, :separator, :ignore]
74
- declare :replace_substring, [:string, :find, :replace]
75
- declare :string_to_number, [:string]
76
-
77
- end
1
+ require 'compass'
2
+
3
+ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
4
+ Compass::Frameworks.register('flint', :path => extension_path)
5
+
6
+ # Date is in the form of YYYY-MM-DD
7
+ module Flint
8
+ VERSION = "1.7.1"
9
+ DATE = "2014-07-12"
10
+ end
11
+
12
+ # Custom functions
13
+ module Sass::Script::Functions
14
+
15
+ # Use ruby functions
16
+ # ----
17
+ def flint_use_ruby()
18
+ Sass::Script::Bool.new(true)
19
+ end
20
+
21
+ # Returns stringified selector
22
+ # ----
23
+ # @return [string]
24
+ def selector_string()
25
+ Sass::Script::String.new(environment.selector.to_s)
26
+ end
27
+
28
+ # Turns string into a flat list
29
+ # ----
30
+ # @param string [string] : string
31
+ # @param separator [string] : item to find which separates substrings
32
+ # @param ignore [string] : removes remaining string beyond item
33
+ # ----
34
+ # @return [list] | error
35
+ def string_to_list(string, separator, ignore)
36
+ # Remove rest of string after ignore
37
+ ignore = string.value[/[^#{ignore}]+/]
38
+ # Get first set of strings, convert to array by separator
39
+ items = ignore.split(separator.value)
40
+ # Convert array to list
41
+ if items.count == 1
42
+ Sass::Script::String.new(items[0], :comma)
43
+ else
44
+ Sass::Script::List.new(items.map { |i| Sass::Script::String.new(i) }, :comma)
45
+ end
46
+ end
47
+
48
+ # Replace substring
49
+ # ----
50
+ # @param string [string] : string that contains substring
51
+ # @param find [string] : substring to replace
52
+ # @param replace [string] : new string to replace sub with
53
+ # ----
54
+ # @return [string]
55
+ def replace_substring(string, find, replace)
56
+ # Assert types
57
+ assert_type string, :String
58
+ assert_type find, :String
59
+ assert_type replace, :String
60
+ # Return new string
61
+ Sass::Script::String.new(string.value.gsub(find.value, replace.value))
62
+ end
63
+
64
+ # Converts string to number
65
+ # ----
66
+ # @param string [string] : string
67
+ # ----
68
+ # @return [number]
69
+ def string_to_number(string)
70
+ Sass::Script::Number.new(string.value.to_i)
71
+ end
72
+
73
+ declare :string_to_list, [:string, :separator, :ignore]
74
+ declare :replace_substring, [:string, :find, :replace]
75
+ declare :string_to_number, [:string]
76
+
77
+ end
@@ -1,6 +1,6 @@
1
- // Flint
2
- // ----
3
- @import "flint/config/config";
4
- @import "flint/functions/functions";
5
- @import "flint/globals/globals";
6
- @import "flint/mixins/mixins";
1
+ // Flint
2
+ // ----
3
+ @import "flint/config/config";
4
+ @import "flint/functions/functions";
5
+ @import "flint/globals/globals";
6
+ @import "flint/mixins/mixins";
@@ -1,83 +1,83 @@
1
- // Configuration map
2
- // -------------------------------------------------------------------------------
3
- // @param breakpoint [map] : Here you can set up your various breakpoints for your
4
- // project. Any number of breakpoints is acceptable. You must include a column
5
- // count and breakpoint value for each listed breakpoint. The order does have
6
- // to follow a `DESC` order. Unit (px | em) chosen here must be used consistently
7
- // throughout the rest of the config map.
8
- // -------------------------------------------------------------------------------
9
- // @param default [string] : alias of breakpoint that is your grid default
10
- // @param grid [string] : style of grid
11
- // @param gutter [number | false] : contextual size of gutter
12
- // @param float-style [number | false] : float direction
13
- // @param max-width [number | bool] : max-width for containers
14
- // @param center-container [bool] : if you want a centered container
15
- // @param border-box-sizing [bool] : if you want box-sizing: border-box applied
16
- // @param support-syntax [string | false] : syntax to support
17
- // @param debug-mode [bool] : ouputs debug properties
18
- // -------------------------------------------------------------------------------
19
-
20
- $flint: (
21
-
22
- // Grid configuration
23
- "config": (
24
-
25
- // Define breakpoints [any amount of breakpoints]
26
- // Any alias you like, minus reserved Flint words [i.e. "settings", "config", etc.]
27
- "desktop": (
28
-
29
- // Options: 0-infinity
30
- "columns": 16,
31
-
32
- // Options: number[unit]
33
- "breakpoint": 80em,
34
- ),
35
-
36
- // Same applies for other breakpoints
37
- // ----
38
- // Remember, you're not fixed to just 4 breakpoints like we have here
39
- "laptop": (
40
- "columns": 12,
41
- "breakpoint": 60em,
42
- ),
43
- "tablet": (
44
- "columns": 8,
45
- "breakpoint": 40em,
46
- ),
47
- "mobile": (
48
- "columns": 4,
49
- "breakpoint": 20em,
50
- ),
51
-
52
- // Additional grid settings [required]
53
- "settings": (
54
-
55
- // Any breakpoint's alias
56
- "default": "mobile",
57
-
58
- // Options: fluid | fixed
59
- "grid": "fluid",
60
-
61
- // Options: number[unit]
62
- "gutter": 0.625em,
63
-
64
- // Options: left | right
65
- "float-style": "left",
66
-
67
- // Options: true [uses highest breakpoint] | false | number[unit]
68
- "max-width": true,
69
-
70
- // Options: true | false
71
- "center-container": true,
72
-
73
- // Options: true | false
74
- "border-box-sizing": true,
75
-
76
- // Syntax support: string | false
77
- "support-syntax": false,
78
-
79
- // Options: true | false
80
- "debug-mode": true,
81
- )
82
- )
83
- ) !default;
1
+ // Configuration map
2
+ // -------------------------------------------------------------------------------
3
+ // @param breakpoint [map] : Here you can set up your various breakpoints for your
4
+ // project. Any number of breakpoints is acceptable. You must include a column
5
+ // count and breakpoint value for each listed breakpoint. The order does have
6
+ // to follow a `DESC` order. Unit (px | em) chosen here must be used consistently
7
+ // throughout the rest of the config map.
8
+ // -------------------------------------------------------------------------------
9
+ // @param default [string] : alias of breakpoint that is your grid default
10
+ // @param grid [string] : style of grid
11
+ // @param gutter [number | false] : contextual size of gutter
12
+ // @param float-style [number | false] : float direction
13
+ // @param max-width [number | bool] : max-width for containers
14
+ // @param center-container [bool] : if you want a centered container
15
+ // @param border-box-sizing [bool] : if you want box-sizing: border-box applied
16
+ // @param support-syntax [string | false] : syntax to support
17
+ // @param debug-mode [bool] : ouputs debug properties
18
+ // -------------------------------------------------------------------------------
19
+
20
+ $flint: (
21
+
22
+ // Grid configuration
23
+ "config": (
24
+
25
+ // Define breakpoints [any amount of breakpoints]
26
+ // Any alias you like, minus reserved Flint words [i.e. "settings", "config", etc.]
27
+ "desktop": (
28
+
29
+ // Options: 0-infinity
30
+ "columns": 16,
31
+
32
+ // Options: number[unit]
33
+ "breakpoint": 80em,
34
+ ),
35
+
36
+ // Same applies for other breakpoints
37
+ // ----
38
+ // Remember, you're not fixed to just 4 breakpoints like we have here
39
+ "laptop": (
40
+ "columns": 12,
41
+ "breakpoint": 60em,
42
+ ),
43
+ "tablet": (
44
+ "columns": 8,
45
+ "breakpoint": 40em,
46
+ ),
47
+ "mobile": (
48
+ "columns": 4,
49
+ "breakpoint": 20em,
50
+ ),
51
+
52
+ // Additional grid settings [required]
53
+ "settings": (
54
+
55
+ // Any breakpoint's alias
56
+ "default": "mobile",
57
+
58
+ // Options: fluid | fixed
59
+ "grid": "fluid",
60
+
61
+ // Options: number[unit]
62
+ "gutter": 0.625em,
63
+
64
+ // Options: left | right
65
+ "float-style": "left",
66
+
67
+ // Options: true [uses highest breakpoint] | false | number[unit]
68
+ "max-width": true,
69
+
70
+ // Options: true | false
71
+ "center-container": true,
72
+
73
+ // Options: true | false
74
+ "border-box-sizing": true,
75
+
76
+ // Syntax support: string | false
77
+ "support-syntax": false,
78
+
79
+ // Options: true | false
80
+ "debug-mode": false,
81
+ )
82
+ )
83
+ ) !default;
@@ -1,41 +1,41 @@
1
- // Helpers
2
- // ----
3
- @import "helpers/helpers";
4
-
5
- // Functions
6
- // ----
7
- @import "lib/exists";
8
- // Getters
9
- @import "lib/map-fetch";
10
- @import "lib/get-value";
11
- @import "lib/get-index";
12
- @import "lib/steal-key";
13
- @import "lib/steal-values";
14
- // Calculations
15
- @import "lib/fluid-width";
16
- @import "lib/calc-width";
17
- @import "lib/calc-margin";
18
- @import "lib/calc-breakpoint";
19
- // Instance functions
20
- @import "lib/instance";
21
- @import "lib/has-family-instance";
22
- @import "lib/get-instance-value";
23
- // List functions
24
- @import "lib/list-to-string";
25
- @import "lib/types-in-list";
26
- @import "lib/next-index";
27
- @import "lib/purge";
28
- @import "lib/replace";
29
- @import "lib/remove";
30
- @import "lib/last";
31
- // String functions
32
- @import "lib/replace-substring";
33
- @import "lib/string-to-number";
34
- @import "lib/string-to-list";
35
-
36
- // Support syntax
37
- // ---
38
- @import "lib/use-syntax";
39
- @import "lib/support-syntax";
40
- // Syntaxes
41
- @import "lib/support-syntax-bem"
1
+ // Helpers
2
+ // ----
3
+ @import "helpers/helpers";
4
+
5
+ // Functions
6
+ // ----
7
+ @import "lib/exists";
8
+ // Getters
9
+ @import "lib/map-fetch";
10
+ @import "lib/get-value";
11
+ @import "lib/get-index";
12
+ @import "lib/steal-key";
13
+ @import "lib/steal-values";
14
+ // Calculations
15
+ @import "lib/fluid-width";
16
+ @import "lib/calc-width";
17
+ @import "lib/calc-margin";
18
+ @import "lib/calc-breakpoint";
19
+ // Instance functions
20
+ @import "lib/instance";
21
+ @import "lib/has-family-instance";
22
+ @import "lib/get-instance-value";
23
+ // List functions
24
+ @import "lib/list-to-string";
25
+ @import "lib/types-in-list";
26
+ @import "lib/next-index";
27
+ @import "lib/purge";
28
+ @import "lib/replace";
29
+ @import "lib/remove";
30
+ @import "lib/last";
31
+ // String functions
32
+ @import "lib/replace-substring";
33
+ @import "lib/string-to-number";
34
+ @import "lib/string-to-list";
35
+
36
+ // Support syntax
37
+ // ---
38
+ @import "lib/use-syntax";
39
+ @import "lib/support-syntax";
40
+ // Syntaxes
41
+ @import "lib/support-syntax-bem"
@@ -1,187 +1,181 @@
1
- // Returns truthiness of a value
2
- // -------------------------------------------------------------------------------
3
- // @param $value [literal] : value
4
- // -------------------------------------------------------------------------------
5
- // @return [bool]
6
-
7
- @function flint-is-true($value) {
8
- @return if($value == null, false, $value and $value != null and $value != "" and $value != ());
9
- }
10
-
11
- // Checks if item is map
12
- //--------------------------------------------------------------------------------
13
- // @param $n [map] : value
14
- // -------------------------------------------------------------------------------
15
- // @return [bool]
16
-
17
- @function flint-is-map($n) {
18
- @return type-of($n) == "map";
19
- }
20
-
21
- // Checks if item is list
22
- //--------------------------------------------------------------------------------
23
- // @param $n [list] : value
24
- // -------------------------------------------------------------------------------
25
- // @return [bool]
26
-
27
- @function flint-is-list($n) {
28
- @return type-of($n) == "list";
29
- }
30
-
31
- // Checks if item is number
32
- //--------------------------------------------------------------------------------
33
- // @param $n [number] : value
34
- // -------------------------------------------------------------------------------
35
- // @return [bool]
36
-
37
- @function flint-is-number($n) {
38
- @return type-of($n) == "number";
39
- }
40
-
41
- // Checks if item is string
42
- //--------------------------------------------------------------------------------
43
- // @param $n [string] : value
44
- // -------------------------------------------------------------------------------
45
- // @return [bool]
46
-
47
- @function flint-is-string($n) {
48
- @return type-of($n) == "string";
49
- }
50
-
51
- // Checks if item is not string
52
- //--------------------------------------------------------------------------------
53
- // @param $n [string] : value
54
- // -------------------------------------------------------------------------------
55
- // @return [bool]
56
-
57
- @function flint-is-not-string($n) {
58
- @return type-of($n) != "string";
59
- }
60
-
61
- // Gets list of each breakpoint's key
62
- // -------------------------------------------------------------------------------
63
- // @return [list]
64
-
65
- @function flint-get-all-keys() {
66
- $all-keys: ();
67
-
68
- @for $i from 1 through (length(flint-map-fetch($flint, "config")) - 1) {
69
- $key: flint-steal-key($i);
70
- $all-keys: append($all-keys, $key, "comma");
71
- }
72
-
73
- @return $all-keys;
74
- }
75
-
76
- // Gets list of all breakpoints
77
- // -------------------------------------------------------------------------------
78
- // @return [list]
79
-
80
- @function flint-get-all-breakpoints() {
81
- $all-breakpoints: ();
82
-
83
- @each $map, $keys in map-get($flint, "config") {
84
- @each $key, $value in $keys {
85
- @if $key == "breakpoint" {
86
- $all-breakpoints: append($all-breakpoints, $value, "comma");
87
- }
88
- }
89
- }
90
-
91
- @return $all-breakpoints;
92
- }
93
-
94
- // Checks if passed $key is the highest breakpoint
95
- // -------------------------------------------------------------------------------
96
- // @dependence `flint-get-value()`
97
- // -------------------------------------------------------------------------------
98
- // @param $key [string] : alias of breakpoint
99
- // -------------------------------------------------------------------------------
100
- // @return [bool]
101
-
102
- @function flint-is-highest-breakpoint($key) {
103
- @if flint-get-value($key, "breakpoint") == max(flint-get-all-breakpoints()...) {
104
- @return true;
105
- } @else {
106
- @return false;
107
- }
108
- }
109
-
110
- // Checks if passed $key is the lowest breakpoint
111
- // -------------------------------------------------------------------------------
112
- // @dependence `flint-get-value()`
113
- // -------------------------------------------------------------------------------
114
- // @param $key [string] : alias of breakpoint
115
- // -------------------------------------------------------------------------------
116
- // @return [bool]
117
-
118
- @function flint-is-lowest-breakpoint($key) {
119
- @if flint-get-value($key, "breakpoint") == min(flint-get-all-breakpoints()...) {
120
- @return true;
121
- } @else {
122
- @return false;
123
- }
124
- }
125
-
126
- // Checks if $key is grid default
127
- // -------------------------------------------------------------------------------
128
- // @dependence `flint-get-value()`
129
- // -------------------------------------------------------------------------------
130
- // @param $key [string] : alias of breakpoint
131
- // -------------------------------------------------------------------------------
132
- // @return [bool]
133
-
134
- @function flint-is-default($key) {
135
- @if $key == flint-get-value("settings", "default") {
136
- @return true;
137
- } @else {
138
- @return false;
139
- }
140
- }
141
-
142
- // Gets all breakpoint column values
143
- // -------------------------------------------------------------------------------
144
- // @return [list]
145
-
146
- @function flint-get-all-columns() {
147
- $all-columns: ();
148
-
149
- @each $map, $keys in map-get($flint, "config") {
150
- @each $key, $value in $keys {
151
- @if $key == "columns" {
152
- $all-columns: append($all-columns, $value, "comma");
153
- }
154
- }
155
- }
156
-
157
- @return $all-columns;
158
- }
159
-
160
- // Returns the unit used in config
161
- // -------------------------------------------------------------------------------
162
- // @return [literal]
163
-
164
- @function flint-get-config-unit() {
165
- @return unit(flint-get-value("settings", "gutter"));
166
- }
167
-
168
- // Convert pixel value to em
169
- // -------------------------------------------------------------------------------
170
- // @param $target [number] : pixel value
171
- // @param $context [number] : context to divide by
172
- // -------------------------------------------------------------------------------
173
- // @return : em value of $target relative to $context
174
- // -------------------------------------------------------------------------------
175
-
176
- @function flint-to-em($target, $context: $flint__base-font-size) {
177
- @return ($target / $context) * 1em;
178
- }
179
-
180
- // Use Ruby functions in place of Sass functions where possiblre
181
- // to speed up performance, especially with string functions
182
- // -------------------------------------------------------------------------------
183
- // @return [bool]
184
-
185
- @function flint-use-ruby-functions() {
186
- @return flint_use_ruby() == true;
187
- }
1
+ // Returns truthiness of a value
2
+ // -------------------------------------------------------------------------------
3
+ // @param $value [literal] : value
4
+ // -------------------------------------------------------------------------------
5
+ // @return [bool]
6
+
7
+ @function flint-is-true($value) {
8
+ @return if($value == null, false, $value and $value != null and $value != "" and $value != ());
9
+ }
10
+
11
+ // Checks if item is map
12
+ //--------------------------------------------------------------------------------
13
+ // @param $n [map] : value
14
+ // -------------------------------------------------------------------------------
15
+ // @return [bool]
16
+
17
+ @function flint-is-map($n) {
18
+ @return type-of($n) == "map";
19
+ }
20
+
21
+ // Checks if item is list
22
+ //--------------------------------------------------------------------------------
23
+ // @param $n [list] : value
24
+ // -------------------------------------------------------------------------------
25
+ // @return [bool]
26
+
27
+ @function flint-is-list($n) {
28
+ @return type-of($n) == "list";
29
+ }
30
+
31
+ // Checks if item is number
32
+ //--------------------------------------------------------------------------------
33
+ // @param $n [number] : value
34
+ // -------------------------------------------------------------------------------
35
+ // @return [bool]
36
+
37
+ @function flint-is-number($n) {
38
+ @return type-of($n) == "number";
39
+ }
40
+
41
+ // Checks if item is string
42
+ //--------------------------------------------------------------------------------
43
+ // @param $n [string] : value
44
+ // -------------------------------------------------------------------------------
45
+ // @return [bool]
46
+
47
+ @function flint-is-string($n) {
48
+ @return type-of($n) == "string";
49
+ }
50
+
51
+ // Checks if item is not string
52
+ //--------------------------------------------------------------------------------
53
+ // @param $n [string] : value
54
+ // -------------------------------------------------------------------------------
55
+ // @return [bool]
56
+
57
+ @function flint-is-not-string($n) {
58
+ @return type-of($n) != "string";
59
+ }
60
+
61
+ // Gets list of each breakpoint's key
62
+ // -------------------------------------------------------------------------------
63
+ // @return [list]
64
+
65
+ @function flint-get-all-keys() {
66
+ $all-keys: ();
67
+
68
+ @for $i from 1 through (length(flint-map-fetch($flint, "config")) - 1) {
69
+ $key: flint-steal-key($i);
70
+ $all-keys: append($all-keys, $key, "comma");
71
+ }
72
+
73
+ @return $all-keys;
74
+ }
75
+
76
+ // Gets list of all breakpoints
77
+ // -------------------------------------------------------------------------------
78
+ // @return [list]
79
+
80
+ @function flint-get-all-breakpoints() {
81
+ $all-breakpoints: ();
82
+
83
+ @each $map, $keys in map-get($flint, "config") {
84
+ @each $key, $value in $keys {
85
+ @if $key == "breakpoint" {
86
+ $all-breakpoints: append($all-breakpoints, $value, "comma");
87
+ }
88
+ }
89
+ }
90
+
91
+ @return $all-breakpoints;
92
+ }
93
+
94
+ // Checks if passed $key is the highest breakpoint
95
+ // -------------------------------------------------------------------------------
96
+ // @param $key [string] : alias of breakpoint
97
+ // -------------------------------------------------------------------------------
98
+ // @return [bool]
99
+
100
+ @function flint-is-highest-breakpoint($key) {
101
+ @if flint-get-value($key, "breakpoint") == max(flint-get-all-breakpoints()...) {
102
+ @return true;
103
+ } @else {
104
+ @return false;
105
+ }
106
+ }
107
+
108
+ // Checks if passed $key is the lowest breakpoint
109
+ // -------------------------------------------------------------------------------
110
+ // @param $key [string] : alias of breakpoint
111
+ // -------------------------------------------------------------------------------
112
+ // @return [bool]
113
+
114
+ @function flint-is-lowest-breakpoint($key) {
115
+ @if flint-get-value($key, "breakpoint") == min(flint-get-all-breakpoints()...) {
116
+ @return true;
117
+ } @else {
118
+ @return false;
119
+ }
120
+ }
121
+
122
+ // Checks if $key is grid default
123
+ // -------------------------------------------------------------------------------
124
+ // @param $key [string] : alias of breakpoint
125
+ // -------------------------------------------------------------------------------
126
+ // @return [bool]
127
+
128
+ @function flint-is-default($key) {
129
+ @if $key == flint-get-value("settings", "default") {
130
+ @return true;
131
+ } @else {
132
+ @return false;
133
+ }
134
+ }
135
+
136
+ // Gets all breakpoint column values
137
+ // -------------------------------------------------------------------------------
138
+ // @return [list]
139
+
140
+ @function flint-get-all-columns() {
141
+ $all-columns: ();
142
+
143
+ @each $map, $keys in map-get($flint, "config") {
144
+ @each $key, $value in $keys {
145
+ @if $key == "columns" {
146
+ $all-columns: append($all-columns, $value, "comma");
147
+ }
148
+ }
149
+ }
150
+
151
+ @return $all-columns;
152
+ }
153
+
154
+ // Returns the unit used in config
155
+ // -------------------------------------------------------------------------------
156
+ // @return [literal]
157
+
158
+ @function flint-get-config-unit() {
159
+ @return unit(flint-get-value("settings", "gutter"));
160
+ }
161
+
162
+ // Convert pixel value to em
163
+ // -------------------------------------------------------------------------------
164
+ // @param $target [number] : pixel value
165
+ // @param $context [number] : context to divide by
166
+ // -------------------------------------------------------------------------------
167
+ // @return : em value of $target relative to $context
168
+ // -------------------------------------------------------------------------------
169
+
170
+ @function flint-to-em($target, $context: $flint__base-font-size) {
171
+ @return ($target / $context) * 1em;
172
+ }
173
+
174
+ // Use Ruby functions in place of Sass functions where possible
175
+ // to speed up performance, especially with string functions
176
+ // -------------------------------------------------------------------------------
177
+ // @return [bool]
178
+
179
+ @function flint-use-ruby-functions() {
180
+ @return flint_use_ruby() == true;
181
+ }