@medyll/cssfabric 0.2.0 → 0.2.3

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 (211) hide show
  1. package/.github/workflows/main.yml +33 -0
  2. package/.idea/cssfabric.iml +11 -0
  3. package/.idea/misc.xml +9 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/.vscode/settings.json +24 -0
  7. package/bin/index.js +8 -0
  8. package/cssfabric.sass.js +8 -0
  9. package/gulpfile.js +532 -0
  10. package/package.json +17 -61
  11. package/src/app.css +107 -0
  12. package/src/app.d.ts +15 -0
  13. package/src/app.html +13 -0
  14. package/src/components/Header.svelte +17 -0
  15. package/src/components/HeaderSiteTitle.svelte +12 -0
  16. package/src/components/InnerMenu.svelte +27 -0
  17. package/src/components/SubHeader.svelte +10 -0
  18. package/src/components/SubHeaderH.svelte +3 -0
  19. package/src/components/SubSubHeader.svelte +22 -0
  20. package/src/components/demo/DemoElement.svelte +86 -0
  21. package/src/components/demo/elements/DemoElementBackgroundColor.svelte +7 -0
  22. package/src/components/demo/elements/DemoElementBorder.svelte +8 -0
  23. package/src/components/demo/elements/DemoElementBorderColor.svelte +8 -0
  24. package/src/components/demo/elements/DemoElementColor.svelte +8 -0
  25. package/src/components/demo/elements/DemoElementGrid.svelte +53 -0
  26. package/src/components/demo/elements/DemoElementMargin.svelte +8 -0
  27. package/src/components/demo/elements/DemoElementPadding.svelte +10 -0
  28. package/src/components/demo/elements/DemoElementScale.svelte +9 -0
  29. package/src/components/demo/elements/DemoElementTable.svelte +34 -0
  30. package/src/components/demo/elements/DemoElementText.svelte +10 -0
  31. package/src/components/demo/proxy/ProxyDsp.svelte +12 -0
  32. package/src/components/demo/proxy/ProxyDspArray.svelte +19 -0
  33. package/src/components/demo/proxy/ProxyDspObject.svelte +17 -0
  34. package/src/components/docs/Docs.svelte +97 -0
  35. package/src/components/docs/DocsClassNames.svelte +34 -0
  36. package/src/components/docs/DocsDemo.svelte +84 -0
  37. package/src/components/header/Header.svelte +105 -0
  38. package/src/components/header/svelte-logo.svg +1 -0
  39. package/src/cssfabric/_utils.scss +203 -0
  40. package/{_generated → src/cssfabric}/index.d.ts +0 -0
  41. package/src/cssfabric/modules/_cssfabric-config.scss +173 -0
  42. package/src/cssfabric/modules/_mixins.scss +1 -0
  43. package/src/cssfabric/modules/animation/_animation-vars.scss +17 -0
  44. package/src/cssfabric/modules/animation/animation.scss +3 -0
  45. package/src/cssfabric/modules/base/_base-vars.scss +19 -0
  46. package/src/cssfabric/modules/base/base.scss +75 -0
  47. package/src/cssfabric/modules/box/_box-build.scss +304 -0
  48. package/src/cssfabric/modules/box/_box-vars.scss +121 -0
  49. package/src/cssfabric/modules/box/box-responsive.scss +18 -0
  50. package/src/cssfabric/modules/box/box.scss +3 -0
  51. package/src/cssfabric/modules/color/_color-build.scss +196 -0
  52. package/src/cssfabric/modules/color/_color-vars.scss +80 -0
  53. package/src/cssfabric/modules/color/color-responsive.scss +23 -0
  54. package/src/cssfabric/modules/color/color.scss +9 -0
  55. package/src/cssfabric/modules/css-fabric.scss +2 -0
  56. package/src/cssfabric/modules/flex/_flex-build.scss +150 -0
  57. package/src/cssfabric/modules/flex/_flex-vars.scss +84 -0
  58. package/src/cssfabric/modules/flex/flex-responsive.scss +25 -0
  59. package/src/cssfabric/modules/flex/flex.scss +3 -0
  60. package/src/cssfabric/modules/grid/_grid-build.scss +84 -0
  61. package/src/cssfabric/modules/grid/_grid-vars.scss +88 -0
  62. package/src/cssfabric/modules/grid/grid-responsive.scss +25 -0
  63. package/src/cssfabric/modules/grid/grid.scss +6 -0
  64. package/src/cssfabric/modules/menu/_menu-build.scss +120 -0
  65. package/src/cssfabric/modules/menu/_menu-vars.scss +29 -0
  66. package/src/cssfabric/modules/menu/menu-responsive.scss +19 -0
  67. package/src/cssfabric/modules/menu/menu.scss +6 -0
  68. package/src/cssfabric/modules/overflow/_overflow-build.scss +22 -0
  69. package/src/cssfabric/modules/overflow/_overflow-vars.scss +31 -0
  70. package/src/cssfabric/modules/overflow/overflow-responsive.scss +25 -0
  71. package/src/cssfabric/modules/overflow/overflow.scss +7 -0
  72. package/src/cssfabric/modules/scale/_scale-build.scss +142 -0
  73. package/src/cssfabric/modules/scale/_scale-vars.scss +84 -0
  74. package/src/cssfabric/modules/scale/scale-responsive.scss +23 -0
  75. package/src/cssfabric/modules/scale/scale.scss +8 -0
  76. package/src/cssfabric/modules/table/_table-build.scss +134 -0
  77. package/src/cssfabric/modules/table/_table-vars.scss +30 -0
  78. package/src/cssfabric/modules/table/table-responsive.scss +24 -0
  79. package/src/cssfabric/modules/table/table.scss +8 -0
  80. package/src/cssfabric/modules/text/_text-build.scss +166 -0
  81. package/src/cssfabric/modules/text/_text-vars.scss +87 -0
  82. package/src/cssfabric/modules/text/text-responsive.scss +26 -0
  83. package/src/cssfabric/modules/text/text.scss +6 -0
  84. package/src/cssfabric/modules/theme/_theme-build.scss +133 -0
  85. package/src/cssfabric/modules/theme/_theme-vars.scss +46 -0
  86. package/src/cssfabric/modules/theme/theme.scss +6 -0
  87. package/src/cssfabric/modules/vars.scss +49 -0
  88. package/src/cssfabric/modules/zindex/_zindex-vars.scss +14 -0
  89. package/src/cssfabric/modules/zindex/zindex.scss +15 -0
  90. package/src/hooks.ts +27 -0
  91. package/src/index.d.ts +3 -0
  92. package/src/index.ts +4 -0
  93. package/{_generated → src/lib/_generated}/cssFabric.vars.json +1 -1
  94. package/{_generated → src/lib/_generated}/export.variables.md +0 -0
  95. package/src/lib/_generated/index.d.ts +3 -0
  96. package/{_generated → src/lib/_generated}/readme.md +0 -0
  97. package/{init/importCssVars.js → src/lib/init/importCssVars.ts} +3 -2
  98. package/src/lib/scripts/cssfabric.ts +54 -0
  99. package/{scripts/cssfabricClassNames.js → src/lib/scripts/cssfabricClassNames.ts} +112 -42
  100. package/{scripts → src/lib/scripts}/index.d.ts +0 -0
  101. package/src/lib/scripts/index.ts +8 -0
  102. package/src/lib/scripts/utils.ts +37 -0
  103. package/{styles → src/lib/styles}/animation/animation.css +0 -0
  104. package/{styles → src/lib/styles}/animation/animation.min.css +0 -0
  105. package/{styles → src/lib/styles}/base/base.css +0 -0
  106. package/{styles → src/lib/styles}/base/base.min.css +0 -0
  107. package/{styles → src/lib/styles}/box/box.css +0 -0
  108. package/{styles → src/lib/styles}/box/box.min.css +0 -0
  109. package/{styles → src/lib/styles}/box/box.responsive.css +0 -0
  110. package/{styles → src/lib/styles}/box/box.responsive.min.css +0 -0
  111. package/{styles → src/lib/styles}/color/color.css +0 -0
  112. package/{styles → src/lib/styles}/color/color.min.css +0 -0
  113. package/{styles → src/lib/styles}/color/color.responsive.css +0 -0
  114. package/{styles → src/lib/styles}/color/color.responsive.min.css +0 -0
  115. package/src/lib/styles/cssfabric.css +129144 -0
  116. package/src/lib/styles/cssfabric.min.css +350 -0
  117. package/src/lib/styles/cssfabric.responsive.css +418463 -0
  118. package/src/lib/styles/cssfabric.responsive.min.css +225 -0
  119. package/{styles → src/lib/styles}/flex/flex.css +0 -0
  120. package/{styles → src/lib/styles}/flex/flex.min.css +0 -0
  121. package/{styles → src/lib/styles}/flex/flex.responsive.css +0 -0
  122. package/{styles → src/lib/styles}/flex/flex.responsive.min.css +0 -0
  123. package/{styles → src/lib/styles}/grid/grid.css +0 -0
  124. package/{styles → src/lib/styles}/grid/grid.min.css +0 -0
  125. package/{styles → src/lib/styles}/grid/grid.responsive.css +0 -0
  126. package/{styles → src/lib/styles}/grid/grid.responsive.min.css +0 -0
  127. package/{styles → src/lib/styles}/menu/menu.css +0 -0
  128. package/{styles → src/lib/styles}/menu/menu.min.css +0 -0
  129. package/{styles → src/lib/styles}/menu/menu.responsive.css +0 -0
  130. package/{styles → src/lib/styles}/menu/menu.responsive.min.css +0 -0
  131. package/{styles → src/lib/styles}/overflow/overflow.css +0 -0
  132. package/{styles → src/lib/styles}/overflow/overflow.min.css +0 -0
  133. package/{styles → src/lib/styles}/overflow/overflow.responsive.css +0 -0
  134. package/{styles → src/lib/styles}/overflow/overflow.responsive.min.css +0 -0
  135. package/{styles → src/lib/styles}/scale/scale.css +0 -0
  136. package/{styles → src/lib/styles}/scale/scale.min.css +0 -0
  137. package/{styles → src/lib/styles}/scale/scale.responsive.css +0 -0
  138. package/{styles → src/lib/styles}/scale/scale.responsive.min.css +0 -0
  139. package/{styles → src/lib/styles}/table/table.css +0 -0
  140. package/{styles → src/lib/styles}/table/table.min.css +0 -0
  141. package/{styles → src/lib/styles}/table/table.responsive.css +0 -0
  142. package/{styles → src/lib/styles}/table/table.responsive.min.css +0 -0
  143. package/{styles → src/lib/styles}/text/text.css +0 -0
  144. package/{styles → src/lib/styles}/text/text.min.css +0 -0
  145. package/{styles → src/lib/styles}/text/text.responsive.css +0 -0
  146. package/{styles → src/lib/styles}/text/text.responsive.min.css +0 -0
  147. package/{styles → src/lib/styles}/theme/theme.css +48 -0
  148. package/{styles → src/lib/styles}/theme/theme.min.css +1 -1
  149. package/{styles → src/lib/styles}/vars.css +1 -1
  150. package/{styles → src/lib/styles}/vars.min.css +0 -0
  151. package/{styles → src/lib/styles}/zindex/zindex.css +0 -0
  152. package/{styles → src/lib/styles}/zindex/zindex.min.css +0 -0
  153. package/src/routes/__layout.svelte +91 -0
  154. package/src/routes/cssfabric-modules/[module]/__layout.svelte +75 -0
  155. package/src/routes/cssfabric-modules/[module]/classnames/index.svelte +24 -0
  156. package/src/routes/cssfabric-modules/[module]/demo/index.svelte +24 -0
  157. package/src/routes/cssfabric-modules/[module]/docs/index.svelte +30 -0
  158. package/src/routes/cssfabric-modules/[module]/index.svelte +3 -0
  159. package/src/routes/cssfabric-modules/__layout.svelte +26 -0
  160. package/src/routes/cssfabric-modules/index.svelte +0 -0
  161. package/src/routes/index.svelte +62 -0
  162. package/src/routes/installation/__layout.svelte +1 -0
  163. package/src/routes/installation/index.svelte +28 -0
  164. package/src/scripts/utils.ts +26 -0
  165. package/src/utils.ts +71 -0
  166. package/src/vendor/index.d.ts +3 -0
  167. package/src/vendor/normalize/normalize.min.css +2 -0
  168. package/src/vendor/sass-json-export/CHANGELOG.md +26 -0
  169. package/src/vendor/sass-json-export/Gruntfile.js +60 -0
  170. package/src/vendor/sass-json-export/LICENSE +20 -0
  171. package/src/vendor/sass-json-export/README.md +90 -0
  172. package/src/vendor/sass-json-export/package.json +60 -0
  173. package/src/vendor/sass-json-export/stylesheets/encode/api/_json.scss +26 -0
  174. package/src/vendor/sass-json-export/stylesheets/encode/encode.scss +17 -0
  175. package/src/vendor/sass-json-export/stylesheets/encode/helpers/_quote.scss +9 -0
  176. package/src/vendor/sass-json-export/stylesheets/encode/mixins/_json.scss +42 -0
  177. package/src/vendor/sass-json-export/stylesheets/encode/types/_bool.scss +7 -0
  178. package/src/vendor/sass-json-export/stylesheets/encode/types/_color.scss +8 -0
  179. package/src/vendor/sass-json-export/stylesheets/encode/types/_list.scss +14 -0
  180. package/src/vendor/sass-json-export/stylesheets/encode/types/_map.scss +15 -0
  181. package/src/vendor/sass-json-export/stylesheets/encode/types/_null.scss +7 -0
  182. package/src/vendor/sass-json-export/stylesheets/encode/types/_number.scss +8 -0
  183. package/src/vendor/sass-json-export/stylesheets/encode/types/_string.scss +8 -0
  184. package/src/vendor/sass-json-export/stylesheets/sass-json-export.scss +2 -0
  185. package/src/vendor/sass-json-export/test/encode/_index.scss +14 -0
  186. package/src/vendor/sass-json-export/test/encode/api/_json.scss +29 -0
  187. package/src/vendor/sass-json-export/test/encode/helpers/_quote.scss +6 -0
  188. package/src/vendor/sass-json-export/test/encode/types/_bool.scss +6 -0
  189. package/src/vendor/sass-json-export/test/encode/types/_color.scss +7 -0
  190. package/src/vendor/sass-json-export/test/encode/types/_list.scss +25 -0
  191. package/src/vendor/sass-json-export/test/encode/types/_map.scss +17 -0
  192. package/src/vendor/sass-json-export/test/encode/types/_null.scss +8 -0
  193. package/src/vendor/sass-json-export/test/encode/types/_number.scss +68 -0
  194. package/src/vendor/sass-json-export/test/encode/types/_string.scss +9 -0
  195. package/src/vendor/sass-json-export/test/test.scss +9 -0
  196. package/static/favicon.png +0 -0
  197. package/static/robots.txt +3 -0
  198. package/svelte.config.js +25 -0
  199. package/tsconfig.json +3 -0
  200. package/webpack.config.js +55 -0
  201. package/init/importCssVars.d.ts +0 -1
  202. package/scripts/cssfabric.d.ts +0 -24
  203. package/scripts/cssfabric.js +0 -43
  204. package/scripts/cssfabricClassNames.d.ts +0 -14
  205. package/scripts/index.js +0 -4
  206. package/scripts/utils.d.ts +0 -5
  207. package/scripts/utils.js +0 -38
  208. package/styles/cssfabric.css +0 -61792
  209. package/styles/cssfabric.min.css +0 -168
  210. package/styles/cssfabric.responsive.css +0 -200596
  211. package/styles/cssfabric.responsive.min.css +0 -108
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+ * `2.0.1`: Resolve Sass deprecation warnings (Sass 3.5+) -- [#3](https://github.com/oddbird/sass-json-export/pull/3).
3
+ * `2.0.0`: Removed json-decode and changed name to `sass-json-export`.
4
+ * `1.1.8`: Solved an issue with tabs
5
+ * `1.1.7`: Included cosmetic changes made after linting with [scss-lint](https://github.com/causes/scss-lint)
6
+ * `1.1.6`: JSON files that are loaded via `@import "data.json?varname` can be pretty printed now.
7
+ * `1.1.5`: Fixed `json-encode` mixin to keep `body::before` in the render tree. Making it possible to access via `getComputedStyle(document.body, ':before')`
8
+ * `1.1.4`: Small fix for the `npm` release
9
+ * `1.1.3`: fixed error in `_pow` introduced after updating to Sass 3.3.0.rc.3
10
+ * `1.1.2`: Made it possible to import JSON files via `@import 'relative/path/to/file.json?variable-name'`
11
+ * `1.1.1`: fixing a minor issue with the gem
12
+ * `1.1.0`: adding the ability to import a JSON file
13
+ * `1.0.11`: fixing an issue with scientific number parsing
14
+ * `1.0.10`: improving number and string helpers
15
+ * `1.0.9`: fixing a bug in `_find-exponent`
16
+ * `1.0.8`: fixing a major issue in Ruby Gem
17
+ * `1.0.7`: minor fixes and stable Ruby Gem
18
+ * `1.0.6`: released a Ruby Gem
19
+ * `1.0.5`: improved the encoding mixin
20
+ * `1.0.4`: fixed an error in map parsing
21
+ * `1.0.3`: slightly edited the mixin to dump JSON to CSS
22
+ * `1.0.2`: fixed an issue with string parsing
23
+ * `1.0.1`: fixed an issue with alpha color parsing
24
+ * `1.0.0`: Stable API. `json-encode` and `json-decode`
25
+ * `0.0.2`: added `json-decode` and test
26
+ * `0.0.1`: initial commit
@@ -0,0 +1,60 @@
1
+ module.exports = function(grunt) {
2
+
3
+ // Modules
4
+ grunt.loadNpmTasks('bootcamp');
5
+ grunt.loadNpmTasks('grunt-contrib-watch');
6
+ grunt.loadNpmTasks('grunt-sass');
7
+ grunt.loadNpmTasks('grunt-sass-lint');
8
+
9
+ // Grunt Tasks
10
+ grunt.initConfig({
11
+ dir : {
12
+ src : 'stylesheets',
13
+ },
14
+ pkg: grunt.file.readJSON('package.json'),
15
+
16
+ // Sass
17
+ sass: {
18
+ options: {
19
+ outputStyle: 'expanded',
20
+ includePaths: ['./node_modules/bootcamp/dist', './<%= dir.src %>']
21
+ },
22
+ all: {
23
+ files: {
24
+ './tmp/all.css': './test/test.scss'
25
+ }
26
+ }
27
+ },
28
+
29
+ sasslint : {
30
+ all: {
31
+ src : ['<%= dir.src %>/**/*']
32
+ }
33
+ },
34
+
35
+ // Bootcamp
36
+ bootcamp: {
37
+ all: {
38
+ files: {
39
+ src: ['./tmp/all.css']
40
+ }
41
+ }
42
+ },
43
+
44
+ // Watch
45
+ watch: {
46
+ all: {
47
+ files: [
48
+ './test/**/*.scss',
49
+ './<%= dir.src %>/**/*.scss'
50
+ ],
51
+ tasks: ['test']
52
+ }
53
+ }
54
+ });
55
+
56
+ // Tasks
57
+ grunt.registerTask('test', ['sasslint', 'sass', 'bootcamp']);
58
+ grunt.registerTask('dev', ['test', 'watch']);
59
+ grunt.registerTask('default', ['test']);
60
+ };
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014-2015 Hugo Giraudel and contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ 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, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,90 @@
1
+ # sass-json-export [![npm version](https://badge.fury.io/js/sass-json-export.svg)](https://badge.fury.io/js/sass-json-export) [![Circle CI](https://circleci.com/gh/oddbird/sass-json-export.svg?style=svg)](https://circleci.com/gh/oddbird/sass-json-export)
2
+
3
+ `sass-json-export` allows you to export your Sass data structures as JSON.
4
+
5
+ It is based on Hugo Giraudel's
6
+ [SassyJSON](https://github.com/HugoGiraudel/SassyJSON), which is
7
+ [no longer maintained](https://github.com/HugoGiraudel/SassyJSON/issues/91). It
8
+ is simplified to include only the JSON exporter from SassyJSON, and not the
9
+ (much more complex) JSON parser.
10
+
11
+ ## Install
12
+
13
+ sass-json-export is available on [npm](https://npmjs.org/).
14
+
15
+ ### Git
16
+
17
+ ``` git
18
+ git clone https://github.com/oddbird/sass-json-export.git && cd sass-json-export
19
+ ```
20
+
21
+ ### npm
22
+
23
+ ``` bash
24
+ npm install sass-json-export --save-dev
25
+ ```
26
+
27
+ ## Example
28
+
29
+ ### Encoding Sass to JSON
30
+
31
+ #### Sass
32
+
33
+ ``` scss
34
+ $map: ((a: (1 2 ( b : 1 )), b: ( #444444, false, ( a: 1, b: test ) ), c: (2 3 4 string)));
35
+
36
+ @include json-encode($map);
37
+ ```
38
+
39
+ #### CSS
40
+
41
+ ``` css
42
+ /*! json-encode: '{"a": [1, 2, {"b": 1}], "b": ["#444444", false, {"a": 1, "b": "test"}], "c": [2, 3, 4, "string"]}' */
43
+
44
+ body::before {
45
+ display:block;
46
+ width:0;height:0;
47
+ overflow:hidden;
48
+ content: '{"a": [1, 2, {"b": 1}], "b": ["#444444", false, {"a": 1, "b": "test"}], "c": [2, 3, 4, "string"]}';
49
+ }
50
+
51
+ head {
52
+ font-family: '{"a": [1, 2, {"b": 1}], "b": ["#444444", false, {"a": 1, "b": "test"}], "c": [2, 3, 4, "string"]}';
53
+ }
54
+
55
+ @media -json-encode {
56
+ json {
57
+ json: '{"a": [1, 2, {"b": 1}], "b": ["#444444", false, {"a": 1, "b": "test"}], "c": [2, 3, 4, "string"]}';
58
+ }
59
+ }
60
+ ```
61
+
62
+ If you want to restrict the output to only one of the three drivers (comment,
63
+ media query or regular output) you can pass a flag as the second parameter with
64
+ one of the four following keywords: `all`, `comment`, `media` or
65
+ `regular`. Default is `all`.
66
+
67
+ ## Requirements
68
+
69
+ All you need is Sass 3.3+. Otherwise it's just pure Sass madness.
70
+
71
+ ## Development
72
+
73
+ ### You need
74
+
75
+ * [NodeJS](http://nodejs.org)
76
+ * Sass 3.3
77
+ * `grunt-cli` via `npm install -g grunt-cli`
78
+
79
+ ### How to
80
+
81
+ 1. Fork this repository
82
+ 2. Run `npm install`
83
+ 3. `grunt dev`
84
+ 4. Make your changes + write tests
85
+ 5. Commit + Pull request
86
+
87
+ ## Credits
88
+
89
+ * [Fabrice Weinberg](http://twitter.com/fweinb)
90
+ * [Hugo Giraudel](http://twitter.com/hugogiraudel)
@@ -0,0 +1,60 @@
1
+ {
2
+ "_from": "sass-json-export",
3
+ "_id": "sass-json-export@2.0.1",
4
+ "_inBundle": false,
5
+ "_integrity": "sha512-xNoOlN+36MKOnNxB/zQ09s6vZH6WmC/u9lXJ9FAbTf65lRJNyT2sPRS1iqKopLb9ZbdXfukpvHzh1n1/BkqVdA==",
6
+ "_location": "/sass-json-export",
7
+ "_phantomChildren": {},
8
+ "_requested": {
9
+ "type": "tag",
10
+ "registry": true,
11
+ "raw": "sass-json-export",
12
+ "name": "sass-json-export",
13
+ "escapedName": "sass-json-export",
14
+ "rawSpec": "",
15
+ "saveSpec": null,
16
+ "fetchSpec": "latest"
17
+ },
18
+ "_requiredBy": [
19
+ "#DEV:/",
20
+ "#USER"
21
+ ],
22
+ "_resolved": "https://registry.npmjs.org/sass-json-export/-/sass-json-export-2.0.1.tgz",
23
+ "_shasum": "265d822db87d5c1a12cc3934531404b889bbf26b",
24
+ "_spec": "sass-json-export",
25
+ "_where": "D:\\boulot\\app-node\\cssfabric",
26
+ "author": {
27
+ "name": "Hugo Giraudel, Fabrice Weinberg"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/oddbird/sass-json-export/issues"
31
+ },
32
+ "bundleDependencies": false,
33
+ "dependencies": {},
34
+ "deprecated": false,
35
+ "description": "Export your Sass data structures to JSON.",
36
+ "devDependencies": {
37
+ "bootcamp": "^1.1.7",
38
+ "grunt": "^0.4.5",
39
+ "grunt-contrib-watch": "^0.6.1",
40
+ "grunt-sass": "^1.1.0",
41
+ "grunt-sass-lint": "0.1.0-beta.4"
42
+ },
43
+ "homepage": "https://github.com/oddbird/sass-json-export",
44
+ "keywords": [
45
+ "sass",
46
+ "scss",
47
+ "json"
48
+ ],
49
+ "license": "MIT",
50
+ "maintainer": "OddBird",
51
+ "name": "sass-json-export",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/oddbird/sass-json-export.git"
55
+ },
56
+ "scripts": {
57
+ "test": "grunt test"
58
+ },
59
+ "version": "2.0.1"
60
+ }
@@ -0,0 +1,26 @@
1
+ /// Delay the encoding of ta literal to JSON to a type-specific method
2
+ /// @access public
3
+ /// @param {*} $value - value to be stringified
4
+ /// @throw Unknown type for #{$value} (#{$type}).
5
+ /// @return {String} - JSON encoded string
6
+ /// @require {function} _json-encode--string
7
+ /// @require {function} _json-encode--number
8
+ /// @require {function} _json-encode--list
9
+ /// @require {function} _json-encode--map
10
+ /// @require {function} _json-encode--null
11
+ /// @require {function} _json-encode--color
12
+ /// @require {function} _json-encode--bool
13
+ @function json-encode($value) {
14
+ $type: type-of($value);
15
+ $function: '_json-encode--#{$type}';
16
+
17
+ @if function-exists('get-function') {
18
+ $function: get-function($function);
19
+ }
20
+
21
+ @if function-exists('_json-encode--#{$type}') {
22
+ @return call($function, $value);
23
+ }
24
+
25
+ @error 'Unknown type for #{$value} (#{$type}).';
26
+ }
@@ -0,0 +1,17 @@
1
+ // Helpers
2
+ @import 'helpers/quote';
3
+
4
+ // Type specific encoding functions
5
+ @import 'types/bool';
6
+ @import 'types/color';
7
+ @import 'types/list';
8
+ @import 'types/map';
9
+ @import 'types/number';
10
+ @import 'types/string';
11
+ @import 'types/null';
12
+
13
+ // Public API
14
+ @import 'api/json';
15
+
16
+ // Mixin to pass the string to the DOM
17
+ @import 'mixins/json';
@@ -0,0 +1,9 @@
1
+ /// Proof quote a value
2
+ /// @access private
3
+ /// @param {*} $value - value to be quoted
4
+ /// @return {String} - quoted value
5
+
6
+ @function _proof-quote($value) {
7
+ // $value: to-string($value);
8
+ @return '"#{$value}"';
9
+ }
@@ -0,0 +1,42 @@
1
+ /// JSON.stringify a value and pass it as a font-family of head element
2
+ /// @access public
3
+ /// @param {*} $value - value to be stringified
4
+ /// @param {String} $flag (all) - output driver
5
+ /// @require {function} json-encode
6
+ @mixin json-encode($value, $flag: 'all',$root: null) {
7
+ $flag: if(index('all' 'regular' 'media' 'comment', $flag), $flag, 'all');
8
+ $json: if($root,"{\""+$root+"\":"+json-encode($value)+"}",json-encode($value));
9
+
10
+ // Persistent comment
11
+ @if $flag == 'comment' or $flag == 'all' {
12
+ /*! json-encode: #{$json} */
13
+ }
14
+ // Regular property value pair
15
+ @if $flag == 'regular' or $flag == 'all' {
16
+ // All browsers except IE8-
17
+ body {
18
+ &::before {
19
+ // This element must be in the render tree to get it via getComputedStyle(document.body, ':before');
20
+ content: json-encode($value);
21
+ display: block;
22
+ height: 0;
23
+ overflow: hidden;
24
+ width: 0;
25
+ }
26
+ }
27
+
28
+ // All browsers except Opera (Presto based)
29
+ head {
30
+ font-family: json-encode($value);
31
+ }
32
+ }
33
+
34
+ // Falsy media query
35
+ @if $flag == 'media' or $flag == 'all' {
36
+ @media -json-encode {
37
+ json {
38
+ json: $json;
39
+ }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,7 @@
1
+ /// Encode a bool to JSON
2
+ /// @access private
3
+ /// @param {Bool} $bool - bool to be encoded
4
+ /// @return {Bool} - encoded bool
5
+ @function _json-encode--bool($boolean) {
6
+ @return $boolean;
7
+ }
@@ -0,0 +1,8 @@
1
+ /// Encode a color to JSON
2
+ /// @access private
3
+ /// @param {Color} $color - color to be encoded
4
+ /// @return {String} - encoded color
5
+ /// @require {function} _proof-quote
6
+ @function _json-encode--color($color) {
7
+ @return _proof-quote($color);
8
+ }
@@ -0,0 +1,14 @@
1
+ /// Encode a list to JSON
2
+ /// @access private
3
+ /// @param {List} $list - list to be encoded
4
+ /// @return {String} - encoded list
5
+ /// @require {function} json-encore
6
+ @function _json-encode--list($list) {
7
+ $str: '';
8
+
9
+ @each $item in $list {
10
+ $str: $str + ', ' + json-encode($item);
11
+ }
12
+
13
+ @return '[' + str-slice($str, 3) + ']';
14
+ }
@@ -0,0 +1,15 @@
1
+ /// Encode a map to JSON
2
+ /// @access private
3
+ /// @param {Map} $map - map to be encoded
4
+ /// @return {String} - encoded map
5
+ /// @require {function} _proof-quote
6
+ /// @require {function} json-encode
7
+ @function _json-encode--map($map) {
8
+ $str: '';
9
+
10
+ @each $key, $value in $map {
11
+ $str: $str + ', ' + _proof-quote($key) + ': ' + json-encode($value);
12
+ }
13
+
14
+ @return '{' + str-slice($str, 3) + '}';
15
+ }
@@ -0,0 +1,7 @@
1
+ /// Encode `null` to JSON
2
+ /// @access private
3
+ /// @param {Null} $null - `null`
4
+ /// @return {String}
5
+ @function _json-encode--null($null) {
6
+ @return 'null';
7
+ }
@@ -0,0 +1,8 @@
1
+ /// Encode a number to JSON
2
+ /// @access private
3
+ /// @param {Number} $number - number to be encoded
4
+ /// @return {String} - encoded number
5
+ /// @require {function} _proof-quote
6
+ @function _json-encode--number($number) {
7
+ @return if(unitless($number), $number, _proof-quote($number));
8
+ }
@@ -0,0 +1,8 @@
1
+ /// Encode a string to JSON
2
+ /// @access private
3
+ /// @param {String} $string - string to be encoded
4
+ /// @return {String} - encoded string
5
+ /// @require {function} _proof-quote
6
+ @function _json-encode--string($string) {
7
+ @return _proof-quote($string);
8
+ }
@@ -0,0 +1,2 @@
1
+ // Encoder
2
+ @import 'encode/encode';
@@ -0,0 +1,14 @@
1
+ // Helpers
2
+ @import 'helpers/quote';
3
+
4
+ // Types
5
+ @import 'types/string';
6
+ @import 'types/number';
7
+ @import 'types/color';
8
+ @import 'types/bool';
9
+ @import 'types/list';
10
+ @import 'types/map';
11
+ @import 'types/null';
12
+
13
+ // API
14
+ @import 'api/json';
@@ -0,0 +1,29 @@
1
+ @include describe('The json-encode function') {
2
+ @include it('should return the same as json-encode--bool for a boolean') {
3
+ @include should(expect(json-encode(true)), to(equal(_json-encode--bool(true))));
4
+ }
5
+ @include it('should return the same as json-encode--string for a string') {
6
+ @include should(expect(json-encode('test')), to(equal(_json-encode--string('test'))));
7
+ }
8
+ @include it('should return the same as json-encode--color for a color') {
9
+ @include should(expect(json-encode(#000)), to(equal(_json-encode--color('#000'))));
10
+ }
11
+ @include it('should return the same as json-encode--number for a number') {
12
+ @include should(expect(json-encode(1)), to(equal(_json-encode--number(1))));
13
+ }
14
+ @include it('should return the same as json-encode--list for a list') {
15
+ @include should(expect(json-encode(1 2 3)), to(equal(_json-encode--list((1 2 3)))));
16
+ }
17
+ @include it('should return the same as json-encode--map for a map') {
18
+ @include should(expect(json-encode((a: 1, b: 2, c: 3))), to(equal(_json-encode--map((a: 1, b: 2, c: 3)))));
19
+ }
20
+
21
+ @include it('should handle some complicated map') {
22
+ $map-all: (a: (1 (a: (1 2 ( b: (1 2 3 4) )), b: ( #444, false, ( a: 1, b: test ) ), c: (2 3 4 string)) ( b: 1 )), b: ( #444, false, ( a: 1, b: test ) ), c: (2 (a: (1 2 ( b: 1 )), b: ( #444, false, ( a: 1, b: test ) ), c: (2 3 4 string)) 4 string));
23
+ @include should(expect(json-encode($map-all)), to(equal('{"a": [1, {"a": [1, 2, {"b": [1, 2, 3, 4]}], "b": ["#444", false, {"a": 1, "b": "test"}], "c": [2, 3, 4, "string"]}, {"b": 1}], "b": ["#444", false, {"a": 1, "b": "test"}], "c": [2, {"a": [1, 2, {"b": 1}], "b": ["#444", false, {"a": 1, "b": "test"}], "c": [2, 3, 4, "string"]}, 4, "string"]}')));
24
+ }
25
+ @include it('should handle null correctly') {
26
+ $map-with-null: (a: null);
27
+ @include should(expect(json-encode($map-with-null)), to(equal('{"a": null}')));
28
+ }
29
+ }
@@ -0,0 +1,6 @@
1
+ @include describe('The _proof-quote function') {
2
+ @include it('should return a quoted string') {
3
+ @include should(expect(_proof-quote('test')), to(equal('"test"')));
4
+ @include should(expect(_proof-quote(1)), to(equal('"1"')));
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ @include describe('The _json-encode--bool function') {
2
+ @include it('should return the unchanged boolean') {
3
+ @include should(expect(_json-encode--bool(true)), to(equal(true)));
4
+ @include should(expect(_json-encode--bool(false)), to(equal(false)));
5
+ }
6
+ }
@@ -0,0 +1,7 @@
1
+ @include describe('The _json-encode--color function') {
2
+ @include it('should return a sass interpreted color wrapped in quotes') {
3
+ @include should(expect(_json-encode--color(#000)), to(equal('"#000"')));
4
+ @include should(expect(_json-encode--color(rgba(255, 255, 225, 1))), to(equal('"#ffffe1"')));
5
+ @include should(expect(_json-encode--color(rgba(255, 255, 225, 0.5))), to(equal('"rgba(255, 255, 225, 0.5)"')));
6
+ }
7
+ }
@@ -0,0 +1,25 @@
1
+ @include describe('The _json-encode--list function') {
2
+ @include it('should return a JSON like array string') {
3
+ @include should(expect(_json-encode--list(1 2 3)), to(equal('[1, 2, 3]')));
4
+ @include should(expect(_json-encode--list(a b c)), to(equal('["a", "b", "c"]')));
5
+ @include should(expect(_json-encode--list(true false true)), to(equal('[true, false, true]')));
6
+ }
7
+
8
+ @include it('should encode sass datatypes to strings') {
9
+ @include should(expect(_json-encode--list(#000 green blue)), to(equal('["#000", "green", "blue"]')));
10
+ }
11
+
12
+ @include it('should properly encode a list with commas to JSON') {
13
+ @include should(expect(_json-encode--list((1, 2, 3))), to(equal('[1, 2, 3]')));
14
+ @include should(expect(_json-encode--list((a, b, c))), to(equal('["a", "b", "c"]')));
15
+ @include should(expect(_json-encode--list((true, false, true))), to(equal('[true, false, true]')));
16
+ @include should(expect(_json-encode--list((#333, #444, #555))), to(equal('["#333", "#444", "#555"]')));
17
+ }
18
+
19
+ @include it('should properly encode nested lists to JSON') {
20
+ @include should(expect(_json-encode--list((1 2 (3 4 5 (6 7) 8) 9))), to(equal('[1, 2, [3, 4, 5, [6, 7], 8], 9]')));
21
+ @include should(expect(_json-encode--list((a b (c d e (f g) h) i))), to(equal('["a", "b", ["c", "d", "e", ["f", "g"], "h"], "i"]')));
22
+ @include should(expect(_json-encode--list((true (false true (false true) true false)))), to(equal('[true, [false, true, [false, true], true, false]]')));
23
+ @include should(expect(_json-encode--list((#333 (#444 #555 #666) (#555 (#444 #333))))), to(equal('["#333", ["#444", "#555", "#666"], ["#555", ["#444", "#333"]]]')));
24
+ }
25
+ }
@@ -0,0 +1,17 @@
1
+ @include describe('The _json-encode--map function') {
2
+ $map: (a: 1, b: 2, c: 3);
3
+ $map-nested: (a: (b: 1 2 (c: test)));
4
+ $map-full: (a: (1 2 ( b: 1 )), b: ( #444, false, ( a: 1, b: test ) ), c: (2 3 4 string));
5
+
6
+ @include it('should return a JSON object string') {
7
+ @include should(expect(_json-encode--map($map)), to(equal('{"a": 1, "b": 2, "c": 3}')));
8
+ }
9
+
10
+ @include it('should return a JSON object string for nested maps') {
11
+ @include should(expect(_json-encode--map($map-nested)), to(equal('{"a": {"b": [1, 2, {"c": "test"}]}}')));
12
+ }
13
+
14
+ @include it('should interpolate sass datatypes') {
15
+ @include should(expect(_json-encode--map($map-full)), to(equal('{"a": [1, 2, {"b": 1}], "b": ["#444", false, {"a": 1, "b": "test"}], "c": [2, 3, 4, "string"]}')));
16
+ }
17
+ }
@@ -0,0 +1,8 @@
1
+ @include describe('The _json-encode--null function') {
2
+ @include it('should return a string null for every input') {
3
+ @include should(expect(_json-encode--null(true)), to(equal('null')));
4
+ @include should(expect(_json-encode--null(false)), to(equal('null')));
5
+ @include should(expect(_json-encode--null(1)), to(equal('null')));
6
+ @include should(expect(_json-encode--null(null)), to(equal('null')));
7
+ }
8
+ }
@@ -0,0 +1,68 @@
1
+ @include describe('The _json-encode--number function') {
2
+ @include it('should return a number if input is unitless') {
3
+ @include should(expect(_json-encode--number(42)), to(equal(42)));
4
+ @include should(expect(_json-encode--number(13.37)), to(equal(13.37)));
5
+ @include should(expect(_json-encode--number(-42)), to(equal(-42)));
6
+ @include should(expect(_json-encode--number(-13.37)), to(equal(-13.37)));
7
+ }
8
+
9
+ @include it('should return encode a number to number type') {
10
+ @include should(expect(type-of(_json-encode--number(42))), to(equal('number')));
11
+ @include should(expect(type-of(_json-encode--number(13.37))), to(equal('number')));
12
+ @include should(expect(type-of(_json-encode--number(-42))), to(equal('number')));
13
+ @include should(expect(type-of(_json-encode--number(-13.37))), to(equal('number')));
14
+ }
15
+
16
+ @include it('should return a string if input has a unit') {
17
+ $test-1: _json-encode--number(1%);
18
+ $test-2: _json-encode--number(1in);
19
+ $test-3: _json-encode--number(1px);
20
+ $test-4: _json-encode--number(1em);
21
+ $test-5: _json-encode--number(1mm);
22
+ $test-6: _json-encode--number(1cm);
23
+ $test-7: _json-encode--number(1pt);
24
+ $test-8: _json-encode--number(1pc);
25
+ $test-9: _json-encode--number(1ex);
26
+ $test-10: _json-encode--number(1ch);
27
+ $test-11: _json-encode--number(1vh);
28
+ $test-12: _json-encode--number(1vw);
29
+ $test-13: _json-encode--number(1rem);
30
+ $test-14: _json-encode--number(1vmin);
31
+ $test-15: _json-encode--number(1vmax);
32
+ $test-16: _json-encode--number(1pica);
33
+
34
+ @include should(expect($test-1), to(equal('"1%"')));
35
+ @include should(expect($test-2), to(equal('"1in"')));
36
+ @include should(expect($test-3), to(equal('"1px"')));
37
+ @include should(expect($test-4), to(equal('"1em"')));
38
+ @include should(expect($test-5), to(equal('"1mm"')));
39
+ @include should(expect($test-6), to(equal('"1cm"')));
40
+ @include should(expect($test-7), to(equal('"1pt"')));
41
+ @include should(expect($test-8), to(equal('"1pc"')));
42
+ @include should(expect($test-9), to(equal('"1ex"')));
43
+ @include should(expect($test-10), to(equal('"1ch"')));
44
+ @include should(expect($test-11), to(equal('"1vh"')));
45
+ @include should(expect($test-12), to(equal('"1vw"')));
46
+ @include should(expect($test-13), to(equal('"1rem"')));
47
+ @include should(expect($test-14), to(equal('"1vmin"')));
48
+ @include should(expect($test-15), to(equal('"1vmax"')));
49
+ @include should(expect($test-16), to(equal('"1pica"')));
50
+
51
+ @include should(expect(type-of($test-1)), to(equal('string')));
52
+ @include should(expect(type-of($test-2)), to(equal('string')));
53
+ @include should(expect(type-of($test-3)), to(equal('string')));
54
+ @include should(expect(type-of($test-4)), to(equal('string')));
55
+ @include should(expect(type-of($test-5)), to(equal('string')));
56
+ @include should(expect(type-of($test-6)), to(equal('string')));
57
+ @include should(expect(type-of($test-7)), to(equal('string')));
58
+ @include should(expect(type-of($test-8)), to(equal('string')));
59
+ @include should(expect(type-of($test-9)), to(equal('string')));
60
+ @include should(expect(type-of($test-10)), to(equal('string')));
61
+ @include should(expect(type-of($test-11)), to(equal('string')));
62
+ @include should(expect(type-of($test-12)), to(equal('string')));
63
+ @include should(expect(type-of($test-13)), to(equal('string')));
64
+ @include should(expect(type-of($test-14)), to(equal('string')));
65
+ @include should(expect(type-of($test-15)), to(equal('string')));
66
+ @include should(expect(type-of($test-16)), to(equal('string')));
67
+ }
68
+ }
@@ -0,0 +1,9 @@
1
+ @include describe('The _json-encode--string function') {
2
+ @include it('should return a quoted string') {
3
+ @include should(expect(_json-encode--string('test')), to(equal('"test"')));
4
+ @include should(expect(_json-encode--string(test)), to(equal('"test"')));
5
+ @include should(expect(_json-encode--string('1')), to(equal('"1"')));
6
+ @include should(expect(_json-encode--string('true')), to(equal('"true"')));
7
+ @include should(expect(_json-encode--string('false')), to(equal('"false"')));
8
+ }
9
+ }