@guebbit/css-toolkit 1.0.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/.stylelintignore +2 -0
- package/.stylelintrc.json +23 -0
- package/LICENSE +661 -0
- package/README.md +5 -0
- package/docs/.postcssrc.cjs +12 -0
- package/docs/.vitepress/config.ts +89 -0
- package/docs/.vitepress/theme/index.js +12 -0
- package/docs/colors/bootstrap.md +1 -0
- package/docs/colors/brands.md +1 -0
- package/docs/colors/customs.md +1 -0
- package/docs/functions/colors.md +66 -0
- package/docs/functions/helpers.md +1 -0
- package/docs/functions/strings.md +1 -0
- package/docs/index.md +1 -0
- package/docs/logo.svg +55 -0
- package/docs/logotype.svg +149 -0
- package/docs/mixins/build-aspect-ratio.md +1 -0
- package/docs/mixins/build-compatibility.md +23 -0
- package/docs/mixins/build-scrollbar.md +19 -0
- package/docs/mixins/create-colors.md +1 -0
- package/docs/mixins/create-helper-margin.md +25 -0
- package/docs/mixins/create-helper-padding.md +24 -0
- package/docs/mixins/create-instruction.md +33 -0
- package/index.scss +1 -0
- package/package.json +326 -0
- package/src/colors/_bootstrap.scss +180 -0
- package/src/colors/_brands.scss +20 -0
- package/src/colors/_customs.scss +53 -0
- package/src/colors/_index.scss +205 -0
- package/src/functions/_colors.scss +111 -0
- package/src/functions/_helpers.scss +23 -0
- package/src/functions/_strings.scss +31 -0
- package/src/index.scss +14 -0
- package/src/mixins/_build-aspect-ratio.scss +34 -0
- package/src/mixins/_build-compatibility.scss +28 -0
- package/src/mixins/_build-scrollbar.scss +32 -0
- package/src/mixins/_create-colors.scss +119 -0
- package/src/mixins/_create-helper-margin.scss +39 -0
- package/src/mixins/_create-helper-padding.scss +40 -0
- package/src/mixins/_create-instruction.scss +11 -0
- package/test/compile.test.js +19 -0
- package/test/lint.test.js +33 -0
- package/test.scss +65 -0
- package/vite.config.ts +26 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
CSS single instructions generator
|
|
3
|
+
@param {Array<name,value>[]} measure-list - postfix name and value
|
|
4
|
+
*/
|
|
5
|
+
@mixin create-instruction($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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, it } from 'mocha';
|
|
2
|
+
import util from "util";
|
|
3
|
+
import * as sass from "sass";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
describe("COMPILE", function() {
|
|
11
|
+
this.timeout(10000);
|
|
12
|
+
it("Compiles in CSS", () => {
|
|
13
|
+
const sassRender = util.promisify(sass.render);
|
|
14
|
+
return sassRender({
|
|
15
|
+
includePaths: ['./scss'],
|
|
16
|
+
file: path.join(__dirname, '../test.scss')
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, it } from 'mocha';
|
|
2
|
+
import stylelint from "stylelint";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import styleLintFormatter from "stylelint-config-standard-scss";
|
|
5
|
+
import assert from "assert";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
describe("LINT", () => {
|
|
14
|
+
it('Generic linting', async () => {
|
|
15
|
+
return stylelint.lint({
|
|
16
|
+
configFile: path.join(__dirname, '../.stylelintrc.json'),
|
|
17
|
+
ignorePath: path.join(__dirname, '../.stylelintignore'),
|
|
18
|
+
formatter: styleLintFormatter,
|
|
19
|
+
files: [
|
|
20
|
+
path.join(__dirname, '../test.scss'),
|
|
21
|
+
],
|
|
22
|
+
}).then(function (lintResults) {
|
|
23
|
+
// console.log("results", lintResults.results)
|
|
24
|
+
// console.log("output", lintResults.output)
|
|
25
|
+
// console.log("errored", lintResults.errored)
|
|
26
|
+
return assert.ok(!lintResults.errored);
|
|
27
|
+
}).catch(function (error) {
|
|
28
|
+
// do things with err e.g.
|
|
29
|
+
console.error("ERROR", error);
|
|
30
|
+
return false;
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
package/test.scss
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@use "./src" as guebbit;
|
|
2
|
+
|
|
3
|
+
@include guebbit.create-colors(guebbit.$colors-collection);
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@include guebbit.create-helper-margin((
|
|
7
|
+
(auto, auto),
|
|
8
|
+
(6, 6px),
|
|
9
|
+
(12, 12px),
|
|
10
|
+
(24, 24px),
|
|
11
|
+
(36, 36px),
|
|
12
|
+
(48, 48px),
|
|
13
|
+
));
|
|
14
|
+
|
|
15
|
+
@include guebbit.create-helper-padding((
|
|
16
|
+
(6, 6px),
|
|
17
|
+
(12, 12px),
|
|
18
|
+
(24, 24px),
|
|
19
|
+
(36, 36px),
|
|
20
|
+
(48, 48px),
|
|
21
|
+
));
|
|
22
|
+
|
|
23
|
+
@include guebbit.create-instruction("font-size", (
|
|
24
|
+
(n2, 0.6em),
|
|
25
|
+
(n1, 0.8em),
|
|
26
|
+
(1, 1.2em),
|
|
27
|
+
(2, 1.5em),
|
|
28
|
+
(3, 2em),
|
|
29
|
+
));
|
|
30
|
+
|
|
31
|
+
@include guebbit.create-instruction("opacity", (
|
|
32
|
+
(0, 0),
|
|
33
|
+
(25, 0.25),
|
|
34
|
+
(50, 0.50),
|
|
35
|
+
(75, 0.75),
|
|
36
|
+
(100, 1),
|
|
37
|
+
));
|
|
38
|
+
|
|
39
|
+
@include guebbit.create-instruction("width", (
|
|
40
|
+
(25, 25%),
|
|
41
|
+
(50, 50%),
|
|
42
|
+
(75, 75%),
|
|
43
|
+
(100, 100%),
|
|
44
|
+
(p25, 25px),
|
|
45
|
+
(p50, 50px),
|
|
46
|
+
(p75, 75px),
|
|
47
|
+
(p100, 100px)
|
|
48
|
+
), true);
|
|
49
|
+
|
|
50
|
+
@include guebbit.create-instruction("min-width", (
|
|
51
|
+
(25, 25%),
|
|
52
|
+
(50, 50%),
|
|
53
|
+
(75, 75%),
|
|
54
|
+
(100, 100%),
|
|
55
|
+
(p25, 25px),
|
|
56
|
+
(p50, 50px),
|
|
57
|
+
(p75, 75px),
|
|
58
|
+
(p100, 100px)
|
|
59
|
+
), true);
|
|
60
|
+
|
|
61
|
+
@include guebbit.create-instruction("gap", (
|
|
62
|
+
(6, 6px),
|
|
63
|
+
(12, 12px),
|
|
64
|
+
(24, 24px),
|
|
65
|
+
), true, "flex-");
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
// root: "/",
|
|
6
|
+
build: {
|
|
7
|
+
outDir: path.join(__dirname, "dist"),
|
|
8
|
+
lib: {
|
|
9
|
+
entry: path.resolve(__dirname, "index.scss"), // TODO library.scss (import the various components)
|
|
10
|
+
name: "@guebbit/css-toolkit",
|
|
11
|
+
fileName: "css-toolkit",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
server: {
|
|
15
|
+
port: 8080,
|
|
16
|
+
},
|
|
17
|
+
resolve: {
|
|
18
|
+
alias: [
|
|
19
|
+
{
|
|
20
|
+
find: '@',
|
|
21
|
+
replacement: path.resolve(__dirname, 'src')
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
plugins: [],
|
|
26
|
+
});
|