flint-gs 2.3.6 → 2.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -21
  3. data/README.md +99 -98
  4. data/lib/flint-gs.rb +8 -0
  5. data/lib/flint.rb +22 -16
  6. data/lib/flint/functions.rb +99 -99
  7. data/lib/flint/version.rb +3 -3
  8. data/stylesheets/_flint.scss +7 -7
  9. data/stylesheets/flint/config/_config.scss +56 -56
  10. data/stylesheets/flint/functions/_functions.scss +48 -48
  11. data/stylesheets/flint/functions/helpers/_helpers.scss +229 -229
  12. data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +47 -47
  13. data/stylesheets/flint/functions/lib/_calc-width.scss +70 -70
  14. data/stylesheets/flint/functions/lib/_fluid-width.scss +15 -15
  15. data/stylesheets/flint/functions/lib/_get-index.scss +21 -21
  16. data/stylesheets/flint/functions/lib/_get-instance-value.scss +15 -15
  17. data/stylesheets/flint/functions/lib/_get-value.scss +14 -14
  18. data/stylesheets/flint/functions/lib/_has-family-instance.scss +84 -84
  19. data/stylesheets/flint/functions/lib/_html-encode.scss +14 -14
  20. data/stylesheets/flint/functions/lib/_instance.scss +48 -48
  21. data/stylesheets/flint/functions/lib/_last.scss +14 -14
  22. data/stylesheets/flint/functions/lib/_list-to-str.scss +38 -38
  23. data/stylesheets/flint/functions/lib/_map-fetch.scss +31 -31
  24. data/stylesheets/flint/functions/lib/_next-index.scss +14 -14
  25. data/stylesheets/flint/functions/lib/_purge.scss +24 -24
  26. data/stylesheets/flint/functions/lib/_remove.scss +18 -18
  27. data/stylesheets/flint/functions/lib/_replace.scss +30 -30
  28. data/stylesheets/flint/functions/lib/_steal-key.scss +32 -32
  29. data/stylesheets/flint/functions/lib/_steal-values.scss +15 -15
  30. data/stylesheets/flint/functions/lib/_str-replace.scss +39 -39
  31. data/stylesheets/flint/functions/lib/_str-to-list.scss +89 -89
  32. data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +37 -37
  33. data/stylesheets/flint/functions/lib/_support-syntax.scss +31 -31
  34. data/stylesheets/flint/functions/lib/_types-in-list.scss +76 -76
  35. data/stylesheets/flint/functions/lib/_use-syntax.scss +22 -22
  36. data/stylesheets/flint/globals/_globals.scss +122 -122
  37. data/stylesheets/flint/mixins/_mixins.scss +11 -11
  38. data/stylesheets/flint/mixins/lib/_box-sizing.scss +18 -18
  39. data/stylesheets/flint/mixins/lib/_calculate.scss +241 -241
  40. data/stylesheets/flint/mixins/lib/_clearfix.scss +29 -29
  41. data/stylesheets/flint/mixins/lib/_container.scss +45 -45
  42. data/stylesheets/flint/mixins/lib/_grid-overlay.scss +73 -73
  43. data/stylesheets/flint/mixins/lib/_main.scss +1057 -1057
  44. data/stylesheets/flint/mixins/lib/_new-instance.scss +28 -28
  45. data/stylesheets/flint/mixins/lib/_print-instance.scss +44 -44
  46. data/tests/config.rb +22 -34
  47. data/tests/input/functions/_functions.scss +47 -47
  48. data/tests/input/functions/helpers/_helpers.scss +437 -437
  49. data/tests/input/functions/lib/_calc-breakpoint.scss +62 -62
  50. data/tests/input/functions/lib/_calc-width.scss +195 -195
  51. data/tests/input/functions/lib/_fluid-width.scss +32 -32
  52. data/tests/input/functions/lib/_get-index.scss +31 -31
  53. data/tests/input/functions/lib/_get-instance-value.scss +72 -72
  54. data/tests/input/functions/lib/_get-value.scss +28 -28
  55. data/tests/input/functions/lib/_has-family-instance.scss +35 -35
  56. data/tests/input/functions/lib/_instance.scss +187 -187
  57. data/tests/input/functions/lib/_last.scss +18 -18
  58. data/tests/input/functions/lib/_list-to-str.scss +28 -28
  59. data/tests/input/functions/lib/_map-fetch.scss +34 -34
  60. data/tests/input/functions/lib/_next-index.scss +24 -24
  61. data/tests/input/functions/lib/_purge.scss +14 -14
  62. data/tests/input/functions/lib/_remove.scss +14 -14
  63. data/tests/input/functions/lib/_replace.scss +14 -14
  64. data/tests/input/functions/lib/_steal-key.scss +19 -19
  65. data/tests/input/functions/lib/_steal-values.scss +16 -16
  66. data/tests/input/functions/lib/_str-replace.scss +14 -14
  67. data/tests/input/functions/lib/_str-to-list.scss +28 -28
  68. data/tests/input/functions/lib/_support-syntax-bem.scss +14 -14
  69. data/tests/input/functions/lib/_support-syntax.scss +21 -21
  70. data/tests/input/functions/lib/_types-in-list.scss +50 -50
  71. data/tests/input/functions/lib/_use-syntax.scss +14 -14
  72. data/tests/input/output.scss +250 -250
  73. data/tests/output/output.css +3499 -3499
  74. data/tests/tests.html +110 -110
  75. metadata +12 -212
  76. data/tests/bootcamp/CHANGELOG.md +0 -70
  77. data/tests/bootcamp/CONTRIBUTING.md +0 -72
  78. data/tests/bootcamp/Gruntfile.coffee +0 -34
  79. data/tests/bootcamp/LICENSE.md +0 -7
  80. data/tests/bootcamp/README.md +0 -52
  81. data/tests/bootcamp/bower.json +0 -15
  82. data/tests/bootcamp/dist/_bootcamp.scss +0 -46
  83. data/tests/bootcamp/dist/bootcamp.coffee +0 -101
  84. data/tests/bootcamp/dist/core/functions/_actual.scss +0 -3
  85. data/tests/bootcamp/dist/core/functions/_error.scss +0 -29
  86. data/tests/bootcamp/dist/core/functions/_expect.scss +0 -6
  87. data/tests/bootcamp/dist/core/functions/_not-to.scss +0 -5
  88. data/tests/bootcamp/dist/core/functions/_should.scss +0 -6
  89. data/tests/bootcamp/dist/core/functions/_to.scss +0 -5
  90. data/tests/bootcamp/dist/core/mixins/_describe.scss +0 -31
  91. data/tests/bootcamp/dist/core/mixins/_it.scss +0 -31
  92. data/tests/bootcamp/dist/core/mixins/_runner.scss +0 -28
  93. data/tests/bootcamp/dist/core/mixins/_should.scss +0 -46
  94. data/tests/bootcamp/dist/core/mixins/_xdescribe.scss +0 -9
  95. data/tests/bootcamp/dist/core/mixins/_xit.scss +0 -9
  96. data/tests/bootcamp/dist/core/variables/_helpers.scss +0 -5
  97. data/tests/bootcamp/dist/core/variables/_settings.scss +0 -2
  98. data/tests/bootcamp/dist/core/variables/_should.scss +0 -6
  99. data/tests/bootcamp/dist/core/variables/_trackers.scss +0 -6
  100. data/tests/bootcamp/dist/lib/_sassyjson.scss +0 -1075
  101. data/tests/bootcamp/dist/matchers/_be.scss +0 -3
  102. data/tests/bootcamp/dist/matchers/_equal.scss +0 -3
  103. data/tests/bootcamp/dist/matchers/lists/_be-empty.scss +0 -3
  104. data/tests/bootcamp/dist/matchers/lists/_be-longer-than.scss +0 -3
  105. data/tests/bootcamp/dist/matchers/lists/_be-shorter-than.scss +0 -3
  106. data/tests/bootcamp/dist/matchers/lists/_contain.scss +0 -3
  107. data/tests/bootcamp/dist/matchers/lists/_deep-contain.scss +0 -3
  108. data/tests/bootcamp/dist/matchers/lists/_deep-equal.scss +0 -47
  109. data/tests/bootcamp/dist/matchers/lists/_have-length-of.scss +0 -3
  110. data/tests/bootcamp/dist/matchers/numbers/_be-close-to.scss +0 -12
  111. data/tests/bootcamp/dist/matchers/numbers/_be-greater-than.scss +0 -12
  112. data/tests/bootcamp/dist/matchers/numbers/_be-less-than.scss +0 -12
  113. data/tests/bootcamp/dist/matchers/types/_be-falsy.scss +0 -3
  114. data/tests/bootcamp/dist/matchers/types/_be-null.scss +0 -3
  115. data/tests/bootcamp/dist/matchers/types/_be-truthy.scss +0 -3
  116. data/tests/bootcamp/dist/matchers/types/_have-type-of.scss +0 -3
  117. data/tests/bootcamp/dist/utils/_contain.scss +0 -15
  118. data/tests/bootcamp/dist/utils/_equal.scss +0 -23
  119. data/tests/bootcamp/dist/utils/_list-join.scss +0 -35
  120. data/tests/bootcamp/dist/utils/_power.scss +0 -15
  121. data/tests/bootcamp/package.json +0 -63
  122. data/tests/bootcamp/tasks/bootcamp.coffee +0 -83
  123. data/tests/bootcamp/test/core/functions/_actual.scss +0 -10
  124. data/tests/bootcamp/test/core/functions/_expect.scss +0 -6
  125. data/tests/bootcamp/test/core/functions/_not-to.scss +0 -5
  126. data/tests/bootcamp/test/core/functions/_should.scss +0 -10
  127. data/tests/bootcamp/test/core/functions/_to.scss +0 -5
  128. data/tests/bootcamp/test/core/mixins/_describe.scss +0 -11
  129. data/tests/bootcamp/test/core/mixins/_it.scss +0 -5
  130. data/tests/bootcamp/test/core/mixins/_should.scss +0 -5
  131. data/tests/bootcamp/test/core/mixins/_xdescribe.scss +0 -28
  132. data/tests/bootcamp/test/core/mixins/_xit.scss +0 -12
  133. data/tests/bootcamp/test/matchers/_be.scss +0 -90
  134. data/tests/bootcamp/test/matchers/_equal.scss +0 -33
  135. data/tests/bootcamp/test/matchers/lists/_be-empty.scss +0 -12
  136. data/tests/bootcamp/test/matchers/lists/_be-longer-than.scss +0 -29
  137. data/tests/bootcamp/test/matchers/lists/_be-shorter-than.scss +0 -29
  138. data/tests/bootcamp/test/matchers/lists/_contain.scss +0 -39
  139. data/tests/bootcamp/test/matchers/lists/_deep-contain.scss +0 -51
  140. data/tests/bootcamp/test/matchers/lists/_deep-equal.scss +0 -151
  141. data/tests/bootcamp/test/matchers/lists/_have-length-of.scss +0 -31
  142. data/tests/bootcamp/test/matchers/numbers/_be-close-to.scss +0 -24
  143. data/tests/bootcamp/test/matchers/numbers/_be-greater-than.scss +0 -16
  144. data/tests/bootcamp/test/matchers/numbers/_be-less-than.scss +0 -16
  145. data/tests/bootcamp/test/matchers/types/_be-falsy.scss +0 -14
  146. data/tests/bootcamp/test/matchers/types/_be-null.scss +0 -13
  147. data/tests/bootcamp/test/matchers/types/_be-truthy.scss +0 -13
  148. data/tests/bootcamp/test/matchers/types/_have-type-of.scss +0 -17
  149. data/tests/bootcamp/test/specs.scss +0 -45
  150. data/tests/bootcamp/test/utils/_contain.scss +0 -41
  151. data/tests/bootcamp/test/utils/_equal.scss +0 -79
  152. data/tests/bootcamp/test/utils/_list-join.scss +0 -39
  153. data/tests/bootcamp/test/utils/_power.scss +0 -13
  154. data/tests/sass-prof.log +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04ab8c5b406e1036194b2eb4e90958a8c07f79bb
