@medyll/cssfabric 0.2.0 → 0.2.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 (207) 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 +306 -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 +90 -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 +50 -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 +0 -0
  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/{styles → src/lib/styles}/cssfabric.css +0 -0
  116. package/{styles → src/lib/styles}/cssfabric.min.css +0 -0
  117. package/{styles → src/lib/styles}/cssfabric.responsive.css +0 -0
  118. package/{styles → src/lib/styles}/cssfabric.responsive.min.css +0 -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 +0 -0
  148. package/{styles → src/lib/styles}/theme/theme.min.css +0 -0
  149. package/{styles → src/lib/styles}/vars.css +0 -0
  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
@@ -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
+ }
@@ -0,0 +1,9 @@
1
+ @import 'bootcamp';
2
+ @import 'sass-json-export';
3
+
4
+ @include runner-start;
5
+
6
+ // Encoder
7
+ @import 'encode/index';
8
+
9
+ @include runner-end;
Binary file
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -0,0 +1,25 @@
1
+ import adapter from '@sveltejs/adapter-auto';
2
+ import preprocess from 'svelte-preprocess';
3
+
4
+ /** @type {import('@sveltejs/kit').Config} */
5
+ const config = {
6
+ // Consult https://github.com/sveltejs/svelte-preprocess
7
+ // for more information about preprocessors
8
+ preprocess: preprocess(),
9
+
10
+ kit: {
11
+ adapter: adapter(),
12
+
13
+ // Override http methods in the Todo forms
14
+ methodOverride: {
15
+ allowed: ['PATCH', 'DELETE']
16
+ },
17
+ vite: {
18
+ optimizeDeps: {
19
+ include: ["highlight.js", "highlight.js/lib/core"],
20
+ },
21
+ },
22
+ }
23
+ };
24
+
25
+ export default config;
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "./.svelte-kit/tsconfig.json"
3
+ }
@@ -0,0 +1,55 @@
1
+ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
2
+
3
+ const isDevelopment = process.env.NODE_ENV === "development";
4
+ module.exports = {
5
+ plugins: [
6
+ new MiniCssExtractPlugin({
7
+ filename: isDevelopment ? "[name].css" : "[name].[hash].css",
8
+ chunkFilename: isDevelopment ? "[id].css" : "[id].[hash].css",
9
+ }),
10
+ ],
11
+ module: {
12
+ rules: [
13
+ {
14
+ test: /\.module\.s(a|c)ss$/,
15
+ loader: [
16
+ isDevelopment ? "style-loader" : MiniCssExtractPlugin.loader,
17
+ {
18
+ loader: "css-loader",
19
+ options: {
20
+ modules: true,
21
+ sourceMap: isDevelopment,
22
+ },
23
+ },
24
+ {
25
+ loader: "sass-loader",
26
+ options: {
27
+ sourceMap: isDevelopment,
28
+ sassOptions: { quietDeps: true },
29
+ },
30
+ },
31
+ ],
32
+ },
33
+ {
34
+ test: /\.s(a|c)ss$/,
35
+ exclude: /\.module.(s(a|c)ss)$/,
36
+ loader: [
37
+ isDevelopment ? "style-loader" : MiniCssExtractPlugin.loader,
38
+ "css-loader",
39
+ {
40
+ loader: "sass-loader",
41
+ options: {
42
+ sourceMap: isDevelopment,
43
+ sassOptions: { quietDeps: true },
44
+ },
45
+ },
46
+ ],
47
+ },
48
+ ///...
49
+ ],
50
+ },
51
+ resolve: {
52
+ extensions: [".js", ".jsx", ".scss", ".sass"],
53
+ },
54
+ ///...
55
+ };
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- export declare type IFabricConfModulePart = Record<string, any>;
2
- export declare type IFabricConfModuleDataPart = Record<string, any>;
3
- export declare type IFabricConfModuleMetaDataPart = Record<string, any>;
4
- export declare type IFabricConfModuleDocsPart = Record<string, any>;
5
- export declare type TFabricConfModuleDocsAttributesPart = Record<string, any>;
6
- declare const _default: {
7
- getModuleList: () => Record<string, any>;
8
- getModuleConfig: (module?: string) => IFabricConfModulePart;
9
- getModuleData: (module?: string) => IFabricConfModuleDataPart;
10
- getModuleMetaData: (module?: string) => IFabricConfModuleMetaDataPart;
11
- getModuleDocs: (module?: string) => IFabricConfModuleDocsPart;
12
- getModuleDocsAttributes: (module?: string) => TFabricConfModuleDocsAttributesPart;
13
- getClassNames: {
14
- getModuleTagClassNames: (props: import("./cssfabricClassNames").IListCssfabricClassNamesProps) => Record<string, any>;
15
- getModuleTagDebug: (props: import("./cssfabricClassNames").IListCssfabricClassNamesProps) => Record<string, any>;
16
- };
17
- getModuleClassNames: {
18
- getModuleTagClassNames: (props: import("./cssfabricClassNames").IListCssfabricClassNamesProps) => Record<string, any>;
19
- getModuleTagDebug: (props: import("./cssfabricClassNames").IListCssfabricClassNamesProps) => Record<string, any>;
20
- };
21
- getModuleTagClassNames: (props: import("./cssfabricClassNames").IListCssfabricClassNamesProps) => Record<string, any>;
22
- getModuleTagDebug: (props: import("./cssfabricClassNames").IListCssfabricClassNamesProps) => Record<string, any>;
23
- };
24
- export default _default;
@@ -1,43 +0,0 @@
1
- import jsonConfig from "../_generated/cssFabric.vars.json";
2
- import cssfabricClassNames from "./cssfabricClassNames";
3
- //
4
- const getModuleList = () => {
5
- return jsonConfig["cssfabric"]?.["modules"] || {};
6
- };
7
- const getModuleConfig = (module) => {
8
- if (module)
9
- return jsonConfig["cssfabric"]?.["modules"]?.[module] || {};
10
- return jsonConfig;
11
- };
12
- const getModuleData = (module) => {
13
- if (module)
14
- return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_data"] || {};
15
- return jsonConfig;
16
- };
17
- const getModuleMetaData = (module) => {
18
- if (module)
19
- return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_metadata"] || {};
20
- return jsonConfig;
21
- };
22
- const getModuleDocs = (module) => {
23
- if (module)
24
- return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_docs"] || {};
25
- return jsonConfig;
26
- };
27
- const getModuleDocsAttributes = (module) => {
28
- if (module)
29
- return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_docs"]?.["attributes"] || {};
30
- return jsonConfig;
31
- };
32
- export default {
33
- getModuleList,
34
- getModuleConfig,
35
- getModuleData,
36
- getModuleMetaData,
37
- getModuleDocs,
38
- getModuleDocsAttributes,
39
- getClassNames: cssfabricClassNames,
40
- getModuleClassNames: cssfabricClassNames,
41
- getModuleTagClassNames: cssfabricClassNames.getModuleTagClassNames,
42
- getModuleTagDebug: cssfabricClassNames.getModuleTagDebug,
43
- };
@@ -1,14 +0,0 @@
1
- export interface IListCssfabricClassNamesProps {
2
- module: string;
3
- moduleAttribute: any;
4
- outputStyle?: 'default' | 'debug';
5
- }
6
- export interface ILoopIt {
7
- module: string;
8
- }
9
- declare function cssfabricClassNames(props: IListCssfabricClassNamesProps): Record<string, any>;
10
- declare const _default: {
11
- getModuleTagClassNames: typeof cssfabricClassNames;
12
- getModuleTagDebug: (props: IListCssfabricClassNamesProps) => Record<string, any>;
13
- };
14
- export default _default;
package/scripts/index.js DELETED
@@ -1,4 +0,0 @@
1
- function buildReadme(vars) {
2
- return "readme";
3
- }
4
- export default buildReadme;
@@ -1,5 +0,0 @@
1
- declare const utils: {
2
- isArrayOfTypes: (arr: any) => any;
3
- isObjectOfTypes: (arr: any) => any;
4
- };
5
- export default utils;
package/scripts/utils.js DELETED
@@ -1,38 +0,0 @@
1
- const utils = {
2
- isArrayOfTypes: (arr) => {
3
- let ret = '';
4
- if (!Array.isArray(arr)) {
5
- return false;
6
- }
7
- if (arr.every(x => Array.isArray(x)))
8
- ret = 'arrays';
9
- if (arr.every(x => typeof x === 'number' || typeof x === 'string'))
10
- ret = 'strings';
11
- if (arr.every(x => typeof x === 'string'))
12
- ret = 'strings';
13
- if (arr.every(x => typeof x === 'number'))
14
- ret = 'numbers';
15
- if (arr.every(x => typeof x === 'object' && !Array.isArray(x)))
16
- ret = 'objects';
17
- return ret;
18
- },
19
- isObjectOfTypes: (arr) => {
20
- if (Array.isArray(arr)) {
21
- return false;
22
- }
23
- let ret = '';
24
- let arrValues = Object.values(arr);
25
- if (arrValues.every(x => typeof x === 'number' || typeof x === 'string'))
26
- ret = 'strings';
27
- if (arrValues.every(x => Array.isArray(x)))
28
- ret = 'arrays';
29
- if (arrValues.every(x => typeof x === 'string'))
30
- ret = 'strings';
31
- if (arrValues.every(x => typeof x === 'number'))
32
- ret = 'numbers';
33
- if (arrValues.every(x => typeof x === 'object' && !Array.isArray(x)))
34
- ret = 'objects';
35
- return ret;
36
- }
37
- };
38
- export default utils;