@guebbit/css-toolkit 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +5 -5
  3. package/docs/.postcssrc.cjs +11 -11
  4. package/docs/.vitepress/config.ts +88 -88
  5. package/docs/.vitepress/dist/404.html +1 -1
  6. package/docs/.vitepress/dist/assets/{app.Cez_7bx7.js → app.BQiPqeST.js} +1 -1
  7. package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.C9A3MdGo.js +1 -0
  8. package/docs/.vitepress/dist/assets/chunks/{VPLocalSearchBox.lfLgIsvm.js → VPLocalSearchBox.Bz_zRP0g.js} +1 -1
  9. package/docs/.vitepress/dist/assets/chunks/{theme.ZIndENJH.js → theme.DOuq-6g9.js} +2 -2
  10. package/docs/.vitepress/dist/colors/bootstrap.html +2 -2
  11. package/docs/.vitepress/dist/colors/brands.html +2 -2
  12. package/docs/.vitepress/dist/colors/customs.html +2 -2
  13. package/docs/.vitepress/dist/functions/colors.html +2 -2
  14. package/docs/.vitepress/dist/functions/helpers.html +2 -2
  15. package/docs/.vitepress/dist/functions/strings.html +2 -2
  16. package/docs/.vitepress/dist/index.html +2 -2
  17. package/docs/.vitepress/dist/mixins/build-aspect-ratio.html +2 -2
  18. package/docs/.vitepress/dist/mixins/build-compatibility.html +2 -2
  19. package/docs/.vitepress/dist/mixins/build-scrollbar.html +2 -2
  20. package/docs/.vitepress/dist/mixins/create-colors.html +2 -2
  21. package/docs/.vitepress/dist/mixins/create-helper-margin.html +2 -2
  22. package/docs/.vitepress/dist/mixins/create-helper-padding.html +2 -2
  23. package/docs/.vitepress/dist/mixins/create-instruction.html +2 -2
  24. package/docs/.vitepress/theme/index.js +11 -11
  25. package/docs/functions/colors.md +65 -65
  26. package/docs/logo.svg +55 -55
  27. package/docs/logotype.svg +149 -149
  28. package/docs/mixins/build-compatibility.md +22 -22
  29. package/docs/mixins/build-scrollbar.md +18 -18
  30. package/docs/mixins/create-helper-margin.md +25 -25
  31. package/docs/mixins/create-helper-padding.md +24 -24
  32. package/docs/mixins/create-instruction.md +32 -32
  33. package/package.json +61 -61
  34. package/src/colors/_bootstrap.scss +179 -179
  35. package/src/colors/_brands.scss +19 -19
  36. package/src/colors/_customs.scss +52 -52
  37. package/src/colors/_index.scss +199 -199
  38. package/src/functions/_colors.scss +133 -121
  39. package/src/functions/_helpers.scss +44 -42
  40. package/src/functions/_strings.scss +30 -30
  41. package/src/index.scss +12 -12
  42. package/src/mixins/_build-aspect-ratio.scss +36 -36
  43. package/src/mixins/_build-compatibility.scss +27 -27
  44. package/src/mixins/_build-scrollbar.scss +31 -31
  45. package/src/mixins/_create-colors.scss +118 -118
  46. package/src/mixins/_create-helper-margin.scss +38 -38
  47. package/src/mixins/_create-helper-padding.scss +40 -40
  48. package/src/mixins/_create-instructions.scss +11 -11
  49. package/test/compile.test.js +105 -105
  50. package/test/lint.test.js +48 -48
  51. package/test/test.css +104 -99
  52. package/test/test.scss +158 -158
  53. package/vite.config.ts +25 -25
  54. package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.CkfJPSmi.js +0 -1
