@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,135 +1,143 @@
|
|
|
1
|
-
@use "sass:color";
|
|
2
|
-
@use "sass:math";
|
|
3
|
-
@use "sass:meta";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Return opaque color
|
|
7
|
-
* color-opaque(#fff, rgba(0, 0, 0, .5)) => #808080
|
|
8
|
-
* function credited to https://getbootstrap.com/
|
|
9
|
-
*/
|
|
10
|
-
@function color-opaque($background, $foreground) {
|
|
11
|
-
@return color.mix(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
* See https://
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1
|
+
@use "sass:color";
|
|
2
|
+
@use "sass:math";
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Return opaque color
|
|
7
|
+
* color-opaque(#fff, rgba(0, 0, 0, .5)) => #808080
|
|
8
|
+
* function credited to https://getbootstrap.com/
|
|
9
|
+
*/
|
|
10
|
+
@function color-opaque($background, $foreground) {
|
|
11
|
+
@return color.mix(
|
|
12
|
+
rgba($foreground, 1),
|
|
13
|
+
$background,
|
|
14
|
+
color.opacity($foreground) * 100%
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Tint a color
|
|
20
|
+
*/
|
|
21
|
+
@function color-tint($color, $weight) {
|
|
22
|
+
// Creates a physical mixture with white color
|
|
23
|
+
@return color.mix(#fff, $color, $weight);
|
|
24
|
+
// Adjusts properties (like lightness) relative to the color's current values.
|
|
25
|
+
// @return color.scale($color, $lightness: $weight);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Shade a color
|
|
30
|
+
*/
|
|
31
|
+
@function color-shade($color, $weight) {
|
|
32
|
+
@return color.mix(#000, $color, $weight);
|
|
33
|
+
// @return color.scale($color, $lightness: -$weight);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Shade the color if the weight is positive, else tint it
|
|
38
|
+
* function credited to https://getbootstrap.com/
|
|
39
|
+
*/
|
|
40
|
+
@function color-shift($color, $weight) {
|
|
41
|
+
@if $weight > 0 {
|
|
42
|
+
@return color-shade($color, $weight);
|
|
43
|
+
}
|
|
44
|
+
@return color-tint($color, -$weight);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Return WCAG2.1 relative luminance
|
|
49
|
+
* See https://www.w3.org/TR/WCAG/#dfn-relative-luminance
|
|
50
|
+
* See https://en.wikipedia.org/wiki/Relative_luminance
|
|
51
|
+
* Gives %, less than 50 darker is better, less than 50, lighter.
|
|
52
|
+
* Function like color.channel($color, "lightness", $space: hsl) gives a different %
|
|
53
|
+
*/
|
|
54
|
+
@function color-luminance($color) {
|
|
55
|
+
// fallback
|
|
56
|
+
@if $color == transparent or meta.type-of($color) != color {
|
|
57
|
+
@return 100;
|
|
58
|
+
}
|
|
59
|
+
@return math.div(
|
|
60
|
+
(
|
|
61
|
+
(color.channel($color, "red", $space: rgb) * 0.299) +
|
|
62
|
+
(color.channel($color, "green", $space: rgb) * 0.587) +
|
|
63
|
+
(color.channel($color, "blue", $space: rgb) * 0.114)
|
|
64
|
+
),
|
|
65
|
+
255
|
|
66
|
+
) *
|
|
67
|
+
100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Compares contrast of a given color to the light/dark arguments and returns whichever is most "contrasty"
|
|
72
|
+
*/
|
|
73
|
+
@function color-contrast($color: #fff, $dark: #000, $light: #fff) {
|
|
74
|
+
@if meta.type-of($color) != color or $color == transparent {
|
|
75
|
+
@return inherit;
|
|
76
|
+
}
|
|
77
|
+
$color-brightness: color-luminance($color);
|
|
78
|
+
$light-text-brightness: color-luminance($light);
|
|
79
|
+
$dark-text-brightness: color-luminance($dark);
|
|
80
|
+
|
|
81
|
+
@if math.abs($color-brightness - $light-text-brightness) >
|
|
82
|
+
math.abs($color-brightness - $dark-text-brightness)
|
|
83
|
+
{
|
|
84
|
+
@return $light;
|
|
85
|
+
}
|
|
86
|
+
@return $dark;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* NEW numeric annotation
|
|
91
|
+
* Hex to RGB (only numbers, transparentize would add rgba(*))
|
|
92
|
+
* $color
|
|
93
|
+
* $alpha:
|
|
94
|
+
* - 0: never 4° digit
|
|
95
|
+
* - 1: always 4° digit
|
|
96
|
+
* - 2: 4° digit only when needed
|
|
97
|
+
* $classic: false = new number annotation
|
|
98
|
+
*/
|
|
99
|
+
@function extract-colors($color: #fff, $mode: 2, $classic: false) {
|
|
100
|
+
// colors only
|
|
101
|
+
@if $color == transparent or meta.type-of($color) != color {
|
|
102
|
+
@return $color;
|
|
103
|
+
}
|
|
104
|
+
// new annotation
|
|
105
|
+
$delimiter: " ";
|
|
106
|
+
$delimiter-alpha: " / ";
|
|
107
|
+
// old annotation
|
|
108
|
+
@if $classic {
|
|
109
|
+
$delimiter: ", ";
|
|
110
|
+
$delimiter-alpha: ", ";
|
|
111
|
+
}
|
|
112
|
+
$alpha: color.alpha($color);
|
|
113
|
+
@if $mode == 1 or ($mode == 2 and $alpha == 1) {
|
|
114
|
+
@return color.channel($color, "red", $space: rgb) + $delimiter +
|
|
115
|
+
color.channel($color, "green", $space: rgb) + $delimiter +
|
|
116
|
+
color.channel($color, "blue", $space: rgb);
|
|
117
|
+
}
|
|
118
|
+
// Regular RGBA compliant result ("number" notation)
|
|
119
|
+
@return color.channel($color, "red", $space: rgb) + $delimiter +
|
|
120
|
+
color.channel($color, "green", $space: rgb) + $delimiter +
|
|
121
|
+
color.channel($color, "blue", $space: rgb) + $delimiter-alpha +
|
|
122
|
+
color.channel($color, "alpha"); // * 100%
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Create default collection
|
|
127
|
+
* @param $color
|
|
128
|
+
*/
|
|
129
|
+
@function create-collection($color: #fff) {
|
|
130
|
+
$list: (
|
|
131
|
+
"100": color-tint($color, 80%),
|
|
132
|
+
"200": color-tint($color, 60%),
|
|
133
|
+
"300": color-tint($color, 40%),
|
|
134
|
+
"400": color-tint($color, 20%),
|
|
135
|
+
"500": $color,
|
|
136
|
+
"600": color-shade($color, 20%),
|
|
137
|
+
"700": color-shade($color, 40%),
|
|
138
|
+
"800": color-shade($color, 60%),
|
|
139
|
+
"900": color-shade($color, 80%),
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
@return $list;
|
|
143
|
+
}
|
|
@@ -1,44 +1,51 @@
|
|
|
1
|
-
@use "sass:map" as map;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Giving a list of variables and values,
|
|
5
|
-
* from start to end, try all the values until a non-null is found
|
|
6
|
-
*/
|
|
7
|
-
@function no-null-var($list: ()){
|
|
8
|
-
@each $value in $list {
|
|
9
|
-
// stylelint-disable-next-line scss/at-if-no-null
|
|
10
|
-
@if $value != null and $value != undefined {
|
|
11
|
-
@return $value;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
@return null;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* If the color is the checked one, return inherit
|
|
19
|
-
*/
|
|
20
|
-
@function no-target-var($check: transparent, $color: transparent){
|
|
21
|
-
@if $color == $check {
|
|
22
|
-
@return inherit;
|
|
23
|
-
}
|
|
24
|
-
@return $color;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
* @parameter {Variable} $
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
// );
|
|
38
|
-
|
|
39
|
-
@
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
@use "sass:map" as map;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Giving a list of variables and values,
|
|
5
|
+
* from start to end, try all the values until a non-null is found
|
|
6
|
+
*/
|
|
7
|
+
@function no-null-var($list: ()) {
|
|
8
|
+
@each $value in $list {
|
|
9
|
+
// stylelint-disable-next-line scss/at-if-no-null
|
|
10
|
+
@if $value != null and $value != undefined {
|
|
11
|
+
@return $value;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
@return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* If the color is the checked one, return inherit
|
|
19
|
+
*/
|
|
20
|
+
@function no-target-var($check: transparent, $color: transparent) {
|
|
21
|
+
@if $color == $check {
|
|
22
|
+
@return inherit;
|
|
23
|
+
}
|
|
24
|
+
@return $color;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* This function is to be used to return nested key values within a nested map
|
|
29
|
+
* @parameter {Variable} $map [null] - pass in map to be evaluated
|
|
30
|
+
* @parameter {Variable} $keys [null] - pass in keys to be evaluated
|
|
31
|
+
*/
|
|
32
|
+
// $map: (
|
|
33
|
+
// 'size': (
|
|
34
|
+
// 'sml': 10px
|
|
35
|
+
// )
|
|
36
|
+
// );
|
|
37
|
+
// $var: map-deep-get($map, 'size', 'sml'); // => 10px
|
|
38
|
+
@function map-deep-get($map, $keys...) {
|
|
39
|
+
@each $key in $keys {
|
|
40
|
+
$map: map.get($map, $key);
|
|
41
|
+
}
|
|
42
|
+
@return $map;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Read a color value from a 2-level color map collection
|
|
47
|
+
* Example: color-get($colors-collection, "blue", "500")
|
|
48
|
+
*/
|
|
49
|
+
@function color-get($collection, $group, $shade) {
|
|
50
|
+
@return map.get(map.get($collection, $group), $shade);
|
|
51
|
+
}
|
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Split string into lists
|
|
6
|
+
*/
|
|
7
|
+
@function string-split($string, $separator: "-") {
|
|
8
|
+
// empty array/list
|
|
9
|
+
$split-arr: ();
|
|
10
|
+
// first index of separator in string
|
|
11
|
+
$index: string.index($string, $separator);
|
|
12
|
+
// loop through string
|
|
13
|
+
@while $index != null {
|
|
14
|
+
// get the substring from the first character to the separator
|
|
15
|
+
$item: string.slice($string, 1, $index - 1);
|
|
16
|
+
// push item to array
|
|
17
|
+
$split-arr: list.append($split-arr, $item);
|
|
18
|
+
// remove item and separator from string
|
|
19
|
+
$string: string.slice($string, $index + 1);
|
|
20
|
+
// find new index of separator
|
|
21
|
+
$index: string.index($string, $separator);
|
|
22
|
+
}
|
|
23
|
+
// add the remaining string to list (the last item)
|
|
24
|
+
$split-arr: list.append($split-arr, $string);
|
|
25
|
+
|
|
26
|
+
@return $split-arr;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
Check if $string ends with $find
|
|
31
|
+
*/
|
|
32
|
+
@function string-ends-with($string, $find) {
|
|
33
|
+
@return (string.length($string) >= string.length($find)) and
|
|
34
|
+
(
|
|
35
|
+
string.slice($string, (string.length($string) - string.length($find) + 1))
|
|
36
|
+
== $find
|
|
37
|
+
);
|
|
38
|
+
}
|
package/src/index.scss
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
@forward "./colors";
|
|
2
|
-
|
|
3
|
-
@forward "./functions/colors";
|
|
4
|
-
@forward "./functions/helpers";
|
|
5
|
-
@forward "./functions/strings";
|
|
6
|
-
|
|
7
|
-
@forward "./mixins/build-aspect-ratio";
|
|
8
|
-
@forward "./mixins/build-compatibility";
|
|
9
|
-
@forward "./mixins/build-scrollbar";
|
|
10
|
-
@forward "./mixins/create-colors";
|
|
11
|
-
@forward "./mixins/create-colors-vars";
|
|
12
|
-
@forward "./mixins/create-class";
|
|
13
|
-
@forward "./mixins/create-helper-margin";
|
|
14
|
-
@forward "./mixins/create-helper-padding";
|
|
1
|
+
@forward "./colors";
|
|
2
|
+
|
|
3
|
+
@forward "./functions/colors";
|
|
4
|
+
@forward "./functions/helpers";
|
|
5
|
+
@forward "./functions/strings";
|
|
6
|
+
|
|
7
|
+
@forward "./mixins/build-aspect-ratio";
|
|
8
|
+
@forward "./mixins/build-compatibility";
|
|
9
|
+
@forward "./mixins/build-scrollbar";
|
|
10
|
+
@forward "./mixins/create-colors";
|
|
11
|
+
@forward "./mixins/create-colors-vars";
|
|
12
|
+
@forward "./mixins/create-class";
|
|
13
|
+
@forward "./mixins/create-helper-margin";
|
|
14
|
+
@forward "./mixins/create-helper-padding";
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
@use "../functions/strings" as guebbit;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Use in the parent\container, to be coupled with {build-aspect-ratio-anchor}
|
|
5
|
-
*/
|
|
6
|
-
@mixin build-aspect-ratio-container($ratio: 100%){
|
|
7
|
-
position: relative;
|
|
8
|
-
// aspect-ratio: #{$height} / #{$width};
|
|
9
|
-
|
|
10
|
-
&::before{
|
|
11
|
-
content: "";
|
|
12
|
-
display: block;
|
|
13
|
-
padding-top: #{$ratio};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Use in the child that "gives" form to the parent that has the respective {build-aspect-ratio-container}
|
|
19
|
-
*/
|
|
20
|
-
@mixin build-aspect-ratio-anchor{
|
|
21
|
-
position: absolute;
|
|
22
|
-
top: 0;
|
|
23
|
-
left: 0;
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 100%;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* aspect ratio shortcut
|
|
30
|
-
*/
|
|
31
|
-
@mixin build-aspect-ratio($ratio: 100%){
|
|
32
|
-
@include build-aspect-ratio-container($ratio);
|
|
33
|
-
|
|
34
|
-
& > * {
|
|
35
|
-
@include build-aspect-ratio-anchor;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
@use "../functions/strings" as guebbit;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Use in the parent\container, to be coupled with {build-aspect-ratio-anchor}
|
|
5
|
+
*/
|
|
6
|
+
@mixin build-aspect-ratio-container($ratio: 100%) {
|
|
7
|
+
position: relative;
|
|
8
|
+
// aspect-ratio: #{$height} / #{$width};
|
|
9
|
+
|
|
10
|
+
&::before {
|
|
11
|
+
content: "";
|
|
12
|
+
display: block;
|
|
13
|
+
padding-top: #{$ratio};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Use in the child that "gives" form to the parent that has the respective {build-aspect-ratio-container}
|
|
19
|
+
*/
|
|
20
|
+
@mixin build-aspect-ratio-anchor {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* aspect ratio shortcut
|
|
30
|
+
*/
|
|
31
|
+
@mixin build-aspect-ratio($ratio: 100%) {
|
|
32
|
+
@include build-aspect-ratio-container($ratio);
|
|
33
|
+
|
|
34
|
+
& > * {
|
|
35
|
+
@include build-aspect-ratio-anchor;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compatibility mode for browsers
|
|
3
|
-
* @param string $browser: target browser
|
|
4
|
-
* @content
|
|
5
|
-
**/
|
|
6
|
-
@mixin build-compatibility($browser) {
|
|
7
|
-
// INTERNET EXPLORER
|
|
8
|
-
@if $browser == "ie" {
|
|
9
|
-
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
|
10
|
-
@content;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
// MICROSOFT EDGE
|
|
14
|
-
@if $browser == "edge" {
|
|
15
|
-
@supports (-ms-ime-align:auto) {
|
|
16
|
-
@content;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
// FIREFOX
|
|
20
|
-
@if $browser == "firefox" {
|
|
21
|
-
@supports (-moz-appearance:none) {
|
|
22
|
-
@content;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// OPERA
|
|
27
|
-
@if $browser == "opera" {
|
|
28
|
-
@supports (-o-object-fit: fill) {
|
|
29
|
-
@content;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// SAFARI
|
|
34
|
-
@if $browser == "safari" {
|
|
35
|
-
@supports (background: -webkit-named-image(i)) and
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility mode for browsers
|
|
3
|
+
* @param string $browser: target browser
|
|
4
|
+
* @content
|
|
5
|
+
**/
|
|
6
|
+
@mixin build-compatibility($browser) {
|
|
7
|
+
// INTERNET EXPLORER
|
|
8
|
+
@if $browser == "ie" {
|
|
9
|
+
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
|
10
|
+
@content;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
// MICROSOFT EDGE
|
|
14
|
+
@if $browser == "edge" {
|
|
15
|
+
@supports (-ms-ime-align: auto) {
|
|
16
|
+
@content;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// FIREFOX
|
|
20
|
+
@if $browser == "firefox" {
|
|
21
|
+
@supports (-moz-appearance: none) {
|
|
22
|
+
@content;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// OPERA
|
|
27
|
+
@if $browser == "opera" {
|
|
28
|
+
@supports (-o-object-fit: fill) {
|
|
29
|
+
@content;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// SAFARI
|
|
34
|
+
@if $browser == "safari" {
|
|
35
|
+
@supports (background: -webkit-named-image(i)) and
|
|
36
|
+
(not (-webkit-touch-callout: none)) {
|
|
37
|
+
@content;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|