@guebbit/css-toolkit 1.1.2 → 1.2.0
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.
- package/LICENSE +661 -661
- package/README.md +5 -5
- package/docs/.postcssrc.cjs +11 -11
- package/docs/.vitepress/config.ts +88 -88
- package/docs/.vitepress/dist/404.html +5 -4
- package/docs/.vitepress/dist/assets/{app.CpyNzro9.js → app.Cez_7bx7.js} +1 -1
- package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.CkfJPSmi.js +1 -0
- package/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.lfLgIsvm.js +8 -0
- package/docs/.vitepress/dist/assets/chunks/framework.BQmytedh.js +18 -0
- package/docs/.vitepress/dist/assets/chunks/theme.ZIndENJH.js +2 -0
- package/docs/.vitepress/dist/assets/{colors_bootstrap.md.DiC9aO06.js → colors_bootstrap.md.B8QNot57.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_bootstrap.md.DiC9aO06.lean.js → colors_bootstrap.md.B8QNot57.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_brands.md.Bp8_jfHR.js → colors_brands.md.DA7CAmLz.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_brands.md.Bp8_jfHR.lean.js → colors_brands.md.DA7CAmLz.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_customs.md.DyEXln8b.js → colors_customs.md.B9XC2fYm.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_customs.md.DyEXln8b.lean.js → colors_customs.md.B9XC2fYm.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_colors.md.CtYahXnA.js → functions_colors.md.8WIzA1Az.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_colors.md.CtYahXnA.lean.js → functions_colors.md.8WIzA1Az.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_helpers.md.DZRTPA4t.js → functions_helpers.md.DlnJURDc.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_helpers.md.DZRTPA4t.lean.js → functions_helpers.md.DlnJURDc.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_strings.md.BMMJdTdo.js → functions_strings.md.B-I-mSmy.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_strings.md.BMMJdTdo.lean.js → functions_strings.md.B-I-mSmy.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{index.md.2uetSBMH.js → index.md.DO-yHYeM.js} +1 -1
- package/docs/.vitepress/dist/assets/{index.md.2uetSBMH.lean.js → index.md.DO-yHYeM.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-aspect-ratio.md.8mabvpDg.js → mixins_build-aspect-ratio.md.Cjv_a3MY.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-aspect-ratio.md.8mabvpDg.lean.js → mixins_build-aspect-ratio.md.Cjv_a3MY.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-compatibility.md.cOIJ58bq.js → mixins_build-compatibility.md.BO6wODYa.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-compatibility.md.cOIJ58bq.lean.js → mixins_build-compatibility.md.BO6wODYa.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-scrollbar.md.DrR7vY38.js → mixins_build-scrollbar.md.BX34elgD.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-scrollbar.md.DrR7vY38.lean.js → mixins_build-scrollbar.md.BX34elgD.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-colors.md.FiVBK2v9.js → mixins_create-colors.md.82HeTZt6.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-colors.md.FiVBK2v9.lean.js → mixins_create-colors.md.82HeTZt6.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-helper-margin.md.B85aWiR9.js → mixins_create-helper-margin.md.D2-T7z0a.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-helper-margin.md.B85aWiR9.lean.js → mixins_create-helper-margin.md.D2-T7z0a.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-helper-padding.md._fxbDV5T.js → mixins_create-helper-padding.md.Cp-laxuA.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-helper-padding.md._fxbDV5T.lean.js → mixins_create-helper-padding.md.Cp-laxuA.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-instruction.md.DKI2LvdM.js → mixins_create-instruction.md.dJ83FO6R.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-instruction.md.DKI2LvdM.lean.js → mixins_create-instruction.md.dJ83FO6R.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/style.BKBz-tcN.css +1 -0
- package/docs/.vitepress/dist/colors/bootstrap.html +9 -8
- package/docs/.vitepress/dist/colors/brands.html +9 -8
- package/docs/.vitepress/dist/colors/customs.html +9 -8
- package/docs/.vitepress/dist/functions/colors.html +9 -8
- package/docs/.vitepress/dist/functions/helpers.html +9 -8
- package/docs/.vitepress/dist/functions/strings.html +9 -8
- package/docs/.vitepress/dist/hashmap.json +1 -1
- package/docs/.vitepress/dist/index.html +9 -8
- package/docs/.vitepress/dist/mixins/build-aspect-ratio.html +9 -8
- package/docs/.vitepress/dist/mixins/build-compatibility.html +9 -8
- package/docs/.vitepress/dist/mixins/build-scrollbar.html +9 -8
- package/docs/.vitepress/dist/mixins/create-colors.html +9 -8
- package/docs/.vitepress/dist/mixins/create-helper-margin.html +9 -8
- package/docs/.vitepress/dist/mixins/create-helper-padding.html +9 -8
- package/docs/.vitepress/dist/mixins/create-instruction.html +9 -8
- package/docs/.vitepress/dist/vp-icons.css +2 -0
- package/docs/.vitepress/theme/index.js +11 -11
- package/docs/functions/colors.md +65 -65
- package/docs/logo.svg +55 -55
- package/docs/logotype.svg +149 -149
- package/docs/mixins/build-compatibility.md +22 -22
- package/docs/mixins/build-scrollbar.md +18 -18
- package/docs/mixins/create-helper-margin.md +25 -25
- package/docs/mixins/create-helper-padding.md +24 -24
- package/docs/mixins/create-instruction.md +32 -32
- package/package.json +61 -61
- package/src/colors/_bootstrap.scss +179 -179
- package/src/colors/_brands.scss +19 -19
- package/src/colors/_customs.scss +52 -52
- package/src/colors/_index.scss +199 -199
- package/src/functions/_colors.scss +121 -117
- package/src/functions/_helpers.scss +42 -42
- package/src/functions/_strings.scss +30 -30
- package/src/index.scss +12 -12
- package/src/mixins/_build-aspect-ratio.scss +36 -36
- package/src/mixins/_build-compatibility.scss +27 -27
- package/src/mixins/_build-scrollbar.scss +31 -31
- package/src/mixins/_create-colors.scss +118 -118
- package/src/mixins/_create-helper-margin.scss +38 -38
- package/src/mixins/_create-helper-padding.scss +40 -40
- package/src/mixins/_create-instructions.scss +11 -11
- package/test/compile.test.js +105 -102
- package/test/lint.test.js +48 -50
- package/test/test.css +5819 -5816
- package/test/test.scss +158 -153
- package/vite.config.ts +25 -25
- package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.CYE7S9pS.js +0 -1
- package/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.DrgBd5f4.js +0 -7
- package/docs/.vitepress/dist/assets/chunks/framework.DJJi9g99.js +0 -17
- package/docs/.vitepress/dist/assets/chunks/theme.CviQ0biq.js +0 -2
- package/docs/.vitepress/dist/assets/style.DDLX1Ber.css +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
|
+
}
|
package/test/compile.test.js
CHANGED
|
@@ -1,103 +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:
|
|
37
|
-
expect(cssCompiled).to.contain('.blue-400-bg {');
|
|
38
|
-
expect(cssCompiled).to.contain('background:
|
|
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:
|
|
63
|
-
expect(cssCompiled).to.contain('--color-opaque-2:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
expect(cssCompiled).to.contain('--color-tint-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
expect(cssCompiled).to.contain('--color-shade-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
expect(cssCompiled).to.contain('--color-shift-
|
|
73
|
-
|
|
74
|
-
expect(cssCompiled).to.contain('--color-
|
|
75
|
-
expect(cssCompiled).to.contain('--color-
|
|
76
|
-
// --
|
|
77
|
-
expect(cssCompiled).to.contain('--color-
|
|
78
|
-
expect(cssCompiled).to.contain('--color-
|
|
79
|
-
// --
|
|
80
|
-
expect(cssCompiled).to.contain('--
|
|
81
|
-
expect(cssCompiled).to.contain('--
|
|
82
|
-
|
|
83
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
84
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
85
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
86
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
87
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
88
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
89
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
90
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
91
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
92
|
-
expect(cssCompiled).to.contain('--extract-colors-
|
|
93
|
-
|
|
94
|
-
expect(cssCompiled).to.contain('--
|
|
95
|
-
expect(cssCompiled).to.contain('--
|
|
96
|
-
// --
|
|
97
|
-
expect(cssCompiled).to.contain('--no-
|
|
98
|
-
expect(cssCompiled).to.contain('--no-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
expect(cssCompiled).to.contain('--
|
|
102
|
-
|
|
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
|
+
});
|
|
103
106
|
});
|
package/test/lint.test.js
CHANGED
|
@@ -1,50 +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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if(reportsValues
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
50
|
-
});
|
|
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
|
+
});
|