flint-gs 1.6.0 → 1.6.1

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.
Files changed (42) hide show
  1. data/LICENSE +21 -21
  2. data/README.md +900 -900
  3. data/lib/flint.rb +17 -17
  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 +178 -178
  8. data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +38 -38
  9. data/stylesheets/flint/functions/lib/_calc-margin.scss +31 -31
  10. data/stylesheets/flint/functions/lib/_calc-width.scss +44 -44
  11. data/stylesheets/flint/functions/lib/_exists.scss +21 -21
  12. data/stylesheets/flint/functions/lib/_fluid-width.scss +9 -9
  13. data/stylesheets/flint/functions/lib/_get-family-instance.scss +59 -59
  14. data/stylesheets/flint/functions/lib/_get-index.scss +14 -14
  15. data/stylesheets/flint/functions/lib/_get-instance-value.scss +19 -19
  16. data/stylesheets/flint/functions/lib/_get-substring.scss +23 -23
  17. data/stylesheets/flint/functions/lib/_get-value.scss +16 -16
  18. data/stylesheets/flint/functions/lib/_instance.scss +43 -43
  19. data/stylesheets/flint/functions/lib/_last.scss +8 -8
  20. data/stylesheets/flint/functions/lib/_list-to-string.scss +24 -24
  21. data/stylesheets/flint/functions/lib/_map-fetch.scss +33 -33
  22. data/stylesheets/flint/functions/lib/_next-index.scss +14 -14
  23. data/stylesheets/flint/functions/lib/_purge.scss +20 -20
  24. data/stylesheets/flint/functions/lib/_remove.scss +14 -14
  25. data/stylesheets/flint/functions/lib/_replace.scss +24 -24
  26. data/stylesheets/flint/functions/lib/_steal-key.scss +12 -12
  27. data/stylesheets/flint/functions/lib/_steal-values.scss +16 -16
  28. data/stylesheets/flint/functions/lib/_string-to-list.scss +84 -84
  29. data/stylesheets/flint/functions/lib/_string-to-number.scss +72 -72
  30. data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +25 -25
  31. data/stylesheets/flint/functions/lib/_support-syntax.scss +28 -28
  32. data/stylesheets/flint/functions/lib/_types-in-list.scss +120 -120
  33. data/stylesheets/flint/functions/lib/_use-syntax.scss +11 -11
  34. data/stylesheets/flint/globals/_globals.scss +22 -22
  35. data/stylesheets/flint/mixins/_mixins.scss +7 -7
  36. data/stylesheets/flint/mixins/lib/_calculate.scss +765 -765
  37. data/stylesheets/flint/mixins/lib/_clearfix.scss +18 -18
  38. data/stylesheets/flint/mixins/lib/_main.scss +910 -911
  39. data/stylesheets/flint/mixins/lib/_new-instance.scss +26 -26
  40. data/stylesheets/flint/mixins/lib/_print-instance.scss +41 -41
  41. metadata +21 -15
  42. checksums.yaml +0 -7