@@ -1,39 +1,39 @@
1
- /**
2
- *
3
- * t - applies the spacing for margin-top
4
- * b - applies the spacing for margin-bottom
5
- * l - applies the spacing for margin-left
6
- * r - applies the spacing for margin-right
7
- * x - applies the spacing for both *-left and *-right
8
- * y - applies the spacing for both *-top and *-bottom
9
- * a - applies the spacing for the property in all directions
10
- *
11
- * @param {Array<name,value>[]} measure-list - postfix name and value
12
- */
13
- @mixin create-helper-margin($measure-list: (), $important: false, $prefix: "") {
14
- @each $name, $val in $measure-list {
15
- .#{$prefix}mt-#{$name} {
16
- margin-top: #{$val} #{if($important == true, "!important", "")};
17
- }
18
- .#{$prefix}mb-#{$name} {
19
- margin-bottom: #{$val} #{if($important == true, "!important", "")};
20
- }
21
- .#{$prefix}ml-#{$name} {
22
- margin-left: #{$val} #{if($important == true, "!important", "")};
23
- }
24
- .#{$prefix}mr-#{$name} {
25
- margin-right: #{$val} #{if($important == true, "!important", "")};
26
- }
27
- .#{$prefix}mx-#{$name} {
28
- margin-right: #{$val} #{if($important == true, "!important", "")};
29
- margin-left: #{$val} #{if($important == true, "!important", "")};
30
- }
31
- .#{$prefix}my-#{$name} {
32
- margin-top: #{$val} #{if($important == true, "!important", "")};
33
- margin-bottom: #{$val} #{if($important == true, "!important", "")};
34
- }
35
- .#{$prefix}ma-#{$name} {
36
- margin: #{$val} #{if($important == true, "!important", "")};
37
- }
38
- }
1
+ /**
2
+ *
3
+ * t - applies the spacing for margin-top
4
+ * b - applies the spacing for margin-bottom
5
+ * l - applies the spacing for margin-left
6
+ * r - applies the spacing for margin-right
7
+ * x - applies the spacing for both *-left and *-right
8
+ * y - applies the spacing for both *-top and *-bottom
9
+ * a - applies the spacing for the property in all directions
10
+ *
11
+ * @param {Array<name,value>[]} measure-list - postfix name and value
12
+ */
13
+ @mixin create-helper-margin($measure-list: (), $important: false, $prefix: "") {
14
+ @each $name, $val in $measure-list {
15
+ .#{$prefix}mt-#{$name} {
16
+ margin-top: #{$val} #{if($important == true, "!important", "")};
17
+ }
18
+ .#{$prefix}mb-#{$name} {
19
+ margin-bottom: #{$val} #{if($important == true, "!important", "")};
20
+ }
21
+ .#{$prefix}ml-#{$name} {
22
+ margin-left: #{$val} #{if($important == true, "!important", "")};
23
+ }
24
+ .#{$prefix}mr-#{$name} {
25
+ margin-right: #{$val} #{if($important == true, "!important", "")};
26
+ }
27
+ .#{$prefix}mx-#{$name} {
28
+ margin-right: #{$val} #{if($important == true, "!important", "")};
29
+ margin-left: #{$val} #{if($important == true, "!important", "")};
30
+ }
31
+ .#{$prefix}my-#{$name} {
32
+ margin-top: #{$val} #{if($important == true, "!important", "")};
33
+ margin-bottom: #{$val} #{if($important == true, "!important", "")};
34
+ }
35
+ .#{$prefix}ma-#{$name} {
36
+ margin: #{$val} #{if($important == true, "!important", "")};
37
+ }
38
+ }
39
39
  }
