@guebbit/css-toolkit 1.1.3 → 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/CHANGELOG +0 -2
- 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.BlbAZR_S.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.Bfy-p7dM.js → colors_bootstrap.md.B8QNot57.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_bootstrap.md.Bfy-p7dM.lean.js → colors_bootstrap.md.B8QNot57.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_brands.md.Ch21qzT7.js → colors_brands.md.DA7CAmLz.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_brands.md.Ch21qzT7.lean.js → colors_brands.md.DA7CAmLz.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_customs.md.CrumAnve.js → colors_customs.md.B9XC2fYm.js} +1 -1
- package/docs/.vitepress/dist/assets/{colors_customs.md.CrumAnve.lean.js → colors_customs.md.B9XC2fYm.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_colors.md.Dz-AUCFY.js → functions_colors.md.8WIzA1Az.js} +4 -2
- package/docs/.vitepress/dist/assets/{functions_colors.md.Dz-AUCFY.lean.js → functions_colors.md.8WIzA1Az.lean.js} +4 -2
- package/docs/.vitepress/dist/assets/{functions_helpers.md.BLiEkjA1.js → functions_helpers.md.DlnJURDc.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_helpers.md.BLiEkjA1.lean.js → functions_helpers.md.DlnJURDc.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_strings.md.BHTeKsax.js → functions_strings.md.B-I-mSmy.js} +1 -1
- package/docs/.vitepress/dist/assets/{functions_strings.md.BHTeKsax.lean.js → functions_strings.md.B-I-mSmy.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{index.md.Dwdim14B.js → index.md.DO-yHYeM.js} +1 -1
- package/docs/.vitepress/dist/assets/{index.md.Dwdim14B.lean.js → index.md.DO-yHYeM.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-aspect-ratio.md.l9MRJQQl.js → mixins_build-aspect-ratio.md.Cjv_a3MY.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-aspect-ratio.md.l9MRJQQl.lean.js → mixins_build-aspect-ratio.md.Cjv_a3MY.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-compatibility.md.t0sS5a2s.js → mixins_build-compatibility.md.BO6wODYa.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-compatibility.md.t0sS5a2s.lean.js → mixins_build-compatibility.md.BO6wODYa.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-scrollbar.md.C-TaPgpo.js → mixins_build-scrollbar.md.BX34elgD.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_build-scrollbar.md.C-TaPgpo.lean.js → mixins_build-scrollbar.md.BX34elgD.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-colors.md.Bs8hXar1.js → mixins_create-colors.md.82HeTZt6.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-colors.md.Bs8hXar1.lean.js → mixins_create-colors.md.82HeTZt6.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-helper-margin.md.BFzwO-0T.js → mixins_create-helper-margin.md.D2-T7z0a.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-helper-margin.md.BFzwO-0T.lean.js → mixins_create-helper-margin.md.D2-T7z0a.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-helper-padding.md.Ci6DL4m-.js → mixins_create-helper-padding.md.Cp-laxuA.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-helper-padding.md.Ci6DL4m-.lean.js → mixins_create-helper-padding.md.Cp-laxuA.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-instruction.md.CGTPQqQv.js → mixins_create-instruction.md.dJ83FO6R.js} +1 -1
- package/docs/.vitepress/dist/assets/{mixins_create-instruction.md.CGTPQqQv.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 +11 -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 -63
- 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 +180 -181
- package/src/colors/_brands.scss +19 -19
- package/src/colors/_customs.scss +52 -54
- package/src/colors/_index.scss +199 -199
- package/src/functions/_colors.scss +121 -108
- 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 -96
- package/test/lint.test.js +48 -50
- package/test/test.css +499 -484
- package/test/test.scss +158 -147
- package/vite.config.ts +25 -25
- package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.KjYvZcUz.js +0 -1
- package/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.BwVVD-os.js +0 -7
- package/docs/.vitepress/dist/assets/chunks/framework.Bt53DRYp.js +0 -18
- package/docs/.vitepress/dist/assets/chunks/theme.VODMs8XS.js +0 -2
- package/docs/.vitepress/dist/assets/style.B-ztagZG.css +0 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Giving a list of variables and values,
|
|
3
|
-
* from start to end, try all the values until a non-null is found
|
|
4
|
-
*/
|
|
5
|
-
@function no-null-var($list: ()){
|
|
6
|
-
@each $value in $list {
|
|
7
|
-
// stylelint-disable-next-line scss/at-if-no-null
|
|
8
|
-
@if $value != null and $value != undefined {
|
|
9
|
-
@return $value;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
@return null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* If the color is the checked one, return inherit
|
|
17
|
-
*/
|
|
18
|
-
@function no-target-var($check: transparent, $color: transparent){
|
|
19
|
-
@if $color == $check {
|
|
20
|
-
@return inherit;
|
|
21
|
-
}
|
|
22
|
-
@return $color;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* This function is to be used to return nested key values within a nested map
|
|
28
|
-
* @parameter {Variable} $map [null] - pass in map to be evaluated
|
|
29
|
-
* @parameter {Variable} $keys [null] - pass in keys to be evaluated
|
|
30
|
-
*/
|
|
31
|
-
// $map: (
|
|
32
|
-
// 'size': (
|
|
33
|
-
// 'sml': 10px
|
|
34
|
-
// )
|
|
35
|
-
// );
|
|
36
|
-
// $var: map-deep-get($map, 'size', 'sml'); // => 10px
|
|
37
|
-
@function map-deep-get($map, $keys...) {
|
|
38
|
-
@each $key in $keys {
|
|
39
|
-
$map: map-get($map, $key);
|
|
40
|
-
}
|
|
41
|
-
@return $map;
|
|
42
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Giving a list of variables and values,
|
|
3
|
+
* from start to end, try all the values until a non-null is found
|
|
4
|
+
*/
|
|
5
|
+
@function no-null-var($list: ()){
|
|
6
|
+
@each $value in $list {
|
|
7
|
+
// stylelint-disable-next-line scss/at-if-no-null
|
|
8
|
+
@if $value != null and $value != undefined {
|
|
9
|
+
@return $value;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
@return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* If the color is the checked one, return inherit
|
|
17
|
+
*/
|
|
18
|
+
@function no-target-var($check: transparent, $color: transparent){
|
|
19
|
+
@if $color == $check {
|
|
20
|
+
@return inherit;
|
|
21
|
+
}
|
|
22
|
+
@return $color;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* This function is to be used to return nested key values within a nested map
|
|
28
|
+
* @parameter {Variable} $map [null] - pass in map to be evaluated
|
|
29
|
+
* @parameter {Variable} $keys [null] - pass in keys to be evaluated
|
|
30
|
+
*/
|
|
31
|
+
// $map: (
|
|
32
|
+
// 'size': (
|
|
33
|
+
// 'sml': 10px
|
|
34
|
+
// )
|
|
35
|
+
// );
|
|
36
|
+
// $var: map-deep-get($map, 'size', 'sml'); // => 10px
|
|
37
|
+
@function map-deep-get($map, $keys...) {
|
|
38
|
+
@each $key in $keys {
|
|
39
|
+
$map: map-get($map, $key);
|
|
40
|
+
}
|
|
41
|
+
@return $map;
|
|
42
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Split string into lists
|
|
3
|
-
*/
|
|
4
|
-
@function string-split($string, $separator: "-") {
|
|
5
|
-
// empty array/list
|
|
6
|
-
$split-arr: ();
|
|
7
|
-
// first index of separator in string
|
|
8
|
-
$index : str-index($string, $separator);
|
|
9
|
-
// loop through string
|
|
10
|
-
@while $index != null {
|
|
11
|
-
// get the substring from the first character to the separator
|
|
12
|
-
$item: str-slice($string, 1, $index - 1);
|
|
13
|
-
// push item to array
|
|
14
|
-
$split-arr: append($split-arr, $item);
|
|
15
|
-
// remove item and separator from string
|
|
16
|
-
$string: str-slice($string, $index + 1);
|
|
17
|
-
// find new index of separator
|
|
18
|
-
$index : str-index($string, $separator);
|
|
19
|
-
}
|
|
20
|
-
// add the remaining string to list (the last item)
|
|
21
|
-
$split-arr: append($split-arr, $string);
|
|
22
|
-
|
|
23
|
-
@return $split-arr;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
Check if $string ends with $find
|
|
28
|
-
*/
|
|
29
|
-
@function string-ends-with($string, $find) {
|
|
30
|
-
@return (str-length($string) >= str-length($find)) and (str-slice($string, (str-length($string) - str-length($find) + 1)) == $find);
|
|
1
|
+
/**
|
|
2
|
+
Split string into lists
|
|
3
|
+
*/
|
|
4
|
+
@function string-split($string, $separator: "-") {
|
|
5
|
+
// empty array/list
|
|
6
|
+
$split-arr: ();
|
|
7
|
+
// first index of separator in string
|
|
8
|
+
$index : str-index($string, $separator);
|
|
9
|
+
// loop through string
|
|
10
|
+
@while $index != null {
|
|
11
|
+
// get the substring from the first character to the separator
|
|
12
|
+
$item: str-slice($string, 1, $index - 1);
|
|
13
|
+
// push item to array
|
|
14
|
+
$split-arr: append($split-arr, $item);
|
|
15
|
+
// remove item and separator from string
|
|
16
|
+
$string: str-slice($string, $index + 1);
|
|
17
|
+
// find new index of separator
|
|
18
|
+
$index : str-index($string, $separator);
|
|
19
|
+
}
|
|
20
|
+
// add the remaining string to list (the last item)
|
|
21
|
+
$split-arr: append($split-arr, $string);
|
|
22
|
+
|
|
23
|
+
@return $split-arr;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
Check if $string ends with $find
|
|
28
|
+
*/
|
|
29
|
+
@function string-ends-with($string, $find) {
|
|
30
|
+
@return (str-length($string) >= str-length($find)) and (str-slice($string, (str-length($string) - str-length($find) + 1)) == $find);
|
|
31
31
|
}
|
package/src/index.scss
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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-instructions";
|
|
12
|
-
@forward "./mixins/create-helper-margin";
|
|
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-instructions";
|
|
12
|
+
@forward "./mixins/create-helper-margin";
|
|
13
13
|
@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
|
-
}
|
|
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
37
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
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 TODO
|
|
27
|
-
// SAFARI TODO
|
|
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 TODO
|
|
27
|
+
// SAFARI TODO
|
|
28
28
|
}
|
|
@@ -1,32 +1,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($size: "4px", $color: "#fff", $bg: "auto", $radius: "10px") {
|
|
8
|
-
$fallback-color: #fff;
|
|
9
|
-
$fallback-bg: transparent;
|
|
10
|
-
|
|
11
|
-
@if $bg == "auto" {
|
|
12
|
-
$bg: $fallback-bg;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&::-webkit-scrollbar {
|
|
16
|
-
width: $size;
|
|
17
|
-
height: $size;
|
|
18
|
-
background-color: $fallback-bg;
|
|
19
|
-
background-color: $bg;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&::-webkit-scrollbar-thumb {
|
|
23
|
-
border-radius: $radius;
|
|
24
|
-
background-color: $fallback-color;
|
|
25
|
-
background-color: $color;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&::-webkit-scrollbar-corner {
|
|
29
|
-
background-color: $fallback-bg;
|
|
30
|
-
background-color: $bg;
|
|
31
|
-
}
|
|
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($size: "4px", $color: "#fff", $bg: "auto", $radius: "10px") {
|
|
8
|
+
$fallback-color: #fff;
|
|
9
|
+
$fallback-bg: transparent;
|
|
10
|
+
|
|
11
|
+
@if $bg == "auto" {
|
|
12
|
+
$bg: $fallback-bg;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&::-webkit-scrollbar {
|
|
16
|
+
width: $size;
|
|
17
|
+
height: $size;
|
|
18
|
+
background-color: $fallback-bg;
|
|
19
|
+
background-color: $bg;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&::-webkit-scrollbar-thumb {
|
|
23
|
+
border-radius: $radius;
|
|
24
|
+
background-color: $fallback-color;
|
|
25
|
+
background-color: $color;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&::-webkit-scrollbar-corner {
|
|
29
|
+
background-color: $fallback-bg;
|
|
30
|
+
background-color: $bg;
|
|
31
|
+
}
|
|
32
32
|
}
|
|
@@ -1,119 +1,119 @@
|
|
|
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
|
-
* $color-list - list of colors (like $colors-collection: ("branch": ( "leaf: $color" )))
|
|
8
|
-
* $branch-list: - when filled: becomes a whitelist (aka: include only listed brands)
|
|
9
|
-
* $feature-list: - when filled: becomes a whitelist. May become cumbersome and many are not needed. Use with care.
|
|
10
|
-
* - root
|
|
11
|
-
* - on-root (color's "best contrast" partner color)
|
|
12
|
-
* - color
|
|
13
|
-
* - background
|
|
14
|
-
* - border
|
|
15
|
-
* - pseudo (bg only, color very rarely used)
|
|
16
|
-
* - hover
|
|
17
|
-
* $prefix: prefix that applies to classes
|
|
18
|
-
*/
|
|
19
|
-
@mixin create-colors($color-list: (), $branch-list: (), $feature-list: (), $prefix: "") {
|
|
20
|
-
// for every branch
|
|
21
|
-
@each $branch-name, $branch in $color-list {
|
|
22
|
-
// check that there is no $branch-list or, if present, it's correctly whitelisted
|
|
23
|
-
@if list.length($branch-list) < 1 or list.index($branch-list, $branch-name) {
|
|
24
|
-
|
|
25
|
-
// for every leaf
|
|
26
|
-
@each $sname, $scolor in $branch {
|
|
27
|
-
|
|
28
|
-
@if not list.index($branch-name, "advanced"){
|
|
29
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "color") {
|
|
30
|
-
.#{$prefix}#{$branch-name}-#{$sname}-text {
|
|
31
|
-
color: $scolor !important;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "border") {
|
|
35
|
-
.#{$prefix}#{$branch-name}-#{$sname}-border {
|
|
36
|
-
border-color: $scolor !important;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "background") {
|
|
42
|
-
.#{$prefix}#{$branch-name}-#{$sname}-bg {
|
|
43
|
-
background: $scolor !important;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "pseudo") {
|
|
48
|
-
.#{$prefix}#{$branch-name}-#{$sname}-pseudo-bg {
|
|
49
|
-
&::after,
|
|
50
|
-
&::before {
|
|
51
|
-
background: $scolor !important;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "hover"){
|
|
57
|
-
|
|
58
|
-
@if not list.index($branch-name, "advanced"){
|
|
59
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "color"){
|
|
60
|
-
.#{$prefix}#{$branch-name}-#{$sname}-hover-text {
|
|
61
|
-
&:hover {
|
|
62
|
-
color: $scolor !important;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "border"){
|
|
67
|
-
.#{$prefix}#{$branch-name}-#{$sname}-hover-border {
|
|
68
|
-
&:hover {
|
|
69
|
-
border-color: $scolor !important;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "background") {
|
|
76
|
-
.#{$prefix}#{$branch-name}-#{$sname}-hover-bg {
|
|
77
|
-
&:hover {
|
|
78
|
-
background: $scolor !important;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "pseudo") {
|
|
84
|
-
.#{$prefix}#{$branch-name}-#{$sname}-hover-pseudo-bg {
|
|
85
|
-
&:hover{
|
|
86
|
-
&::after,
|
|
87
|
-
&::before {
|
|
88
|
-
background: $scolor !important;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* CSS VARS on root (they will be translated in "RGB" instead of "HEX"
|
|
100
|
-
*/
|
|
101
|
-
:root{
|
|
102
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "root"){
|
|
103
|
-
@each $branch-name, $branch in $color-list {
|
|
104
|
-
@each $sname, $scolor in $branch {
|
|
105
|
-
--#{$prefix}#{$branch-name}-#{$sname}: #{color-functions.extract-colors($scolor)};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
@if list.length($feature-list) < 1 or list.index($feature-list, "on-root"){
|
|
110
|
-
@each $branch-name, $branch in $color-list {
|
|
111
|
-
@each $sname, $scolor in $branch {
|
|
112
|
-
// @if type-of($scolor) == color {
|
|
113
|
-
--#{$prefix}on-#{$branch-name}-#{$sname}: #{color-functions.extract-colors(color-functions.color-contrast($scolor))};
|
|
114
|
-
// _}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
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
|
+
* $color-list - list of colors (like $colors-collection: ("branch": ( "leaf: $color" )))
|
|
8
|
+
* $branch-list: - when filled: becomes a whitelist (aka: include only listed brands)
|
|
9
|
+
* $feature-list: - when filled: becomes a whitelist. May become cumbersome and many are not needed. Use with care.
|
|
10
|
+
* - root
|
|
11
|
+
* - on-root (color's "best contrast" partner color)
|
|
12
|
+
* - color
|
|
13
|
+
* - background
|
|
14
|
+
* - border
|
|
15
|
+
* - pseudo (bg only, color very rarely used)
|
|
16
|
+
* - hover
|
|
17
|
+
* $prefix: prefix that applies to classes
|
|
18
|
+
*/
|
|
19
|
+
@mixin create-colors($color-list: (), $branch-list: (), $feature-list: (), $prefix: "") {
|
|
20
|
+
// for every branch
|
|
21
|
+
@each $branch-name, $branch in $color-list {
|
|
22
|
+
// check that there is no $branch-list or, if present, it's correctly whitelisted
|
|
23
|
+
@if list.length($branch-list) < 1 or list.index($branch-list, $branch-name) {
|
|
24
|
+
|
|
25
|
+
// for every leaf
|
|
26
|
+
@each $sname, $scolor in $branch {
|
|
27
|
+
|
|
28
|
+
@if not list.index($branch-name, "advanced"){
|
|
29
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "color") {
|
|
30
|
+
.#{$prefix}#{$branch-name}-#{$sname}-text {
|
|
31
|
+
color: $scolor !important;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "border") {
|
|
35
|
+
.#{$prefix}#{$branch-name}-#{$sname}-border {
|
|
36
|
+
border-color: $scolor !important;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "background") {
|
|
42
|
+
.#{$prefix}#{$branch-name}-#{$sname}-bg {
|
|
43
|
+
background: $scolor !important;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "pseudo") {
|
|
48
|
+
.#{$prefix}#{$branch-name}-#{$sname}-pseudo-bg {
|
|
49
|
+
&::after,
|
|
50
|
+
&::before {
|
|
51
|
+
background: $scolor !important;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "hover"){
|
|
57
|
+
|
|
58
|
+
@if not list.index($branch-name, "advanced"){
|
|
59
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "color"){
|
|
60
|
+
.#{$prefix}#{$branch-name}-#{$sname}-hover-text {
|
|
61
|
+
&:hover {
|
|
62
|
+
color: $scolor !important;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "border"){
|
|
67
|
+
.#{$prefix}#{$branch-name}-#{$sname}-hover-border {
|
|
68
|
+
&:hover {
|
|
69
|
+
border-color: $scolor !important;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "background") {
|
|
76
|
+
.#{$prefix}#{$branch-name}-#{$sname}-hover-bg {
|
|
77
|
+
&:hover {
|
|
78
|
+
background: $scolor !important;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "pseudo") {
|
|
84
|
+
.#{$prefix}#{$branch-name}-#{$sname}-hover-pseudo-bg {
|
|
85
|
+
&:hover{
|
|
86
|
+
&::after,
|
|
87
|
+
&::before {
|
|
88
|
+
background: $scolor !important;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* CSS VARS on root (they will be translated in "RGB" instead of "HEX"
|
|
100
|
+
*/
|
|
101
|
+
:root{
|
|
102
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "root"){
|
|
103
|
+
@each $branch-name, $branch in $color-list {
|
|
104
|
+
@each $sname, $scolor in $branch {
|
|
105
|
+
--#{$prefix}#{$branch-name}-#{$sname}: #{color-functions.extract-colors($scolor)};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
@if list.length($feature-list) < 1 or list.index($feature-list, "on-root"){
|
|
110
|
+
@each $branch-name, $branch in $color-list {
|
|
111
|
+
@each $sname, $scolor in $branch {
|
|
112
|
+
// @if type-of($scolor) == color {
|
|
113
|
+
--#{$prefix}on-#{$branch-name}-#{$sname}: #{color-functions.extract-colors(color-functions.color-contrast($scolor))};
|
|
114
|
+
// _}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
119
|
}
|