@guebbit/css-toolkit 1.2.0 → 1.3.1

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.
Files changed (103) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +5 -5
  3. package/docs/.postcssrc.cjs +11 -11
  4. package/docs/.vitepress/config.ts +88 -88
  5. package/docs/.vitepress/dist/404.html +4 -4
  6. package/docs/.vitepress/dist/assets/app.CE7x4Dlp.js +1 -0
  7. package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.CS_28jj8.js +1 -0
  8. package/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.TmXlq6CT.js +8 -0
  9. package/docs/.vitepress/dist/assets/chunks/framework.BZemHgQ6.js +18 -0
  10. package/docs/.vitepress/dist/assets/chunks/theme.BWSHCtHe.js +2 -0
  11. package/docs/.vitepress/dist/assets/{colors_bootstrap.md.B8QNot57.js → colors_bootstrap.md.CFg-dNGF.js} +1 -1
  12. package/docs/.vitepress/dist/assets/{colors_bootstrap.md.B8QNot57.lean.js → colors_bootstrap.md.CFg-dNGF.lean.js} +1 -1
  13. package/docs/.vitepress/dist/assets/colors_brands.md.CUxoS0ml.js +1 -0
  14. package/docs/.vitepress/dist/assets/colors_brands.md.CUxoS0ml.lean.js +1 -0
  15. package/docs/.vitepress/dist/assets/{colors_customs.md.B9XC2fYm.js → colors_customs.md.CnHhl84q.js} +1 -1
  16. package/docs/.vitepress/dist/assets/{colors_customs.md.B9XC2fYm.lean.js → colors_customs.md.CnHhl84q.lean.js} +1 -1
  17. package/docs/.vitepress/dist/assets/{functions_colors.md.8WIzA1Az.js → functions_colors.md.BsOBqU9L.js} +1 -1
  18. package/docs/.vitepress/dist/assets/functions_colors.md.BsOBqU9L.lean.js +1 -0
  19. package/docs/.vitepress/dist/assets/functions_helpers.md.B3A_IOEL.js +1 -0
  20. package/docs/.vitepress/dist/assets/functions_helpers.md.B3A_IOEL.lean.js +1 -0
  21. package/docs/.vitepress/dist/assets/{functions_strings.md.B-I-mSmy.js → functions_strings.md.BdV8Kx9J.js} +1 -1
  22. package/docs/.vitepress/dist/assets/{functions_strings.md.B-I-mSmy.lean.js → functions_strings.md.BdV8Kx9J.lean.js} +1 -1
  23. package/docs/.vitepress/dist/assets/{index.md.DO-yHYeM.js → index.md.Cn1TneoC.js} +1 -1
  24. package/docs/.vitepress/dist/assets/{index.md.DO-yHYeM.lean.js → index.md.Cn1TneoC.lean.js} +1 -1
  25. package/docs/.vitepress/dist/assets/{mixins_build-aspect-ratio.md.Cjv_a3MY.js → mixins_build-aspect-ratio.md.cD70Q1mW.js} +1 -1
  26. package/docs/.vitepress/dist/assets/{mixins_build-aspect-ratio.md.Cjv_a3MY.lean.js → mixins_build-aspect-ratio.md.cD70Q1mW.lean.js} +1 -1
  27. package/docs/.vitepress/dist/assets/{mixins_build-compatibility.md.BO6wODYa.js → mixins_build-compatibility.md.DvZg2OSO.js} +15 -4
  28. package/docs/.vitepress/dist/assets/mixins_build-compatibility.md.DvZg2OSO.lean.js +1 -0
  29. package/docs/.vitepress/dist/assets/{mixins_build-scrollbar.md.BX34elgD.js → mixins_build-scrollbar.md.Bze7PgzU.js} +1 -1
  30. package/docs/.vitepress/dist/assets/mixins_build-scrollbar.md.Bze7PgzU.lean.js +1 -0
  31. package/docs/.vitepress/dist/assets/{mixins_create-colors.md.82HeTZt6.js → mixins_create-colors.md.Bi4iqAHf.js} +1 -1
  32. package/docs/.vitepress/dist/assets/{mixins_create-colors.md.82HeTZt6.lean.js → mixins_create-colors.md.Bi4iqAHf.lean.js} +1 -1
  33. package/docs/.vitepress/dist/assets/{mixins_create-helper-margin.md.D2-T7z0a.js → mixins_create-helper-margin.md.DqwBKQ0G.js} +1 -1
  34. package/docs/.vitepress/dist/assets/mixins_create-helper-margin.md.DqwBKQ0G.lean.js +1 -0
  35. package/docs/.vitepress/dist/assets/{mixins_create-helper-padding.md.Cp-laxuA.js → mixins_create-helper-padding.md.Br9TOGl1.js} +1 -1
  36. package/docs/.vitepress/dist/assets/mixins_create-helper-padding.md.Br9TOGl1.lean.js +1 -0
  37. package/docs/.vitepress/dist/assets/{mixins_create-instruction.md.dJ83FO6R.js → mixins_create-instruction.md.BeAIoeQx.js} +15 -7
  38. package/docs/.vitepress/dist/assets/mixins_create-instruction.md.BeAIoeQx.lean.js +1 -0
  39. package/docs/.vitepress/dist/assets/style.BsKZwvOR.css +1 -0
  40. package/docs/.vitepress/dist/colors/bootstrap.html +8 -8
  41. package/docs/.vitepress/dist/colors/brands.html +8 -8
  42. package/docs/.vitepress/dist/colors/customs.html +8 -8
  43. package/docs/.vitepress/dist/functions/colors.html +8 -8
  44. package/docs/.vitepress/dist/functions/helpers.html +8 -8
  45. package/docs/.vitepress/dist/functions/strings.html +8 -8
  46. package/docs/.vitepress/dist/hashmap.json +1 -1
  47. package/docs/.vitepress/dist/index.html +8 -8
  48. package/docs/.vitepress/dist/mixins/build-aspect-ratio.html +8 -8
  49. package/docs/.vitepress/dist/mixins/build-compatibility.html +21 -10
  50. package/docs/.vitepress/dist/mixins/build-scrollbar.html +8 -8
  51. package/docs/.vitepress/dist/mixins/create-colors.html +8 -8
  52. package/docs/.vitepress/dist/mixins/create-helper-margin.html +9 -9
  53. package/docs/.vitepress/dist/mixins/create-helper-padding.html +8 -8
  54. package/docs/.vitepress/dist/mixins/create-instruction.html +21 -13
  55. package/docs/.vitepress/dist/vp-icons.css +0 -2
  56. package/docs/.vitepress/theme/index.js +11 -11
  57. package/docs/functions/colors.md +65 -65
  58. package/docs/logo.svg +55 -55
  59. package/docs/logotype.svg +149 -149
  60. package/docs/mixins/build-compatibility.md +22 -22
  61. package/docs/mixins/build-scrollbar.md +18 -18
  62. package/docs/mixins/create-helper-margin.md +25 -25
  63. package/docs/mixins/create-helper-padding.md +24 -24
  64. package/docs/mixins/create-instruction.md +32 -32
  65. package/package.json +61 -61
  66. package/src/colors/_bootstrap.scss +179 -179
  67. package/src/colors/_brands.scss +20 -20
  68. package/src/colors/_customs.scss +52 -52
  69. package/src/colors/_index.scss +199 -199
  70. package/src/functions/_colors.scss +134 -121
  71. package/src/functions/_helpers.scss +44 -42
  72. package/src/functions/_strings.scss +30 -30
  73. package/src/index.scss +13 -12
  74. package/src/mixins/_build-aspect-ratio.scss +36 -36
  75. package/src/mixins/_build-compatibility.scss +38 -27
  76. package/src/mixins/_build-scrollbar.scss +31 -31
  77. package/src/mixins/_create-class.scss +19 -0
  78. package/src/mixins/_create-colors-vars.scss +35 -0
  79. package/src/mixins/_create-colors.scss +160 -119
  80. package/src/mixins/_create-helper-margin.scss +38 -38
  81. package/src/mixins/_create-helper-padding.scss +40 -40
  82. package/test/compile.test.js +131 -105
  83. package/test/lint.test.js +48 -48
  84. package/test/test.css +5935 -986
  85. package/test/test.scss +196 -158
  86. package/vite.config.ts +25 -25
  87. package/docs/.vitepress/dist/assets/app.Cez_7bx7.js +0 -1
  88. package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.CkfJPSmi.js +0 -1
  89. package/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.lfLgIsvm.js +0 -8
  90. package/docs/.vitepress/dist/assets/chunks/framework.BQmytedh.js +0 -18
  91. package/docs/.vitepress/dist/assets/chunks/theme.ZIndENJH.js +0 -2
  92. package/docs/.vitepress/dist/assets/colors_brands.md.DA7CAmLz.js +0 -1
  93. package/docs/.vitepress/dist/assets/colors_brands.md.DA7CAmLz.lean.js +0 -1
  94. package/docs/.vitepress/dist/assets/functions_colors.md.8WIzA1Az.lean.js +0 -10
  95. package/docs/.vitepress/dist/assets/functions_helpers.md.DlnJURDc.js +0 -1
  96. package/docs/.vitepress/dist/assets/functions_helpers.md.DlnJURDc.lean.js +0 -1
  97. package/docs/.vitepress/dist/assets/mixins_build-compatibility.md.BO6wODYa.lean.js +0 -30
  98. package/docs/.vitepress/dist/assets/mixins_build-scrollbar.md.BX34elgD.lean.js +0 -32
  99. package/docs/.vitepress/dist/assets/mixins_create-helper-margin.md.D2-T7z0a.lean.js +0 -46
  100. package/docs/.vitepress/dist/assets/mixins_create-helper-padding.md.Cp-laxuA.lean.js +0 -45
  101. package/docs/.vitepress/dist/assets/mixins_create-instruction.md.dJ83FO6R.lean.js +0 -20
  102. package/docs/.vitepress/dist/assets/style.BKBz-tcN.css +0 -1
  103. package/src/mixins/_create-instructions.scss +0 -11