4
- data.tar.gz: f5db48383b53f3114d11c94bc18ff5a64b1aada4
3
+ metadata.gz: da3ec92bb2f4ff67d45ef97780e765c7f8374376
4
+ data.tar.gz: 737c9de82a35ab9df17646cf6107e2df2515bac1
5
5
  SHA512:
6
- metadata.gz: 69036ec25b836fcc4eff89344d1c045639eb7d2f6ffd7777fd0fe25fc309becdc2a2b66d47e7e81326f54308f879f83ab6a8450fe161c0770bc35ff7b13b801d
7
- data.tar.gz: 0baee9a78d8cfae3b93179097ed462cb0804a0696d4fe55ad851650ee29e66096002522597aabcf4e2d0865bdbe544bf2848b8caba8c85fc088a8ea8e5fdcaf8
6
+ metadata.gz: 8d3e8716713e4ed5a3222e310bc1ea631e696a231021dc7a4e680a7d6392aeb7f065d32808e1d6d515b504484ee2edbbb89cfae3028f85279247bfa366e9bf14
7
+ data.tar.gz: 4cb75a699c69ed570c3fab5d24ea38c410c542693e1a017483184357cc7d6c0e1361f6319650f166bea97d9d7a8920bfb3e5fac463c595af92dfd0750d6dc281
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Ezekiel Gabrielse
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Ezekiel Gabrielse
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,98 +1,99 @@
1
- [![Flint - Grid System](http://flint.gs/wp-content/themes/flint/images/logo.png)](http://flint.gs)
2
-
3
- [![Gem](https://img.shields.io/gem/v/flint-gs.svg?style=flat-square)](https://rubygems.org/gems/flint-gs)
4
- [![Bower](https://img.shields.io/bower/v/flint.svg?style=flat-square)](http://bower.io/search/?q=flint)
5
- [![GitHub license](https://img.shields.io/github/license/ezekg/flint.svg?style=flat-square)](https://github.com/ezekg/flint/blob/master/LICENSE)
6
-
7
- ## What is Flint?
8
- Flint is a responsive grid framework written in Sass, created to allow developers to rapidly produce responsive layouts that are built on a sophisticated foundation.
9
-
10
- ## What sets Flint apart?
11
- Most notably? The syntax. Being a designer myself, a large amount of time was spent on this aspect. Flint is very unique in the fact that it uses only a single mixin for all output: `_(...)`.
12
-
13
- Yes, it really is just an underscore. Easy to remember, huh? It shoves the function mumbo-jumbo out of the way and allows you to focus on the aspect that matters most: the actual layout. It also allows you to type your intentions in human terms.
14
-
15
- ```scss
16
- @include _(from tablet to desktop) { ... }
17
- ```
18
-
19
- In addition to that, as you can tell from the snippet above, Flint also handles your breakpoints for you. Long gone are the days that you need to download a separate plugin just so that you're able to create a truly responsive layout.
20
-
21
- Flint allows you create an unlimited number of breakpoints, all of which have their own alias, column count and breakpoint. Want to name your 10 breakpoints after James Bond villians? By all means, go ahead.
22
-
23
- One more cool thing? Flint is the only self-aware Sass grid system on the planet.* What does that mean? It means that every instance of Flint is logged into an 'instance map', so child elements can know their parent element's width; meaning we can have perfectly consistent gutters, no matter how odd your layout may be. Think of it as a self-correcting grid.
24
-
25
- [Check out this short introduction over at Sitepoint.com](http://www.sitepoint.com/rapid-responsive-development-sass-flint/), and take it for a spin on [SassMeister.com](http://sassmeister.com/gist/228449011362bcdfe38c)!
26
-
27
- Enjoy.
28
-
29
- ## Requirements
30
-
31
- * Sass ~> `3.4.0`
32
-
33
- ## Installation
34
-
35
- 1. Install via Ruby `gem install flint-gs`, or Bower `bower install flint --save-dev`
36
- 2. If you're using Compass, add `require "flint"` to your `config.rb`
37
- 3. Import it into your stylesheet with `@import "flint"`
38
-
39
- If you're not using Compass, you can require Flint and compile via cli:
40
- ```
41
- scss --require ./lib/flint.rb example.scss > example.css
42
- ```
43
-
44
- ## Documentation
45
-
46
- Documentation is located [here](http://flint.gs/docs).
47
-
48
- _Tip: For simple projects, disable `instance-maps`, as it is has a large overhead and will increase your compile times._
49
-
50
- ## Syntax support
51
-
52
- As of `1.6.0`, you can add syntax support for your preferred syntax. I built the system for BEM, but it should be easily extendable to
53
- support your preferred syntax. Simply create a function which parses a string of selectors into a valid list. For example, the BEM syntax
54
- function parses the selector string (for example, `.block__element__element`) like so,
55
-
56
- ```scss
57
- ///
58
- /// Parser to support BEM syntax
59
- ///
60
- /// @access private
61
- ///
62
- /// @param {List} $selectors - string of selectors to parse
63
- ///
64
- /// @return {List} - parsed list of selectors according to syntax
65
- ///
66
- /// @group Internal Functions
67
- ///
68
- @function flint-support-syntax-bem($selectors) { ... }
69
- ```
70
- [View Source](https://github.com/ezekg/flint/blob/master/stylesheets/flint/functions/lib/_support-syntax-bem.scss)
71
-
72
- This will be parsed into a list of selectors: `.block, .block__element, .block__element__element`. The list of selectors can then be used by the
73
- instance system to look up a selectors parent, etc. To support your own preferred syntax: create a `flint-support-syntax-<syntax-name>` function
74
- and hook into it through the config `"support-syntax": "<syntax-name>"` option -- the system will attempt to use the `call()` function in
75
- order to parse the selector string.
76
-
77
- #### Officially supported syntaxes
78
- * [BEM](http://bem.info/)
79
-
80
- If you use one that isn't here, let me know and I'll look into officially supporting it.
81
-
82
- ## Support
83
-
84
- You can tweet [@FlintGrid](https://twitter.com/FlintGrid) with any questions or issues and I'll look into it. Be sure to include a [Gist](https://gist.github.com) or a [SassMeister](http://sassmeister.com) link.
85
-
86
- ## Authors
87
-
88
- [Ezekiel Gabrielse](http://ezekielg.com)
89
-
90
- ## Contributing
91
-
92
- As an open-source project, contributions are more than welcome, they're extremely helpful and actively encouraged. If you see any room for improvement, open an [issue](https://github.com/ezekg/flint/issues) or submit a [pull request](https://github.com/ezekg/flint/pulls). Also, make sure to take a look at the [contributing doc](CONTRIBUTING.md).
93
-
94
- ## License
95
-
96
- Flint is available under the [MIT](http://opensource.org/licenses/MIT) license.
97
-
98
- _\* According to Wikipedia, not really. But, all jokes aside, it's pretty awesome._
1
+ [![Flint - Grid System](http://flint.gs/wp-content/themes/flint/images/logo.png)](http://flint.gs)
2
+
3
+ [![Gem](https://img.shields.io/gem/v/flint-gs.svg?style=flat-square)](https://rubygems.org/gems/flint-gs)
4
+ [![Bower](https://img.shields.io/bower/v/flint.svg?style=flat-square)](http://bower.io/search/?q=flint)
5
+ [![Travis](https://img.shields.io/travis/ezekg/flint.svg?style=flat-square)](https://travis-ci.org/ezekg/flint)
6
+ [![GitHub license](https://img.shields.io/github/license/ezekg/flint.svg?style=flat-square)](https://github.com/ezekg/flint/blob/master/LICENSE)
7
+
8
+ ## What is Flint?
9
+ Flint is a responsive grid framework written in Sass, created to allow developers to rapidly produce responsive layouts that are built on a sophisticated foundation.
10
+
11
+ ## What sets Flint apart?
12
+ Most notably? The syntax. Being a designer myself, a large amount of time was spent on this aspect. Flint is very unique in the fact that it uses only a single mixin for all output: `_(...)`.
13
+
14
+ Yes, it really is just an underscore. Easy to remember, huh? It shoves the function mumbo-jumbo out of the way and allows you to focus on the aspect that matters most: the actual layout. It also allows you to type your intentions in human terms.
15
+
16
+ ```scss
17
+ @include _(from tablet to desktop) { ... }
18
+ ```
19
+
20
+ In addition to that, as you can tell from the snippet above, Flint also handles your breakpoints for you. Long gone are the days that you need to download a separate plugin just so that you're able to create a truly responsive layout.
21
+
22
+ Flint allows you create an unlimited number of breakpoints, all of which have their own alias, column count and breakpoint. Want to name your 10 breakpoints after James Bond villians? By all means, go ahead.
23
+
24
+ One more cool thing? Flint is the only self-aware Sass grid system on the planet.* What does that mean? It means that every instance of Flint is logged into an 'instance map', so child elements can know their parent element's width; meaning we can have perfectly consistent gutters, no matter how odd your layout may be. Think of it as a self-correcting grid.
25
+
26
+ [Check out this short introduction over at Sitepoint.com](http://www.sitepoint.com/rapid-responsive-development-sass-flint/), and take it for a spin on [SassMeister.com](http://sassmeister.com/gist/228449011362bcdfe38c)!
27
+
28
+ Enjoy.
29
+
30
+ ## Requirements
31
+
32
+ * Sass ~> `3.4.0`
33
+
34
+ ## Installation
35
+
36
+ 1. Install via Ruby `gem install flint-gs`, or Bower `bower install flint --save-dev`
37
+ 2. If you're using Compass, add `require "flint"` to your `config.rb`
38
+ 3. Import it into your stylesheet with `@import "flint"`
39
+
40
+ If you're not using Compass, you can require Flint and compile via cli:
41
+ ```
42
+ scss --require ./lib/flint.rb example.scss > example.css
43
+ ```
44
+
45
+ ## Documentation
46
+
47
+ Documentation is located [here](http://flint.gs/docs).
48
+
49
+ _Tip: For simple projects, disable `instance-maps`, as it is has a large overhead and will increase your compile times._
50
+
51
+ ## Syntax support
52
+
53
+ As of `1.6.0`, you can add syntax support for your preferred syntax. I built the system for BEM, but it should be easily extendable to
54
+ support your preferred syntax. Simply create a function which parses a string of selectors into a valid list. For example, the BEM syntax
55
+ function parses the selector string (for example, `.block__element__element`) like so,
56
+
57
+ ```scss
58
+ ///
59
+ /// Parser to support BEM syntax
60
+ ///
61
+ /// @access private
62
+ ///
63
+ /// @param {List} $selectors - string of selectors to parse
64
+ ///
65
+ /// @return {List} - parsed list of selectors according to syntax
66
+ ///
67
+ /// @group Internal Functions
68
+ ///
69
+ @function flint-support-syntax-bem($selectors) { ... }
70
+ ```
71
+ [View Source](https://github.com/ezekg/flint/blob/master/stylesheets/flint/functions/lib/_support-syntax-bem.scss)
72
+
73
+ This will be parsed into a list of selectors: `.block, .block__element, .block__element__element`. The list of selectors can then be used by the
74
+ instance system to look up a selectors parent, etc. To support your own preferred syntax: create a `flint-support-syntax-<syntax-name>` function
75
+ and hook into it through the config `"support-syntax": "<syntax-name>"` option -- the system will attempt to use the `call()` function in
76
+ order to parse the selector string.
77
+
78
+ #### Officially supported syntaxes
79
+ * [BEM](http://bem.info/)
80
+
81
+ If you use one that isn't here, let me know and I'll look into officially supporting it.
82
+
83
+ ## Support
84
+
85
+ You can tweet [@FlintGrid](https://twitter.com/FlintGrid) with any questions or issues and I'll look into it. Be sure to include a [Gist](https://gist.github.com) or a [SassMeister](http://sassmeister.com) link.
86
+
87
+ ## Authors
88
+
89
+ [Ezekiel Gabrielse](http://ezekielg.com)
90
+
91
+ ## Contributing
92
+
93
+ As an open-source project, contributions are more than welcome, they're extremely helpful and actively encouraged. If you see any room for improvement, open an [issue](https://github.com/ezekg/flint/issues) or submit a [pull request](https://github.com/ezekg/flint/pulls). Also, make sure to take a look at the [contributing doc](CONTRIBUTING.md).
94
+
95
+ ## License
96
+
97
+ Flint is available under the [MIT](http://opensource.org/licenses/MIT) license.
98
+
99
+ _\* According to Wikipedia, not really. But, all jokes aside, it's pretty awesome._
@@ -0,0 +1,8 @@
1
+ # encoding: UTF-8
2
+
3
+ lib = File.expand_path "../../lib/", __FILE__
4
+ $:.unshift lib unless $:.include? lib
5
+
6
+ # FIXME: Fixes an issue with Rails integration due to the gem being named
7
+ # `flint-gs`, but the lib being named `flint` (issue #37)
8
+ require "flint"
@@ -1,16 +1,22 @@
1
- require "sass"
2
- require_relative "flint/version"
3
- require_relative "flint/functions"
4
-
5
- base_directory = File.expand_path(File.join(File.dirname(__FILE__), '..'))
6
- flint_stylesheets_path = File.join(base_directory, 'stylesheets')
7
-
8
- if (defined? Compass)
9
- Compass::Frameworks.register('flint', :path => base_directory)
10
- else
11
- ENV["SASS_PATH"] = [ENV["SASS_PATH"], flint_stylesheets_path].compact.join(File::PATH_SEPARATOR)
12
- end
13
-
14
- module Flint
15
- Sass::Script::Functions.send(:include, Flint)
16
- end
1
+ # encoding: UTF-8
2
+
3
+ lib = File.expand_path "../../lib/", __FILE__
4
+ $:.unshift lib unless $:.include? lib
5
+
6
+ require "sass"
7
+
8
+ require "flint/version"
9
+ require "flint/functions"
10
+
11
+ base_directory = File.expand_path(File.join(File.dirname(__FILE__), '..'))
12
+ flint_stylesheets_path = File.join(base_directory, 'stylesheets')
13
+
14
+ if (defined? Compass)
15
+ Compass::Frameworks.register('flint', :path => base_directory)
16
+ else
17
+ ENV["SASS_PATH"] = [ENV["SASS_PATH"], flint_stylesheets_path].compact.join(File::PATH_SEPARATOR)
18
+ end
19
+
20
+ module Flint
21
+ Sass::Script::Functions.send(:include, Flint)
22
+ end
@@ -1,99 +1,99 @@
1
- module Flint
2
-
3
- def self.declare(*args)
4
- Sass::Script::Functions.declare(*args)
5
- end
6
-
7
- #
8
- # Use ruby functions
9
- #
10
- # @return {Bool}
11
- #
12
- def flint_use_ruby()
13
- Sass::Script::Bool.new(true)
14
- end
15
-
16
- #
17
- # Fetch value from map
18
- #
19
- # @param {Map} map - map to fetch value from
20
- # @param {ArgList} keys - list of keys to traverse
21
- #
22
- # @return {*}
23
- #
24
- def flint_ruby_map_fetch(map, *keys)
25
- assert_type map, :Map, :map
26
-
27
- result = map
28
- keys.each { |key| result.nil? ? break : result = result.to_h.fetch(key, nil) }
29
-
30
- unless result.nil?
31
- result
32
- else
33
- Sass::Script::Bool.new(false)
34
- end
35
- end
36
- declare :flint_ruby_map_fetch, :args => [:map, :keys], :var_args => true
37
-
38
- #
39
- # Joins all elements of list with passed glue
40
- #
41
- # @param {List} list
42
- # @param {String} glue
43
- #
44
- # @return {String}
45
- #
46
- def flint_ruby_list_to_str(list, glue)
47
- assert_type list, :List, :list
48
- assert_type glue, :String, :glue
49
-
50
- arr = list.to_a.flatten.map { |item| item.value }
51
-
52
- Sass::Script::String.new(arr.join(glue.value))
53
- end
54
- declare :flint_ruby_list_to_str, :args => [:list, :glue]
55
-
56
- #
57
- # Turn string into a flat list
58
- #
59
- # @param {String} string - string to operate on
60
- # @param {String} separator - item to find which separates substrings
61
- # @param {String} ignore - removes remaining string beyond item
62
- #
63
- # @return {List}
64
- #
65
- def flint_ruby_str_to_list(string, separator, ignore)
66
- assert_type string, :String, :string
67
- assert_type separator, :String, :separator
68
- assert_type ignore, :String, :ignore
69
-
70
- # Remove everything after ignore, split with separator
71
- items = string.value[/[^#{ignore}]+/].split(separator.value)
72
-
73
- if items.count == 1
74
- Sass::Script::String.new(items[0], :comma)
75
- else
76
- Sass::Script::List.new(items.map { |i| Sass::Script::String.new(i) }, :comma)
77
- end
78
- end
79
- declare :flint_ruby_str_to_list, :args => [:string, :separator, :ignore]
80
-
81
- #
82
- # Replace substring with string
83
- #
84
- # @param {String} string - string that contains substring
85
- # @param {String} find - substring to replace
86
- # @param {String} replace - new string to replace sub with
87
- #
88
- # @return {String}
89
- #
90
- def flint_ruby_str_replace(string, find, replace)
91
- assert_type string, :String, :string
92
- assert_type find, :String, :find
93
- assert_type replace, :String, :replace
94
-
95
- Sass::Script::String.new(string.value.gsub(find.value, replace.value))
96
- end
97
- declare :flint_ruby_str_replace, :args => [:string, :find, :replace]
98
-
99
- end
1
+ module Flint
2
+
3
+ def self.declare(*args)
4
+ Sass::Script::Functions.declare(*args)
5
+ end
6
+
7
+ #
8
+ # Use ruby functions
9
+ #
10
+ # @return {Bool}
11
+ #
12
+ def flint_use_ruby()
13
+ Sass::Script::Bool.new(true)
14
+ end
15
+
16
+ #
17
+ # Fetch value from map
18
+ #
19
+ # @param {Map} map - map to fetch value from
20
+ # @param {ArgList} keys - list of keys to traverse
21
+ #
22
+ # @return {*}
23
+ #
24
+ def flint_ruby_map_fetch(map, *keys)
25
+ assert_type map, :Map, :map
26
+
27
+ result = map
28
+ keys.each { |key| result.nil? ? break : result = result.to_h.fetch(key, nil) }
29
+
30
+ unless result.nil?
31
+ result
32
+ else
33
+ Sass::Script::Bool.new(false)
34
+ end
35
+ end
36
+ declare :flint_ruby_map_fetch, :args => [:map, :keys], :var_args => true
37
+
38
+ #
39
+ # Joins all elements of list with passed glue
40
+ #
41
+ # @param {List} list
42
+ # @param {String} glue
43
+ #
44
+ # @return {String}
45
+ #
46
+ def flint_ruby_list_to_str(list, glue)
47
+ assert_type list, :List, :list
48
+ assert_type glue, :String, :glue
49
+
50
+ arr = list.to_a.flatten.map { |item| item.value }
51
+
52
+ Sass::Script::String.new(arr.join(glue.value))
53
+ end
54
+ declare :flint_ruby_list_to_str, :args => [:list, :glue]
55
+
56
+ #
57
+ # Turn string into a flat list
58
+ #
59
+ # @param {String} string - string to operate on
60
+ # @param {String} separator - item to find which separates substrings
61
+ # @param {String} ignore - removes remaining string beyond item
62
+ #
63
+ # @return {List}
64
+ #
65
+ def flint_ruby_str_to_list(string, separator, ignore)
66
+ assert_type string, :String, :string
67
+ assert_type separator, :String, :separator
68
+ assert_type ignore, :String, :ignore
69
+
70
+ # Remove everything after ignore, split with separator
71
+ items = string.value[/[^#{ignore}]+/].split(separator.value)
72
+
73
+ if items.count == 1
74
+ Sass::Script::String.new(items[0], :comma)
75
+ else
76
+ Sass::Script::List.new(items.map { |i| Sass::Script::String.new(i) }, :comma)
77
+ end
78
+ end
79
+ declare :flint_ruby_str_to_list, :args => [:string, :separator, :ignore]
80
+
81
+ #
82
+ # Replace substring with string
83
+ #
84
+ # @param {String} string - string that contains substring
85
+ # @param {String} find - substring to replace
86
+ # @param {String} replace - new string to replace sub with
87
+ #
88
+ # @return {String}
89
+ #
90
+ def flint_ruby_str_replace(string, find, replace)
91
+ assert_type string, :String, :string
92
+ assert_type find, :String, :find
93
+ assert_type replace, :String, :replace
94
+
95
+ Sass::Script::String.new(string.value.gsub(find.value, replace.value))
96
+ end
97
+ declare :flint_ruby_str_replace, :args => [:string, :find, :replace]
98
+
99
+ end