@guebbit/css-toolkit 1.3.2 → 1.4.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 +3 -6
- package/docs/.postcssrc.cjs +12 -12
- package/docs/.vitepress/cache/deps/_metadata.json +52 -0
- package/docs/.vitepress/cache/deps/chunk-GD2PZ323.js +9709 -0
- package/docs/.vitepress/cache/deps/chunk-GD2PZ323.js.map +7 -0
- package/docs/.vitepress/cache/deps/chunk-LW4I4DCF.js +12542 -0
- package/docs/.vitepress/cache/deps/chunk-LW4I4DCF.js.map +7 -0
- package/docs/.vitepress/cache/deps/package.json +3 -0
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4504 -0
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +581 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js +1145 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js +1665 -0
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js +1839 -0
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js.map +7 -0
- package/docs/.vitepress/cache/deps/vue.js +343 -0
- package/docs/.vitepress/cache/deps/vue.js.map +7 -0
- package/docs/.vitepress/config.ts +89 -89
- package/docs/.vitepress/dist/404.html +3 -3
- package/docs/.vitepress/dist/assets/{app.CBPosL5d.js → app.L5XIc3SO.js} +1 -1
- package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.BjS_jZ-W.js +1 -0
- package/docs/.vitepress/dist/assets/chunks/{VPLocalSearchBox.gSyUO2Y7.js → VPLocalSearchBox.D9sh6SyY.js} +1 -1
- package/docs/.vitepress/dist/assets/chunks/{theme.BeEqdqye.js → theme.CNmpkBNC.js} +2 -2
- package/docs/.vitepress/dist/assets/colors_bootstrap.md.CoHKBFV-.js +183 -0
- package/docs/.vitepress/dist/assets/colors_bootstrap.md.CoHKBFV-.lean.js +1 -0
- package/docs/.vitepress/dist/assets/colors_brands.md.D66byFIK.js +34 -0
- package/docs/.vitepress/dist/assets/colors_brands.md.D66byFIK.lean.js +1 -0
- package/docs/.vitepress/dist/assets/colors_customs.md.BOrXeoM5.js +53 -0
- package/docs/.vitepress/dist/assets/colors_customs.md.BOrXeoM5.lean.js +1 -0
- package/docs/.vitepress/dist/assets/{functions_colors.md.BsOBqU9L.js → functions_colors.md.-D_m804_.js} +12 -4
- package/docs/.vitepress/dist/assets/functions_colors.md.-D_m804_.lean.js +1 -0
- package/docs/.vitepress/dist/assets/functions_helpers.md.ByBd49Zv.js +51 -0
- package/docs/.vitepress/dist/assets/functions_helpers.md.ByBd49Zv.lean.js +1 -0
- package/docs/.vitepress/dist/assets/functions_strings.md.BQe_bdya.js +38 -0
- package/docs/.vitepress/dist/assets/functions_strings.md.BQe_bdya.lean.js +1 -0
- package/docs/.vitepress/dist/assets/index.md.B1EiZFo_.js +1 -0
- package/docs/.vitepress/dist/assets/index.md.B1EiZFo_.lean.js +1 -0
- package/docs/.vitepress/dist/assets/mixins_build-aspect-ratio.md.ICFUpBeX.js +39 -0
- package/docs/.vitepress/dist/assets/mixins_build-aspect-ratio.md.ICFUpBeX.lean.js +1 -0
- package/docs/.vitepress/dist/assets/{mixins_build-compatibility.md.DvZg2OSO.js → mixins_build-compatibility.md.CmlXWpxv.js} +4 -3
- package/docs/.vitepress/dist/assets/{mixins_build-scrollbar.md.Bze7PgzU.js → mixins_build-scrollbar.md.hZriM4ET.js} +7 -2
- package/docs/.vitepress/dist/assets/mixins_create-colors.md.D6f2BMAy.js +204 -0
- package/docs/.vitepress/dist/assets/mixins_create-colors.md.D6f2BMAy.lean.js +1 -0
- package/docs/.vitepress/dist/assets/{mixins_create-helper-margin.md.DqwBKQ0G.js → mixins_create-helper-margin.md.CFz5if3z.js} +18 -18
- package/docs/.vitepress/dist/assets/mixins_create-helper-margin.md.CFz5if3z.lean.js +1 -0
- package/docs/.vitepress/dist/assets/mixins_create-helper-padding.md.Ct06sNMx.js +50 -0
- package/docs/.vitepress/dist/assets/mixins_create-helper-padding.md.Ct06sNMx.lean.js +1 -0
- package/docs/.vitepress/dist/assets/{mixins_create-instruction.md.BeAIoeQx.js → mixins_create-instruction.md.B0iVQyHl.js} +18 -4
- package/docs/.vitepress/dist/colors/bootstrap.html +189 -7
- package/docs/.vitepress/dist/colors/brands.html +40 -7
- package/docs/.vitepress/dist/colors/customs.html +59 -7
- package/docs/.vitepress/dist/functions/colors.html +16 -8
- package/docs/.vitepress/dist/functions/helpers.html +57 -7
- package/docs/.vitepress/dist/functions/strings.html +44 -7
- package/docs/.vitepress/dist/hashmap.json +1 -1
- package/docs/.vitepress/dist/index.html +6 -6
- package/docs/.vitepress/dist/mixins/build-aspect-ratio.html +45 -7
- package/docs/.vitepress/dist/mixins/build-compatibility.html +10 -9
- package/docs/.vitepress/dist/mixins/build-scrollbar.html +12 -7
- package/docs/.vitepress/dist/mixins/create-colors.html +210 -7
- package/docs/.vitepress/dist/mixins/create-helper-margin.html +23 -23
- package/docs/.vitepress/dist/mixins/create-helper-padding.html +39 -34
- package/docs/.vitepress/dist/mixins/create-instruction.html +24 -10
- package/docs/.vitepress/theme/index.js +12 -12
- package/docs/colors/bootstrap.md +18 -1
- package/docs/colors/brands.md +8 -1
- package/docs/colors/customs.md +8 -1
- package/docs/functions/colors.md +71 -66
- package/docs/functions/helpers.md +15 -1
- package/docs/functions/strings.md +13 -1
- package/docs/index.md +1 -1
- package/docs/logo.svg +55 -55
- package/docs/logotype.svg +149 -149
- package/docs/mixins/build-aspect-ratio.md +16 -1
- package/docs/mixins/build-compatibility.md +24 -23
- package/docs/mixins/build-scrollbar.md +21 -19
- package/docs/mixins/create-colors.md +16 -1
- package/docs/mixins/create-helper-margin.md +21 -25
- package/docs/mixins/create-helper-padding.md +21 -24
- package/docs/mixins/create-instruction.md +38 -33
- package/index.scss +1 -1
- package/package.json +67 -61
- package/src/colors/_bootstrap.scss +179 -180
- package/src/colors/_brands.scss +34 -20
- package/src/colors/_customs.scss +53 -53
- package/src/colors/_index.scss +200 -200
- package/src/functions/_colors.scss +143 -135
- package/src/functions/_helpers.scss +51 -44
- package/src/functions/_strings.scss +38 -31
- package/src/index.scss +14 -14
- package/src/mixins/_build-aspect-ratio.scss +37 -37
- package/src/mixins/_build-compatibility.scss +40 -39
- package/src/mixins/_build-scrollbar.scss +37 -32
- package/src/mixins/_create-class.scss +29 -19
- package/src/mixins/_create-colors-vars.scss +31 -27
- package/src/mixins/_create-colors.scss +202 -155
- package/src/mixins/_create-helper-margin.scss +43 -39
- package/src/mixins/_create-helper-padding.scss +47 -40
- package/test/compile.test.js +197 -132
- package/test/lint.test.js +43 -48
- package/test/test.css +32 -0
- package/test/test.scss +216 -197
- package/vite.config.ts +26 -26
- package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.C6BRpH9I.js +0 -1
- package/docs/.vitepress/dist/assets/colors_bootstrap.md.CFg-dNGF.js +0 -1
- package/docs/.vitepress/dist/assets/colors_bootstrap.md.CFg-dNGF.lean.js +0 -1
- package/docs/.vitepress/dist/assets/colors_brands.md.CUxoS0ml.js +0 -1
- package/docs/.vitepress/dist/assets/colors_brands.md.CUxoS0ml.lean.js +0 -1
- package/docs/.vitepress/dist/assets/colors_customs.md.CnHhl84q.js +0 -1
- package/docs/.vitepress/dist/assets/colors_customs.md.CnHhl84q.lean.js +0 -1
- package/docs/.vitepress/dist/assets/functions_colors.md.BsOBqU9L.lean.js +0 -1
- package/docs/.vitepress/dist/assets/functions_helpers.md.B3A_IOEL.js +0 -1
- package/docs/.vitepress/dist/assets/functions_helpers.md.B3A_IOEL.lean.js +0 -1
- package/docs/.vitepress/dist/assets/functions_strings.md.BdV8Kx9J.js +0 -1
- package/docs/.vitepress/dist/assets/functions_strings.md.BdV8Kx9J.lean.js +0 -1
- package/docs/.vitepress/dist/assets/index.md.Cn1TneoC.js +0 -1
- package/docs/.vitepress/dist/assets/index.md.Cn1TneoC.lean.js +0 -1
- package/docs/.vitepress/dist/assets/mixins_build-aspect-ratio.md.cD70Q1mW.js +0 -1
- package/docs/.vitepress/dist/assets/mixins_build-aspect-ratio.md.cD70Q1mW.lean.js +0 -1
- package/docs/.vitepress/dist/assets/mixins_create-colors.md.Bi4iqAHf.js +0 -1
- package/docs/.vitepress/dist/assets/mixins_create-colors.md.Bi4iqAHf.lean.js +0 -1
- package/docs/.vitepress/dist/assets/mixins_create-helper-margin.md.DqwBKQ0G.lean.js +0 -1
- package/docs/.vitepress/dist/assets/mixins_create-helper-padding.md.Br9TOGl1.js +0 -45
- package/docs/.vitepress/dist/assets/mixins_create-helper-padding.md.Br9TOGl1.lean.js +0 -1
- /package/docs/.vitepress/dist/assets/{mixins_build-compatibility.md.DvZg2OSO.lean.js → mixins_build-compatibility.md.CmlXWpxv.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{mixins_build-scrollbar.md.Bze7PgzU.lean.js → mixins_build-scrollbar.md.hZriM4ET.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{mixins_create-instruction.md.BeAIoeQx.lean.js → mixins_create-instruction.md.B0iVQyHl.lean.js} +0 -0
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builder - scrollbars of element
|
|
3
|
-
* @param string $color
|
|
4
|
-
* @param pixels $size
|
|
5
|
-
* @param $background: if false, has default lighten 40%
|
|
6
|
-
*/
|
|
7
|
-
@mixin build-scrollbar(
|
|
8
|
-
$
|
|
9
|
-
$
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
background-color: $
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
background-color: $fallback-
|
|
30
|
-
background-color: $
|
|
31
|
-
}
|
|
32
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Builder - scrollbars of element
|
|
3
|
+
* @param string $color
|
|
4
|
+
* @param pixels $size
|
|
5
|
+
* @param $background: if false, has default lighten 40%
|
|
6
|
+
*/
|
|
7
|
+
@mixin build-scrollbar(
|
|
8
|
+
$size: "4px",
|
|
9
|
+
$color: "#fff",
|
|
10
|
+
$bg: "auto",
|
|
11
|
+
$radius: "10px"
|
|
12
|
+
) {
|
|
13
|
+
$fallback-color: #fff;
|
|
14
|
+
$fallback-bg: transparent;
|
|
15
|
+
|
|
16
|
+
@if $bg == "auto" {
|
|
17
|
+
$bg: $fallback-bg;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&::-webkit-scrollbar {
|
|
21
|
+
width: $size;
|
|
22
|
+
height: $size;
|
|
23
|
+
background-color: $fallback-bg;
|
|
24
|
+
background-color: $bg;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&::-webkit-scrollbar-thumb {
|
|
28
|
+
border-radius: $radius;
|
|
29
|
+
background-color: $fallback-color;
|
|
30
|
+
background-color: $color;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&::-webkit-scrollbar-corner {
|
|
34
|
+
background-color: $fallback-bg;
|
|
35
|
+
background-color: $bg;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
@use "sass:list";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* CSS single instructions class generator
|
|
5
|
-
* @param measure-list - {Array<name,value>[]} postfix name and value OR just values[] (name and value will be the same)
|
|
6
|
-
*/
|
|
7
|
-
@mixin create-class(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CSS single instructions class generator
|
|
5
|
+
* @param measure-list - {Array<name,value>[]} postfix name and value OR just values[] (name and value will be the same)
|
|
6
|
+
*/
|
|
7
|
+
@mixin create-class(
|
|
8
|
+
$instruction,
|
|
9
|
+
$measure-list: (),
|
|
10
|
+
$important: false,
|
|
11
|
+
$prefix: "",
|
|
12
|
+
$delimiter: "-"
|
|
13
|
+
) {
|
|
14
|
+
$important-suffix: "";
|
|
15
|
+
@if $important == true {
|
|
16
|
+
$important-suffix: " !important";
|
|
17
|
+
}
|
|
18
|
+
@each $values in $measure-list {
|
|
19
|
+
$name: $values;
|
|
20
|
+
$val: $values;
|
|
21
|
+
@if list.length($values) > 1 {
|
|
22
|
+
$name: list.nth($values, 1);
|
|
23
|
+
$val: list.nth($values, 2);
|
|
24
|
+
}
|
|
25
|
+
.#{$prefix}#{$instruction}#{$delimiter}#{$name} {
|
|
26
|
+
#{$instruction}: #{$val}#{$important-suffix};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
@use "sass:list";
|
|
2
|
-
@use "../functions/colors" as color-functions;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Create the CSS VARS (like on root)
|
|
6
|
-
* WARNING: They will be translated in "RGB" instead of "HEX"
|
|
7
|
-
*
|
|
8
|
-
* @param $color-list - list of colors (like $colors-collection: ("branch": ( "leaf: $color" )))
|
|
9
|
-
* @param $prefix
|
|
10
|
-
*/
|
|
11
|
-
@mixin create-colors-vars($color-list: (), $prefix: "") {
|
|
12
|
-
// for every branch
|
|
13
|
-
@each $branch-name, $branch in $color-list {
|
|
14
|
-
// for every color
|
|
15
|
-
@each $color-name, $color-value in $branch {
|
|
16
|
-
// @if meta.type-of($scolor) == color {
|
|
17
|
-
--#{$prefix}#{$branch-name}-#{$color-name}: #{color-functions.extract-colors(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "../functions/colors" as color-functions;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Create the CSS VARS (like on root)
|
|
6
|
+
* WARNING: They will be translated in "RGB" instead of "HEX"
|
|
7
|
+
*
|
|
8
|
+
* @param $color-list - list of colors (like $colors-collection: ("branch": ( "leaf: $color" )))
|
|
9
|
+
* @param $prefix
|
|
10
|
+
*/
|
|
11
|
+
@mixin create-colors-vars($color-list: (), $prefix: "") {
|
|
12
|
+
// for every branch
|
|
13
|
+
@each $branch-name, $branch in $color-list {
|
|
14
|
+
// for every color
|
|
15
|
+
@each $color-name, $color-value in $branch {
|
|
16
|
+
// @if meta.type-of($scolor) == color {
|
|
17
|
+
--#{$prefix}#{$branch-name}-#{$color-name}: #{color-functions.extract-colors(
|
|
18
|
+
$color-value
|
|
19
|
+
)};
|
|
20
|
+
// _}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@each $color-name, $color-value in $branch {
|
|
24
|
+
// @if meta.type-of($scolor) == color {
|
|
25
|
+
--#{$prefix}on-#{$branch-name}-#{$color-name}: #{color-functions.extract-colors(
|
|
26
|
+
color-functions.color-contrast($color-value)
|
|
27
|
+
)};
|
|
28
|
+
// _}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,155 +1,202 @@
|
|
|
1
|
-
@use "sass:list";
|
|
2
|
-
@use "sass:string";
|
|
3
|
-
@use "../functions/colors" as color-functions;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Create all the needed classes for the requested colors
|
|
7
|
-
* WARNING: $gradient-* are not meant to be used in color and border classes (because they have gradients)
|
|
8
|
-
*
|
|
9
|
-
* @param $color-list - list of colors (like $colors-collection: ("branch": ( "leaf: $color" )))
|
|
10
|
-
* @param $vars: if true, use css vars instead of rgb
|
|
11
|
-
* @param $prefix: prefix that applies to classes
|
|
12
|
-
* @param $prefixV: prefix that applies to vars (if true)
|
|
13
|
-
* @param $feature-list: - when filled: becomes a whitelist. May become cumbersome and many are not needed. Use with care.
|
|
14
|
-
* - text
|
|
15
|
-
* - background
|
|
16
|
-
* - border
|
|
17
|
-
* - pseudo (bg only, text very rarely used)
|
|
18
|
-
* - hover
|
|
19
|
-
*/
|
|
20
|
-
@mixin create-colors(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
} @else {
|
|
55
|
-
.#{$prefix}#{$branch-name}-#{$color-name}-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@if list.length($feature-list) <
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
color:
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
} @else {
|
|
141
|
-
.#{$prefix}#{$branch-name}-#{$color-name}-hover-
|
|
142
|
-
&:hover {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
@use "../functions/colors" as color-functions;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Create all the needed classes for the requested colors
|
|
7
|
+
* WARNING: $gradient-* are not meant to be used in color and border classes (because they have gradients)
|
|
8
|
+
*
|
|
9
|
+
* @param $color-list - list of colors (like $colors-collection: ("branch": ( "leaf: $color" )))
|
|
10
|
+
* @param $vars: if true, use css vars instead of rgb
|
|
11
|
+
* @param $prefix: prefix that applies to classes
|
|
12
|
+
* @param $prefixV: prefix that applies to vars (if true)
|
|
13
|
+
* @param $feature-list: - when filled: becomes a whitelist. May become cumbersome and many are not needed. Use with care.
|
|
14
|
+
* - text
|
|
15
|
+
* - background
|
|
16
|
+
* - border
|
|
17
|
+
* - pseudo (bg only, text very rarely used)
|
|
18
|
+
* - hover
|
|
19
|
+
*/
|
|
20
|
+
@mixin create-colors(
|
|
21
|
+
$color-list: (),
|
|
22
|
+
$vars: false,
|
|
23
|
+
$prefix: "",
|
|
24
|
+
$prefixV: "",
|
|
25
|
+
$feature-list: ()
|
|
26
|
+
) {
|
|
27
|
+
// for every branch
|
|
28
|
+
@each $branch-name, $branch in $color-list {
|
|
29
|
+
// for every leaf
|
|
30
|
+
@each $color-name, $color-value in $branch {
|
|
31
|
+
@if not
|
|
32
|
+
list.index($branch-name, "gradient") and
|
|
33
|
+
(list.length($feature-list) < 1 or list.index($feature-list, "text"))
|
|
34
|
+
{
|
|
35
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-text {
|
|
36
|
+
@if $vars {
|
|
37
|
+
color: var(--#{$prefixV}#{$branch-name}-#{$color-name}) !important;
|
|
38
|
+
} @else {
|
|
39
|
+
color: $color-value !important;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@if not
|
|
45
|
+
list.index($branch-name, "gradient") and
|
|
46
|
+
(list.length($feature-list) < 1 or list.index($feature-list, "border"))
|
|
47
|
+
{
|
|
48
|
+
@if $vars {
|
|
49
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-border {
|
|
50
|
+
border-color: var(
|
|
51
|
+
--#{$prefixV}#{$branch-name}-#{$color-name}
|
|
52
|
+
) !important;
|
|
53
|
+
}
|
|
54
|
+
} @else {
|
|
55
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-border {
|
|
56
|
+
border-color: $color-value !important;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@if list.length($feature-list) <
|
|
62
|
+
1 or
|
|
63
|
+
list.index($feature-list, "background")
|
|
64
|
+
{
|
|
65
|
+
@if $vars {
|
|
66
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-bg {
|
|
67
|
+
background-color: var(
|
|
68
|
+
--#{$prefixV}#{$branch-name}-#{$color-name}
|
|
69
|
+
) !important;
|
|
70
|
+
color: var(
|
|
71
|
+
--#{$prefixV}on-#{$branch-name}-#{$color-name}
|
|
72
|
+
) !important;
|
|
73
|
+
}
|
|
74
|
+
} @else {
|
|
75
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-bg {
|
|
76
|
+
background-color: $color-value !important;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "pseudo")
|
|
82
|
+
{
|
|
83
|
+
@if $vars {
|
|
84
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-pseudo-bg {
|
|
85
|
+
&::after,
|
|
86
|
+
&::before {
|
|
87
|
+
background-color: var(
|
|
88
|
+
--#{$prefixV}#{$branch-name}-#{$color-name}
|
|
89
|
+
) !important;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
} @else {
|
|
93
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-pseudo-bg {
|
|
94
|
+
&::after,
|
|
95
|
+
&::before {
|
|
96
|
+
background-color: $color-value !important;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "hover") {
|
|
103
|
+
@if not
|
|
104
|
+
list.index($branch-name, "gradient") and
|
|
105
|
+
(list.length($feature-list) < 1 or list.index($feature-list, "text"))
|
|
106
|
+
{
|
|
107
|
+
@if $vars {
|
|
108
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-hover-text {
|
|
109
|
+
&:hover {
|
|
110
|
+
color: var(
|
|
111
|
+
--#{$prefixV}#{$branch-name}-#{$color-name}
|
|
112
|
+
) !important;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
} @else {
|
|
116
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-hover-text {
|
|
117
|
+
&:hover {
|
|
118
|
+
color: $color-value !important;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@if not
|
|
125
|
+
list.index($branch-name, "gradient") and
|
|
126
|
+
(
|
|
127
|
+
list.length($feature-list) <
|
|
128
|
+
1 or
|
|
129
|
+
list.index($feature-list, "border")
|
|
130
|
+
)
|
|
131
|
+
{
|
|
132
|
+
@if $vars {
|
|
133
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-hover-border {
|
|
134
|
+
&:hover {
|
|
135
|
+
border-color: var(
|
|
136
|
+
--#{$prefixV}#{$branch-name}-#{$color-name}
|
|
137
|
+
) !important;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
} @else {
|
|
141
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-hover-border {
|
|
142
|
+
&:hover {
|
|
143
|
+
border-color: $color-value !important;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@if list.length($feature-list) <
|
|
150
|
+
1 or
|
|
151
|
+
list.index($feature-list, "background")
|
|
152
|
+
{
|
|
153
|
+
@if $vars {
|
|
154
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-hover-bg {
|
|
155
|
+
&:hover {
|
|
156
|
+
background-color: var(
|
|
157
|
+
--#{$prefixV}#{$branch-name}-#{$color-name}
|
|
158
|
+
) !important;
|
|
159
|
+
color: var(
|
|
160
|
+
--#{$prefixV}on-#{$branch-name}-#{$color-name}
|
|
161
|
+
) !important;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
} @else {
|
|
165
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-hover-bg {
|
|
166
|
+
&:hover {
|
|
167
|
+
background-color: $color-value !important;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@if list.length($feature-list) <
|
|
174
|
+
1 or
|
|
175
|
+
list.index($feature-list, "pseudo")
|
|
176
|
+
{
|
|
177
|
+
@if $vars {
|
|
178
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-hover-pseudo-bg {
|
|
179
|
+
&:hover {
|
|
180
|
+
&::after,
|
|
181
|
+
&::before {
|
|
182
|
+
background-color: var(
|
|
183
|
+
--#{$prefixV}#{$branch-name}-#{$color-name}
|
|
184
|
+
) !important;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
} @else {
|
|
189
|
+
.#{$prefix}#{$branch-name}-#{$color-name}-hover-pseudo-bg {
|
|
190
|
+
&:hover {
|
|
191
|
+
&::after,
|
|
192
|
+
&::before {
|
|
193
|
+
background-color: $color-value !important;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -1,39 +1,43 @@
|
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
margin-
|
|
30
|
-
}
|
|
31
|
-
.#{$prefix}
|
|
32
|
-
margin-
|
|
33
|
-
margin-
|
|
34
|
-
}
|
|
35
|
-
.#{$prefix}
|
|
36
|
-
margin: #{$val}
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
$important-suffix: "";
|
|
15
|
+
@if $important == true {
|
|
16
|
+
$important-suffix: " !important";
|
|
17
|
+
}
|
|
18
|
+
@each $name, $val in $measure-list {
|
|
19
|
+
.#{$prefix}mt-#{$name} {
|
|
20
|
+
margin-top: #{$val}#{$important-suffix};
|
|
21
|
+
}
|
|
22
|
+
.#{$prefix}mb-#{$name} {
|
|
23
|
+
margin-bottom: #{$val}#{$important-suffix};
|
|
24
|
+
}
|
|
25
|
+
.#{$prefix}ml-#{$name} {
|
|
26
|
+
margin-left: #{$val}#{$important-suffix};
|
|
27
|
+
}
|
|
28
|
+
.#{$prefix}mr-#{$name} {
|
|
29
|
+
margin-right: #{$val}#{$important-suffix};
|
|
30
|
+
}
|
|
31
|
+
.#{$prefix}mx-#{$name} {
|
|
32
|
+
margin-right: #{$val}#{$important-suffix};
|
|
33
|
+
margin-left: #{$val}#{$important-suffix};
|
|
34
|
+
}
|
|
35
|
+
.#{$prefix}my-#{$name} {
|
|
36
|
+
margin-top: #{$val}#{$important-suffix};
|
|
37
|
+
margin-bottom: #{$val}#{$important-suffix};
|
|
38
|
+
}
|
|
39
|
+
.#{$prefix}ma-#{$name} {
|
|
40
|
+
margin: #{$val}#{$important-suffix};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|