@@ -1,17 +1,17 @@
1
- require 'compass'
2
- extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
3
- Compass::Frameworks.register('flint', :path => extension_path)
4
-
5
- # Version is a number. If a version contains alphas, it will be created as a prerelease version
6
- # Date is in the form of YYYY-MM-DD
7
- module Flint
8
- VERSION = "1.6.0"
9
- DATE = "2014-07-03"
10
- end
11
-
12
- # Custom functions
13
- module Sass::Script::Functions
14
- def selector_string()
15
- return Sass::Script::String.new(environment.selector.to_s)
16
- end
17
- end
1
+ require 'compass'
2
+ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
3
+ Compass::Frameworks.register('flint', :path => extension_path)
4
+
5
+ # Version is a number. If a version contains alphas, it will be created as a prerelease version
6
+ # Date is in the form of YYYY-MM-DD
7
+ module Flint
8
+ VERSION = "1.6.1"
9
+ DATE = "2014-07-03"
10
+ end
11
+
12
+ # Custom functions
13
+ module Sass::Script::Functions
14
+ def selector_string()
15
+ return Sass::Script::String.new(environment.selector.to_s)
16
+ end
17
+ 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": false,
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/get-substring";
13
- @import "lib/steal-key";
14
- @import "lib/steal-values";
15
- // Calculations
16
- @import "lib/fluid-width";
17
- @import "lib/calc-width";
18
- @import "lib/calc-margin";
19
- @import "lib/calc-breakpoint";
20
- // Instance functions
21
- @import "lib/instance";
22
- @import "lib/get-family-instance";
23
- @import "lib/get-instance-value";
24
- // List functions
25
- @import "lib/list-to-string";
26
- @import "lib/types-in-list";
27
- @import "lib/next-index";
28
- @import "lib/purge";
29
- @import "lib/replace";
30
- @import "lib/remove";
31
- @import "lib/last";
32
- // String functions
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/get-substring";
13
+ @import "lib/steal-key";
14
+ @import "lib/steal-values";
15
+ // Calculations
16
+ @import "lib/fluid-width";
17
+ @import "lib/calc-width";
18
+ @import "lib/calc-margin";
19
+ @import "lib/calc-breakpoint";
20
+ // Instance functions
21
+ @import "lib/instance";
22
+ @import "lib/get-family-instance";
23
+ @import "lib/get-instance-value";
24
+ // List functions
25
+ @import "lib/list-to-string";
26
+ @import "lib/types-in-list";
27
+ @import "lib/next-index";
28
+ @import "lib/purge";
29
+ @import "lib/replace";
30
+ @import "lib/remove";
31
+ @import "lib/last";
32
+ // String functions
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,178 +1,178 @@
1
- // Returns truthiness of a value
2
- // -------------------------------------------------------------------------------
3
- // @param $value [literal] : value
4
- // -------------------------------------------------------------------------------
5
- // @return [bool]
6
-
7
- @function 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 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 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 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 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 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 get-all-keys() {
66
- $all-keys: ();
67
-
68
- @for $i from 1 through (length(map-fetch($flint, "config")) - 1) {
69
- $key: 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 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 `get-value()`
97
- // -------------------------------------------------------------------------------
98
- // @param $key [string] : alias of breakpoint
99
- // -------------------------------------------------------------------------------
100
- // @return [bool]
101
-
102
- @function is-highest-breakpoint($key) {
103
- @if get-value($key, "breakpoint") == max(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 `get-value()`
113
- // -------------------------------------------------------------------------------
114
- // @param $key [string] : alias of breakpoint
115
- // -------------------------------------------------------------------------------
116
- // @return [bool]
117
-
118
- @function is-lowest-breakpoint($key) {
119
- @if get-value($key, "breakpoint") == min(get-all-breakpoints()...) {
120
- @return true;
121
- } @else {
122
- @return false;
123
- }
124
- }
125
-
126
- // Checks if $key is grid default
127
- // -------------------------------------------------------------------------------
128
- // @dependence `get-value()`
129
- // -------------------------------------------------------------------------------
130
- // @param $key [string] : alias of breakpoint
131
- // -------------------------------------------------------------------------------
132
- // @return [bool]
133
-
134
- @function is-default($key) {
135
- @if $key == 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 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 get-config-unit() {
165
- @return unit(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 em($target, $context: $flint__base-font-size) {
177
- @return ($target / $context) * 1em;
178
- }
1
+ // Returns truthiness of a value
2
+ // -------------------------------------------------------------------------------
3
+ // @param $value [literal] : value
4
+ // -------------------------------------------------------------------------------
5
+ // @return [bool]
6
+
7
+ @function 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 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 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 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 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 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 get-all-keys() {
66
+ $all-keys: ();
67
+
68
+ @for $i from 1 through (length(map-fetch($flint, "config")) - 1) {
69
+ $key: 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 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 `get-value()`
97
+ // -------------------------------------------------------------------------------
98
+ // @param $key [string] : alias of breakpoint
99
+ // -------------------------------------------------------------------------------
100
+ // @return [bool]
101
+
102
+ @function is-highest-breakpoint($key) {
103
+ @if get-value($key, "breakpoint") == max(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 `get-value()`
113
+ // -------------------------------------------------------------------------------
114
+ // @param $key [string] : alias of breakpoint
115
+ // -------------------------------------------------------------------------------
116
+ // @return [bool]
117
+
118
+ @function is-lowest-breakpoint($key) {
119
+ @if get-value($key, "breakpoint") == min(get-all-breakpoints()...) {
120
+ @return true;
121
+ } @else {
122
+ @return false;
123
+ }
124
+ }
125
+
126
+ // Checks if $key is grid default
127
+ // -------------------------------------------------------------------------------
128
+ // @dependence `get-value()`
129
+ // -------------------------------------------------------------------------------
130
+ // @param $key [string] : alias of breakpoint
131
+ // -------------------------------------------------------------------------------
132
+ // @return [bool]
133
+
134
+ @function is-default($key) {
135
+ @if $key == 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 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 get-config-unit() {
165
+ @return unit(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 em($target, $context: $flint__base-font-size) {
177
+ @return ($target / $context) * 1em;
178
+ }