@@ -1,40 +1,40 @@
1
- /**
2
- *
3
- * t - applies the spacing for padding-top
4
- * b - applies the spacing for padding-bottom
5
- * l - applies the spacing for padding-left
6
- * r - applies the spacing for padding-right
7
- * x - applies the spacing for both *-left and *-right
8
- * y - applies the spacing for both *-top and *-bottom
9
- * a - applies the spacing for the property in all directions
10
-
11
- * @param {Array<name,value>[]} measure-list - postfix name and value
12
- */
13
- @mixin create-helper-padding($measure-list: (), $important: false, $prefix: "") {
14
-
15
- @each $name, $val in $measure-list {
16
- .#{$prefix}pt-#{$name} {
17
- padding-top: #{$val} #{if($important == true, "!important", "")};
18
- }
19
- .#{$prefix}pb-#{$name} {
20
- padding-bottom: #{$val} #{if($important == true, "!important", "")};
21
- }
22
- .#{$prefix}pl-#{$name} {
23
- padding-left: #{$val} #{if($important == true, "!important", "")};
24
- }
25
- .#{$prefix}pr-#{$name} {
26
- padding-right: #{$val} #{if($important == true, "!important", "")};
27
- }
28
- .#{$prefix}px-#{$name} {
29
- padding-right: #{$val} #{if($important == true, "!important", "")};
30
- padding-left: #{$val} #{if($important == true, "!important", "")};
31
- }
32
- .#{$prefix}py-#{$name} {
33
- padding-top: #{$val} #{if($important == true, "!important", "")};
34
- padding-bottom: #{$val} #{if($important == true, "!important", "")};
35
- }
36
- .#{$prefix}pa-#{$name} {
37
- padding: #{$val} #{if($important == true, "!important", "")};
38
- }
39
- }
40
- }
1
+ /**
2
+ *
3
+ * t - applies the spacing for padding-top
4
+ * b - applies the spacing for padding-bottom
5
+ * l - applies the spacing for padding-left
6
+ * r - applies the spacing for padding-right
7
+ * x - applies the spacing for both *-left and *-right
8
+ * y - applies the spacing for both *-top and *-bottom
9
+ * a - applies the spacing for the property in all directions
10
+
11
+ * @param {Array<name,value>[]} measure-list - postfix name and value
12
+ */
13
+ @mixin create-helper-padding($measure-list: (), $important: false, $prefix: "") {
14
+
15
+ @each $name, $val in $measure-list {
16
+ .#{$prefix}pt-#{$name} {
17
+ padding-top: #{$val} #{if($important == true, "!important", "")};
18
+ }
19
+ .#{$prefix}pb-#{$name} {
20
+ padding-bottom: #{$val} #{if($important == true, "!important", "")};
21
+ }
22
+ .#{$prefix}pl-#{$name} {
23
+ padding-left: #{$val} #{if($important == true, "!important", "")};
24
+ }
25
+ .#{$prefix}pr-#{$name} {
26
+ padding-right: #{$val} #{if($important == true, "!important", "")};
27
+ }
28
+ .#{$prefix}px-#{$name} {
29
+ padding-right: #{$val} #{if($important == true, "!important", "")};
30
+ padding-left: #{$val} #{if($important == true, "!important", "")};
31
+ }
32
+ .#{$prefix}py-#{$name} {
33
+ padding-top: #{$val} #{if($important == true, "!important", "")};
34
+ padding-bottom: #{$val} #{if($important == true, "!important", "")};
35
+ }
36
+ .#{$prefix}pa-#{$name} {
37
+ padding: #{$val} #{if($important == true, "!important", "")};
38
+ }
39
+ }
40
+ }
@@ -1,11 +1,11 @@
1
- /**
2
- CSS single instructions generator
3
- @param {Array<name,value>[]} measure-list - postfix name and value
4
- */
5
- @mixin create-instructions($instruction, $measure-list: (), $important: false, $prefix: "", $delimiter: "-") {
6
- @each $name, $val in $measure-list {
7
- .#{$prefix}#{$instruction}#{$delimiter}#{$name} {
8
- #{$instruction}: #{$val} #{if($important == true, "!important", "")}
9
- }
10
- }
11
- }
1
+ /**
2
+ CSS single instructions generator
3
+ @param {Array<name,value>[]} measure-list - postfix name and value
4
+ */
5
+ @mixin create-instructions($instruction, $measure-list: (), $important: false, $prefix: "", $delimiter: "-") {
6
+ @each $name, $val in $measure-list {
7
+ .#{$prefix}#{$instruction}#{$delimiter}#{$name} {
8
+ #{$instruction}: #{$val} #{if($important == true, "!important", "")}
9
+ }
10
+ }
11
+ }
@@ -1,106 +1,106 @@
1
- import { describe, it } from "mocha";
2
- import { expect } from "chai";
3
- import fs from "fs";
4
- import util from "util";
5
- import * as sass from "sass";
6
- import path from "path";
7
- import { fileURLToPath } from "url";
8
-
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
11
-
12
- let cssCompiled;
13
-
14
- function sassCompiler(){
15
- return util.promisify(sass.render)({
16
- includePaths: ['./scss'],
17
- file: path.join(__dirname, './test.scss'),
18
- // outputStyle: 'compressed'
19
- })
20
- .then(result => result?.css?.toString());
21
- }
22
-
23
- describe("COMPILE", function() {
24
- // to remove timeout error
25
- this.timeout(10000);
26
-
27
- it('Should compile', async function() {
28
- cssCompiled = await sassCompiler();
29
- // Not necessary, but let's compile the file
30
- fs.writeFile(path.join(__dirname, 'test.css'), cssCompiled, () => {});
31
- });
32
-
33
- it('Check some rules', function() {
34
- // --
35
- expect(cssCompiled).to.contain('.blue-400-text {');
36
- expect(cssCompiled).to.contain('color: rgb(61.4, 139, 253.4) !important;');
37
- expect(cssCompiled).to.contain('.blue-400-bg {');
38
- expect(cssCompiled).to.contain('background: rgb(61.4, 139, 253.4) !important;');
39
- // --
40
- expect(cssCompiled).to.contain('--blue-400: 61 139 253;');
41
- expect(cssCompiled).to.contain('--manga-red-500: 212 24 22;');
42
- expect(cssCompiled).to.contain('--advanced-brand-instagram: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);');
43
- expect(cssCompiled).to.contain('.mt-auto {');
44
- expect(cssCompiled).to.contain('margin-top: auto;');
45
- expect(cssCompiled).to.contain('.my-48 {');
46
- expect(cssCompiled).to.contain('margin-top: 48px;');
47
- expect(cssCompiled).to.contain('margin-bottom: 48px;');
48
- expect(cssCompiled).to.contain('.width-100 {');
49
- expect(cssCompiled).to.contain('width: 100% !important;');
50
- expect(cssCompiled).to.contain('.flex-gap-24 {');
51
- expect(cssCompiled).to.contain('gap: 24px !important;');
52
- // -
53
- expect(cssCompiled).to.contain('.aspect-ratio-1-1::before {');
54
- expect(cssCompiled).to.contain('padding-top: 100%;');
55
- expect(cssCompiled).to.contain('.aspect-ratio-16-9::before {');
56
- expect(cssCompiled).to.contain('padding-top: 56%;');
57
- // -
58
- expect(cssCompiled).to.contain('@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {');
59
- expect(cssCompiled).to.contain('@supports (-ms-ime-align: auto) {');
60
- expect(cssCompiled).to.contain('@supports (-moz-appearance: none) {');
61
- // --
62
- expect(cssCompiled).to.contain('--color-opaque-1: rgba(33.0810810811, 33.0810810811, 33.0810810811, 0.84)');
63
- expect(cssCompiled).to.contain('--color-opaque-2: rgb(110.5, 110.5, 110.5)');
64
- expect(cssCompiled).to.contain('--color-opaque-3: #dddddd;');
65
- // --
66
- expect(cssCompiled).to.contain('--color-tint-1: rgb(89.25, 89.25, 89.25);');
67
- expect(cssCompiled).to.contain('--color-tint-2: rgb(229.5, 229.5, 229.5);');
68
- // --
69
- expect(cssCompiled).to.contain('--color-shade-1: rgb(25.5, 25.5, 25.5);');
70
- expect(cssCompiled).to.contain('--color-shade-2: rgb(165.75, 165.75, 165.75);');
71
- // --
72
- expect(cssCompiled).to.contain('--color-shift-1: rgb(25.5, 25.5, 25.5);');
73
- expect(cssCompiled).to.contain('--color-shift-2: rgb(165.75, 165.75, 165.75);');
74
- expect(cssCompiled).to.contain('--color-shift-3: rgb(89.25, 89.25, 89.25);');
75
- expect(cssCompiled).to.contain('--color-shift-4: rgb(229.5, 229.5, 229.5);');
76
- // --
77
- expect(cssCompiled).to.contain('--color-contrast-1: #fff;');
78
- expect(cssCompiled).to.contain('--color-contrast-2: #000;');
79
- // --
80
- expect(cssCompiled).to.contain('--color-brightness-1: #fff;');
81
- expect(cssCompiled).to.contain('--color-brightness-2: #000;');
82
- // --
83
- expect(cssCompiled).to.contain('--extract-colors-1: 255 255 255;');
84
- expect(cssCompiled).to.contain('--extract-colors-2: 34 34 34;');
85
- expect(cssCompiled).to.contain('--extract-colors-3: 221 221 221;');
86
- expect(cssCompiled).to.contain('--extract-colors-4: 34, 34, 34;');
87
- expect(cssCompiled).to.contain('--extract-colors-5: 221, 221, 221;');
88
- expect(cssCompiled).to.contain('--extract-colors-6: 0 255 0;');
89
- expect(cssCompiled).to.contain('--extract-colors-7: 0 255 0 / 0.5;');
90
- expect(cssCompiled).to.contain('--extract-colors-8: 0, 255, 0;');
91
- expect(cssCompiled).to.contain('--extract-colors-9: 0, 255, 0, 0.5;');
92
- expect(cssCompiled).to.contain('--extract-colors-10: 0 255 0;');
93
- expect(cssCompiled).to.contain('--extract-colors-11: 0 255 0 / 0.5;');
94
- expect(cssCompiled).to.contain('--extract-colors-12: 0, 255, 0;');
95
- expect(cssCompiled).to.contain('--extract-colors-13: 0, 255, 0, 0.5;');
96
- // --
97
- expect(cssCompiled).to.contain('--no-null-1: transparent;');
98
- expect(cssCompiled).to.contain('--no-null-2: blue;');
99
- // --
100
- expect(cssCompiled).to.contain('--no-trasparent-1: inherit;');
101
- expect(cssCompiled).to.contain('--no-trasparent-2: inherit;');
102
- expect(cssCompiled).to.contain('--no-trasparent-3: #123456;');
103
- // --
104
- expect(cssCompiled).to.contain('--map-deep-get: 10px;');
105
- });
1
+ import { describe, it } from "mocha";
2
+ import { expect } from "chai";
3
+ import fs from "fs";
4
+ import util from "util";
5
+ import * as sass from "sass";
6
+ import path from "path";
7
+ import { fileURLToPath } from "url";
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+
12
+ let cssCompiled;
13
+
14
+ function sassCompiler(){
15
+ return util.promisify(sass.render)({
16
+ includePaths: ['./scss'],
17
+ file: path.join(__dirname, './test.scss'),
18
+ // outputStyle: 'compressed'
19
+ })
20
+ .then(result => result?.css?.toString());
21
+ }
22
+
23
+ describe("COMPILE", function() {
24
+ // to remove timeout error
25
+ this.timeout(10000);
26
+
27
+ it('Should compile', async function() {
28
+ cssCompiled = await sassCompiler();
29
+ // Not necessary, but let's compile the file
30
+ fs.writeFile(path.join(__dirname, 'test.css'), cssCompiled, () => {});
31
+ });
32
+
33
+ it('Check some rules', function() {
34
+ // --
35
+ expect(cssCompiled).to.contain('.blue-400-text {');
36
+ expect(cssCompiled).to.contain('color: rgb(61.4, 139, 253.4) !important;');
37
+ expect(cssCompiled).to.contain('.blue-400-bg {');
38
+ expect(cssCompiled).to.contain('background: rgb(61.4, 139, 253.4) !important;');
39
+ // --
40
+ expect(cssCompiled).to.contain('--blue-400: 61.4 139 253.4;');
41
+ expect(cssCompiled).to.contain('--manga-red-500: 212 24 22;');
42
+ expect(cssCompiled).to.contain('--advanced-brand-instagram: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);');
43
+ expect(cssCompiled).to.contain('.mt-auto {');
44
+ expect(cssCompiled).to.contain('margin-top: auto;');
45
+ expect(cssCompiled).to.contain('.my-48 {');
46
+ expect(cssCompiled).to.contain('margin-top: 48px;');
47
+ expect(cssCompiled).to.contain('margin-bottom: 48px;');
48
+ expect(cssCompiled).to.contain('.width-100 {');
49
+ expect(cssCompiled).to.contain('width: 100% !important;');
50
+ expect(cssCompiled).to.contain('.flex-gap-24 {');
51
+ expect(cssCompiled).to.contain('gap: 24px !important;');
52
+ // -
53
+ expect(cssCompiled).to.contain('.aspect-ratio-1-1::before {');
54
+ expect(cssCompiled).to.contain('padding-top: 100%;');
55
+ expect(cssCompiled).to.contain('.aspect-ratio-16-9::before {');
56
+ expect(cssCompiled).to.contain('padding-top: 56%;');
57
+ // -
58
+ expect(cssCompiled).to.contain('@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {');
59
+ expect(cssCompiled).to.contain('@supports (-ms-ime-align: auto) {');
60
+ expect(cssCompiled).to.contain('@supports (-moz-appearance: none) {');
61
+ // --
62
+ expect(cssCompiled).to.contain('--color-opaque-1: rgba(33.0810810811, 33.0810810811, 33.0810810811, 0.84)');
63
+ expect(cssCompiled).to.contain('--color-opaque-2: rgb(110.5, 110.5, 110.5)');
64
+ expect(cssCompiled).to.contain('--color-opaque-3: #dddddd;');
65
+ // --
66
+ expect(cssCompiled).to.contain('--color-tint-1: rgb(89.25, 89.25, 89.25);');
67
+ expect(cssCompiled).to.contain('--color-tint-2: rgb(229.5, 229.5, 229.5);');
68
+ // --
69
+ expect(cssCompiled).to.contain('--color-shade-1: rgb(25.5, 25.5, 25.5);');
70
+ expect(cssCompiled).to.contain('--color-shade-2: rgb(165.75, 165.75, 165.75);');
71
+ // --
72
+ expect(cssCompiled).to.contain('--color-shift-1: rgb(25.5, 25.5, 25.5);');
73
+ expect(cssCompiled).to.contain('--color-shift-2: rgb(165.75, 165.75, 165.75);');
74
+ expect(cssCompiled).to.contain('--color-shift-3: rgb(89.25, 89.25, 89.25);');
75
+ expect(cssCompiled).to.contain('--color-shift-4: rgb(229.5, 229.5, 229.5);');
76
+ // --
77
+ expect(cssCompiled).to.contain('--color-contrast-1: #fff;');
78
+ expect(cssCompiled).to.contain('--color-contrast-2: #000;');
79
+ // --
80
+ expect(cssCompiled).to.contain('--color-brightness-1: #fff;');
81
+ expect(cssCompiled).to.contain('--color-brightness-2: #000;');
82
+ // --
83
+ expect(cssCompiled).to.contain('--extract-colors-1: 255 255 255;');
84
+ expect(cssCompiled).to.contain('--extract-colors-2: 34 34 34;');
85
+ expect(cssCompiled).to.contain('--extract-colors-3: 221 221 221;');
86
+ expect(cssCompiled).to.contain('--extract-colors-4: 34, 34, 34;');
87
+ expect(cssCompiled).to.contain('--extract-colors-5: 221, 221, 221;');
88
+ expect(cssCompiled).to.contain('--extract-colors-6: 0 255 0;');
89
+ expect(cssCompiled).to.contain('--extract-colors-7: 0 255 0 / 0.5;');
90
+ expect(cssCompiled).to.contain('--extract-colors-8: 0, 255, 0;');
91
+ expect(cssCompiled).to.contain('--extract-colors-9: 0, 255, 0, 0.5;');
92
+ expect(cssCompiled).to.contain('--extract-colors-10: 0 255 0;');
93
+ expect(cssCompiled).to.contain('--extract-colors-11: 0 255 0 / 0.5;');
94
+ expect(cssCompiled).to.contain('--extract-colors-12: 0, 255, 0;');
95
+ expect(cssCompiled).to.contain('--extract-colors-13: 0, 255, 0, 0.5;');
96
+ // --
97
+ expect(cssCompiled).to.contain('--no-null-1: transparent;');
98
+ expect(cssCompiled).to.contain('--no-null-2: blue;');
99
+ // --
100
+ expect(cssCompiled).to.contain('--no-trasparent-1: inherit;');
101
+ expect(cssCompiled).to.contain('--no-trasparent-2: inherit;');
102
+ expect(cssCompiled).to.contain('--no-trasparent-3: #123456;');
103
+ // --
104
+ expect(cssCompiled).to.contain('--map-deep-get: 10px;');
105
+ });
106
106
  });
package/test/lint.test.js CHANGED
@@ -1,48 +1,48 @@
1
- import { describe, it } from 'mocha';
2
- import { expect } from "chai";
3
- import stylelint from "stylelint";
4
- import path from "path";
5
- import { fileURLToPath } from "url";
6
-
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
-
12
- describe("LINT", function() {
13
- // to remove timeout error
14
- this.timeout(10000);
15
-
16
- it('Generic linting', async () => {
17
- return stylelint.lint({
18
- configFile: path.join(__dirname, '../.stylelintrc.json'),
19
- ignorePath: path.join(__dirname, '../.stylelintignore'),
20
- files: [
21
- path.join(__dirname, './test.scss'),
22
- ],
23
- })
24
- .then(function ({ errored, report }) {
25
- if(!errored)
26
- return false;
27
- // show me errors
28
- const reportsArray = JSON.parse(report);
29
- for(let i = reportsArray.length; i--; ){
30
- const reportKeys = Object.keys(reportsArray[i]);
31
- for(let k = reportKeys.length; k--; ){
32
- const reportsValues = reportsArray[i][reportKeys[k]];
33
- if(reportsValues.length <= 0)
34
- continue;
35
- if(Array.isArray(reportsValues)){
36
- console.log("-----------" + reportKeys[k] + "-----------");
37
- for(let x = reportsValues.length; x--; )
38
- console.log(reportsValues[x]);
39
- }else{
40
- console.log(reportKeys[k] + ": " + reportsValues);
41
- }
42
- }
43
- }
44
- return true;
45
- })
46
- .then(result => expect(result).to.be.false);
47
- });
48
- });
1
+ import { describe, it } from 'mocha';
2
+ import { expect } from "chai";
3
+ import stylelint from "stylelint";
4
+ import path from "path";
5
+ import { fileURLToPath } from "url";
6
+
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+
12
+ describe("LINT", function() {
13
+ // to remove timeout error
14
+ this.timeout(10000);
15
+
16
+ it('Generic linting', async () => {
17
+ return stylelint.lint({
18
+ configFile: path.join(__dirname, '../.stylelintrc.json'),
19
+ ignorePath: path.join(__dirname, '../.stylelintignore'),
20
+ files: [
21
+ path.join(__dirname, './test.scss'),
22
+ ],
23
+ })
24
+ .then(function ({ errored, report }) {
25
+ if(!errored)
26
+ return false;
27
+ // show me errors
28
+ const reportsArray = JSON.parse(report);
29
+ for(let i = reportsArray.length; i--; ){
30
+ const reportKeys = Object.keys(reportsArray[i]);
31
+ for(let k = reportKeys.length; k--; ){
32
+ const reportsValues = reportsArray[i][reportKeys[k]];
33
+ if(reportsValues.length <= 0)
34
+ continue;
35
+ if(Array.isArray(reportsValues)){
36
+ console.log("-----------" + reportKeys[k] + "-----------");
37
+ for(let x = reportsValues.length; x--; )
38
+ console.log(reportsValues[x]);
39
+ }else{
40
+ console.log(reportKeys[k] + ": " + reportsValues);
41
+ }
42
+ }
43
+ }
44
+ return true;
45
+ })
46
+ .then(result => expect(result).to.be.false);
47
+ });
48
+ });