@@ -1,122 +1,135 @@
1
- @use "sass:color";
2
- @use "sass:math";
3
- @use "sass:string";
4
- @use "sass:meta";
5
-
6
- /**
7
- * Return opaque color
8
- * color-opaque(#fff, rgba(0, 0, 0, .5)) => #808080
9
- * function credited to https://getbootstrap.com/
10
- */
11
- @function color-opaque($background, $foreground) {
12
- @return mix(rgba($foreground, 1), $background, opacity($foreground) * 100%);
13
- }
14
-
15
-
16
- /**
17
- * Tint a color: mix a color with white
18
- * function credited to https://getbootstrap.com/
19
- */
20
- @function color-tint($color, $weight) {
21
- @return mix(#fff, $color, $weight);
22
- }
23
-
24
-
25
- /**
26
- * Shade a color: mix a color with black
27
- * function credited to https://getbootstrap.com/
28
- */
29
- @function color-shade($color, $weight) {
30
- @return mix(#000, $color, $weight);
31
- }
32
-
33
-
34
- /**
35
- * Shade the color if the weight is positive, else tint it
36
- * function credited to https://getbootstrap.com/
37
- */
38
- @function color-shift($color, $weight) {
39
- @return if($weight > 0,
40
- color-shade($color, $weight),
41
- color-tint($color, -$weight)
42
- );
43
- }
44
-
45
-
46
- /**
47
- * Compares contrast of a given color to the light/dark arguments and returns whichever is most "contrasty"
48
- */
49
- @function color-contrast($color: #fff, $dark: #000, $light: #fff) {
50
- @if meta.type-of($color) != color or $color == transparent {
51
- @return inherit;
52
- }
53
- $color-brightness: color-brightness($color);
54
- $light-text-brightness: color-brightness($light);
55
- $dark-text-brightness: color-brightness($dark);
56
-
57
- @return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark);
58
- }
59
-
60
-
61
-
62
- // Return WCAG2.1 relative luminance
63
- // See https://www.w3.org/TR/WCAG/#dfn-relative-luminance
64
- // See https://en.wikipedia.org/wiki/Relative_luminance
65
- // Gives %, less than 50 darker is better, less than 50, lighter.
66
- @function color-brightness($color) {
67
- // fallback
68
- @if $color == transparent or meta.type-of($color) != color {
69
- @return 100;
70
- }
71
- @return math.div(((red($color) * .299) + (green($color) * .587) + (blue($color) * .114)), 255 * 100%);
72
- }
73
-
74
- /**
75
- * NEW numeric annotation
76
- * Hex to RGB (only numbers, transparentize would add rgba(*))
77
- * $color
78
- * $alpha:
79
- * - 0: never 4° digit
80
- * - 1: always 4° digit
81
- * - 2: 4° digit only when needed
82
- * $classic: false = new number annotation
83
- */
84
- @function extract-colors($color: #fff, $mode: 2, $classic: false){
85
- // colors only
86
- @if $color == transparent or meta.type-of($color) != color {
87
- @return $color;
88
- }
89
- // new annotation
90
- $delimiter: " ";
91
- $delimiter-alpha: " / ";
92
- // old annotation
93
- @if $classic{
94
- $delimiter: ", ";
95
- $delimiter-alpha: ", ";
96
- }
97
- $alpha: alpha($color);
98
- @if $mode == 1 or ($mode == 2 and $alpha == 1) {
99
- @return red($color) + $delimiter + green($color) + $delimiter + blue($color);
100
- }
101
- // Regular RGBA compliant result ("number" notation)
102
- @return red($color) + $delimiter + green($color) + $delimiter + blue($color) + $delimiter-alpha + alpha($color); // * 100%
103
- }
104
-
105
- /**
106
- * Create default collection
107
- */
108
- @function create-collection($color){
109
- $list: (
110
- "100": color-tint($color, 80%),
111
- "200": color-tint($color, 60%),
112
- "300": color-tint($color, 40%),
113
- "400": color-tint($color, 20%),
114
- "500": $color,
115
- "600": color-shade($color, 20%),
116
- "700": color-shade($color, 40%),
117
- "800": color-shade($color, 60%),
118
- "900": color-shade($color, 80%)
119
- );
120
-
121
- @return $list
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(rgba($foreground, 1), $background, color.opacity($foreground) * 100%);
12
+ }
13
+
14
+ /**
15
+ * Tint a color
16
+ */
17
+ @function color-tint($color, $weight) {
18
+ // Creates a physical mixture with white color
19
+ @return color.mix(#fff, $color, $weight);
20
+ // Adjusts properties (like lightness) relative to the color's current values.
21
+ // @return color.scale($color, $lightness: $weight);
22
+ }
23
+
24
+
25
+ /**
26
+ * Shade a color
27
+ */
28
+ @function color-shade($color, $weight) {
29
+ @return color.mix(#000, $color, $weight);
30
+ // @return color.scale($color, $lightness: -$weight);
31
+ }
32
+
33
+
34
+ /**
35
+ * Shade the color if the weight is positive, else tint it
36
+ * function credited to https://getbootstrap.com/
37
+ */
38
+ @function color-shift($color, $weight) {
39
+ @return if($weight > 0,
40
+ color-shade($color, $weight),
41
+ color-tint($color, -$weight)
42
+ );
43
+ }
44
+
45
+
46
+ /**
47
+ * Return WCAG2.1 relative luminance
48
+ * See https://www.w3.org/TR/WCAG/#dfn-relative-luminance
49
+ * See https://en.wikipedia.org/wiki/Relative_luminance
50
+ * Gives %, less than 50 darker is better, less than 50, lighter.
51
+ * Function like color.channel($color, "lightness", $space: hsl) gives a different %
52
+ */
53
+ @function color-luminance($color) {
54
+ // fallback
55
+ @if $color == transparent or meta.type-of($color) != color {
56
+ @return 100;
57
+ }
58
+ @return math.div((
59
+ (color.channel($color, "red", $space: rgb) * .299) +
60
+ (color.channel($color, "green", $space: rgb) * .587) +
61
+ (color.channel($color, "blue", $space: rgb) * .114)
62
+ ), 255) * 100%;
63
+ }
64
+
65
+
66
+ /**
67
+ * Compares contrast of a given color to the light/dark arguments and returns whichever is most "contrasty"
68
+ */
69
+ @function color-contrast($color: #fff, $dark: #000, $light: #fff) {
70
+ @if meta.type-of($color) != color or $color == transparent {
71
+ @return inherit;
72
+ }
73
+ $color-brightness: color-luminance($color);
74
+ $light-text-brightness: color-luminance($light);
75
+ $dark-text-brightness: color-luminance($dark);
76
+
77
+ @return if(math.abs($color-brightness - $light-text-brightness) > math.abs($color-brightness - $dark-text-brightness), $light, $dark);
78
+ }
79
+
80
+
81
+ /**
82
+ * NEW numeric annotation
83
+ * Hex to RGB (only numbers, transparentize would add rgba(*))
84
+ * $color
85
+ * $alpha:
86
+ * - 0: never digit
87
+ * - 1: always 4° digit
88
+ * - 2: 4° digit only when needed
89
+ * $classic: false = new number annotation
90
+ */
91
+ @function extract-colors($color: #fff, $mode: 2, $classic: false){
92
+ // colors only
93
+ @if $color == transparent or meta.type-of($color) != color {
94
+ @return $color;
95
+ }
96
+ // new annotation
97
+ $delimiter: " ";
98
+ $delimiter-alpha: " / ";
99
+ // old annotation
100
+ @if $classic{
101
+ $delimiter: ", ";
102
+ $delimiter-alpha: ", ";
103
+ }
104
+ $alpha: color.alpha($color);
105
+ @if $mode == 1 or ($mode == 2 and $alpha == 1) {
106
+ @return color.channel($color, "red", $space: rgb) +
107
+ $delimiter + color.channel($color, "green", $space: rgb) +
108
+ $delimiter + color.channel($color, "blue", $space: rgb);
109
+ }
110
+ // Regular RGBA compliant result ("number" notation)
111
+ @return color.channel($color, "red", $space: rgb) +
112
+ $delimiter + color.channel($color, "green", $space: rgb) +
113
+ $delimiter + color.channel($color, "blue", $space: rgb) +
114
+ $delimiter-alpha + color.channel($color, "alpha"); // * 100%
115
+ }
116
+
117
+ /**
118
+ * Create default collection
119
+ * @param $color
120
+ */
121
+ @function create-collection($color: #fff) {
122
+ $list: (
123
+ "100": color-tint($color, 80%),
124
+ "200": color-tint($color, 60%),
125
+ "300": color-tint($color, 40%),
126
+ "400": color-tint($color, 20%),
127
+ "500": $color,
128
+ "600": color-shade($color, 20%),
129
+ "700": color-shade($color, 40%),
130
+ "800": color-shade($color, 60%),
131
+ "900": color-shade($color, 80%)
132
+ );
133
+
134
+ @return $list
122
135
  }
@@ -1,42 +1,44 @@
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
+ @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
+ * This function is to be used to return nested key values within a nested map
30
+ * @parameter {Variable} $map [null] - pass in map to be evaluated
31
+ * @parameter {Variable} $keys [null] - pass in keys to be evaluated
32
+ */
33
+ // $map: (
34
+ // 'size': (
35
+ // 'sml': 10px
36
+ // )
37
+ // );
38
+ // $var: map-deep-get($map, 'size', 'sml'); // => 10px
39
+ @function map-deep-get($map, $keys...) {
40
+ @each $key in $keys {
41
+ $map: map.get($map, $key);
42
+ }
43
+ @return $map;
44
+ }
@@ -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,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-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-colors-vars";
12
+ @forward "./mixins/create-class";
13
+ @forward "./mixins/create-helper-margin";
13
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
- }
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,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 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
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 (not (-webkit-touch-callout: none)) {
36
+ @content;
37
+ }
38
+ }
28
39
  }
@@ -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
  }
@@ -0,0 +1,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($instruction, $measure-list: (), $important: false, $prefix: "", $delimiter: "-") {
8
+ @each $values in $measure-list {
9
+ $name: $values;
10
+ $val: $values;
11
+ @if list.length($values) > 1 {
12
+ $name: list.nth($values, 1);
13
+ $val: list.nth($values, 2);
14
+ }
15
+ .#{$prefix}#{$instruction}#{$delimiter}#{$name} {
16
+ #{$instruction}: #{$val} #{if($important == true, "!important", "")}
17
+ }
18
+ }
19
+ }