flint-gs 1.7.1 → 1.7.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.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -21
  3. data/README.md +906 -906
  4. data/lib/flint.rb +67 -77
  5. data/stylesheets/_flint.scss +6 -6
  6. data/stylesheets/flint/config/_config.scss +83 -83
  7. data/stylesheets/flint/functions/_functions.scss +40 -41
  8. data/stylesheets/flint/functions/helpers/_helpers.scss +181 -181
  9. data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +33 -33
  10. data/stylesheets/flint/functions/lib/_calc-margin.scss +57 -57
  11. data/stylesheets/flint/functions/lib/_calc-width.scss +50 -50
  12. data/stylesheets/flint/functions/lib/_exists.scss +22 -22
  13. data/stylesheets/flint/functions/lib/_fluid-width.scss +10 -10
  14. data/stylesheets/flint/functions/lib/_get-index.scss +13 -13
  15. data/stylesheets/flint/functions/lib/_get-instance-value.scss +17 -17
  16. data/stylesheets/flint/functions/lib/_get-value.scss +14 -14
  17. data/stylesheets/flint/functions/lib/_has-family-instance.scss +74 -74
  18. data/stylesheets/flint/functions/lib/_instance.scss +46 -46
  19. data/stylesheets/flint/functions/lib/_last.scss +9 -9
  20. data/stylesheets/flint/functions/lib/_list-to-string.scss +25 -25
  21. data/stylesheets/flint/functions/lib/_map-fetch.scss +30 -30
  22. data/stylesheets/flint/functions/lib/_next-index.scss +15 -15
  23. data/stylesheets/flint/functions/lib/_purge.scss +19 -19
  24. data/stylesheets/flint/functions/lib/_remove.scss +13 -13
  25. data/stylesheets/flint/functions/lib/_replace-substring.scss +34 -34
  26. data/stylesheets/flint/functions/lib/_replace.scss +25 -25
  27. data/stylesheets/flint/functions/lib/_steal-key.scss +13 -13
  28. data/stylesheets/flint/functions/lib/_steal-values.scss +14 -14
  29. data/stylesheets/flint/functions/lib/_string-to-list.scss +90 -90
  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 -119
  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 +16 -23
  42. data/stylesheets/flint/functions/lib/_string-to-number.scss +0 -77
data/lib/flint.rb CHANGED
@@ -1,77 +1,67 @@
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
+ 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.2"
9
+ DATE = "2014-07-14"
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
+ declare :string_to_list, [:string, :separator, :ignore]
65
+ declare :replace_substring, [:string, :find, :replace]
66
+
67
+ 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,40 @@
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-list";
34
+
35
+ // Support syntax
36
+ // ---
37
+ @import "lib/use-syntax";
38
+ @import "lib/support-syntax";
39
+ // Syntaxes
40
+ @import "lib/support-syntax-bem"