@guebbit/css-toolkit 1.0.1 → 1.1.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.
Files changed (43) hide show
  1. package/CHANGELOG +0 -0
  2. package/README.md +2 -1
  3. package/package.json +8 -5
  4. package/.stylelintignore +0 -2
  5. package/.stylelintrc.json +0 -23
  6. package/docs/.postcssrc.cjs +0 -12
  7. package/docs/.vitepress/config.ts +0 -89
  8. package/docs/.vitepress/theme/index.js +0 -12
  9. package/docs/colors/bootstrap.md +0 -1
  10. package/docs/colors/brands.md +0 -1
  11. package/docs/colors/customs.md +0 -1
  12. package/docs/functions/colors.md +0 -66
  13. package/docs/functions/helpers.md +0 -1
  14. package/docs/functions/strings.md +0 -1
  15. package/docs/index.md +0 -1
  16. package/docs/logo.svg +0 -55
  17. package/docs/logotype.svg +0 -149
  18. package/docs/mixins/build-aspect-ratio.md +0 -1
  19. package/docs/mixins/build-compatibility.md +0 -23
  20. package/docs/mixins/build-scrollbar.md +0 -19
  21. package/docs/mixins/create-colors.md +0 -1
  22. package/docs/mixins/create-helper-margin.md +0 -25
  23. package/docs/mixins/create-helper-padding.md +0 -24
  24. package/docs/mixins/create-instruction.md +0 -33
  25. package/src/colors/_bootstrap.scss +0 -180
  26. package/src/colors/_brands.scss +0 -20
  27. package/src/colors/_customs.scss +0 -53
  28. package/src/colors/_index.scss +0 -205
  29. package/src/functions/_colors.scss +0 -111
  30. package/src/functions/_helpers.scss +0 -23
  31. package/src/functions/_strings.scss +0 -31
  32. package/src/index.scss +0 -14
  33. package/src/mixins/_build-aspect-ratio.scss +0 -34
  34. package/src/mixins/_build-compatibility.scss +0 -28
  35. package/src/mixins/_build-scrollbar.scss +0 -32
  36. package/src/mixins/_create-colors.scss +0 -119
  37. package/src/mixins/_create-helper-margin.scss +0 -39
  38. package/src/mixins/_create-helper-padding.scss +0 -40
  39. package/src/mixins/_create-instruction.scss +0 -11
  40. package/test/compile.test.js +0 -19
  41. package/test/lint.test.js +0 -33
  42. package/test.scss +0 -65
  43. package/vite.config.ts +0 -26
@@ -1,180 +0,0 @@
1
- @use "../functions/colors" as color-functions;
2
-
3
- // Material colors by Bootstrap
4
- // https://github.com/twbs/bootstrap
5
- // https://github.com/twbs/bootstrap/blob/v5.3.2/scss/_variables.scss
6
-
7
- // Variables should follow the `$component-state-property-size` formula for
8
- // consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs.
9
-
10
-
11
- // scss-docs-start gray-color-variables
12
- $white: #fff !default;
13
- $gray-100: #f8f9fa !default;
14
- $gray-200: #e9ecef !default;
15
- $gray-300: #dee2e6 !default;
16
- $gray-400: #ced4da !default;
17
- $gray-500: #adb5bd !default;
18
- $gray-600: #6c757d !default;
19
- $gray-700: #495057 !default;
20
- $gray-800: #343a40 !default;
21
- $gray-900: #212529 !default;
22
- $black: #000 !default;
23
- // scss-docs-end gray-color-variables
24
-
25
- // fusv-disable
26
- // scss-docs-start gray-colors-map
27
- $grays: (
28
- "100": $gray-100,
29
- "200": $gray-200,
30
- "300": $gray-300,
31
- "400": $gray-400,
32
- "500": $gray-500,
33
- "600": $gray-600,
34
- "700": $gray-700,
35
- "800": $gray-800,
36
- "900": $gray-900
37
- ) !default;
38
- // scss-docs-end gray-colors-map
39
- // fusv-enable
40
-
41
- // scss-docs-start color-variables
42
- $blue: #0d6efd !default;
43
- $indigo: #6610f2 !default;
44
- $purple: #6f42c1 !default;
45
- $pink: #d63384 !default;
46
- $red: #dc3545 !default;
47
- $orange: #fd7e14 !default;
48
- $yellow: #ffc107 !default;
49
- $green: #198754 !default;
50
- $teal: #20c997 !default;
51
- $cyan: #0dcaf0 !default;
52
- // scss-docs-end color-variables
53
-
54
- // scss-docs-start colors-map
55
- $colors: (
56
- "blue": $blue,
57
- "indigo": $indigo,
58
- "purple": $purple,
59
- "pink": $pink,
60
- "red": $red,
61
- "orange": $orange,
62
- "yellow": $yellow,
63
- "green": $green,
64
- "teal": $teal,
65
- "cyan": $cyan,
66
- "black": $black,
67
- "white": $white,
68
- "gray": $gray-600,
69
- "gray-dark": $gray-800
70
- ) !default;
71
- // scss-docs-end colors-map
72
-
73
- // The contrast ratio to reach against white, to determine if color changes from "light" to "dark". Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
74
- // See https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
75
- $min-contrast-ratio: 4.5 !default;
76
-
77
- // Customize the light and dark text colors for use in our color contrast function.
78
- $color-contrast-dark: $black !default;
79
- $color-contrast-light: $white !default;
80
-
81
- // fusv-disable
82
- $blue-100: color-functions.color-tint($blue, 80%) !default;
83
- $blue-200: color-functions.color-tint($blue, 60%) !default;
84
- $blue-300: color-functions.color-tint($blue, 40%) !default;
85
- $blue-400: color-functions.color-tint($blue, 20%) !default;
86
- $blue-500: $blue !default;
87
- $blue-600: color-functions.color-shade($blue, 20%) !default;
88
- $blue-700: color-functions.color-shade($blue, 40%) !default;
89
- $blue-800: color-functions.color-shade($blue, 60%) !default;
90
- $blue-900: color-functions.color-shade($blue, 80%) !default;
91
-
92
- $indigo-100: color-functions.color-tint($indigo, 80%) !default;
93
- $indigo-200: color-functions.color-tint($indigo, 60%) !default;
94
- $indigo-300: color-functions.color-tint($indigo, 40%) !default;
95
- $indigo-400: color-functions.color-tint($indigo, 20%) !default;
96
- $indigo-500: $indigo !default;
97
- $indigo-600: color-functions.color-shade($indigo, 20%) !default;
98
- $indigo-700: color-functions.color-shade($indigo, 40%) !default;
99
- $indigo-800: color-functions.color-shade($indigo, 60%) !default;
100
- $indigo-900: color-functions.color-shade($indigo, 80%) !default;
101
-
102
- $purple-100: color-functions.color-tint($purple, 80%) !default;
103
- $purple-200: color-functions.color-tint($purple, 60%) !default;
104
- $purple-300: color-functions.color-tint($purple, 40%) !default;
105
- $purple-400: color-functions.color-tint($purple, 20%) !default;
106
- $purple-500: $purple !default;
107
- $purple-600: color-functions.color-shade($purple, 20%) !default;
108
- $purple-700: color-functions.color-shade($purple, 40%) !default;
109
- $purple-800: color-functions.color-shade($purple, 60%) !default;
110
- $purple-900: color-functions.color-shade($purple, 80%) !default;
111
-
112
- $pink-100: color-functions.color-tint($pink, 80%) !default;
113
- $pink-200: color-functions.color-tint($pink, 60%) !default;
114
- $pink-300: color-functions.color-tint($pink, 40%) !default;
115
- $pink-400: color-functions.color-tint($pink, 20%) !default;
116
- $pink-500: $pink !default;
117
- $pink-600: color-functions.color-shade($pink, 20%) !default;
118
- $pink-700: color-functions.color-shade($pink, 40%) !default;
119
- $pink-800: color-functions.color-shade($pink, 60%) !default;
120
- $pink-900: color-functions.color-shade($pink, 80%) !default;
121
-
122
- $red-100: color-functions.color-tint($red, 80%) !default;
123
- $red-200: color-functions.color-tint($red, 60%) !default;
124
- $red-300: color-functions.color-tint($red, 40%) !default;
125
- $red-400: color-functions.color-tint($red, 20%) !default;
126
- $red-500: $red !default;
127
- $red-600: color-functions.color-shade($red, 20%) !default;
128
- $red-700: color-functions.color-shade($red, 40%) !default;
129
- $red-800: color-functions.color-shade($red, 60%) !default;
130
- $red-900: color-functions.color-shade($red, 80%) !default;
131
-
132
- $orange-100: color-functions.color-tint($orange, 80%) !default;
133
- $orange-200: color-functions.color-tint($orange, 60%) !default;
134
- $orange-300: color-functions.color-tint($orange, 40%) !default;
135
- $orange-400: color-functions.color-tint($orange, 20%) !default;
136
- $orange-500: $orange !default;
137
- $orange-600: color-functions.color-shade($orange, 20%) !default;
138
- $orange-700: color-functions.color-shade($orange, 40%) !default;
139
- $orange-800: color-functions.color-shade($orange, 60%) !default;
140
- $orange-900: color-functions.color-shade($orange, 80%) !default;
141
-
142
- $yellow-100: color-functions.color-tint($yellow, 80%) !default;
143
- $yellow-200: color-functions.color-tint($yellow, 60%) !default;
144
- $yellow-300: color-functions.color-tint($yellow, 40%) !default;
145
- $yellow-400: color-functions.color-tint($yellow, 20%) !default;
146
- $yellow-500: $yellow !default;
147
- $yellow-600: color-functions.color-shade($yellow, 20%) !default;
148
- $yellow-700: color-functions.color-shade($yellow, 40%) !default;
149
- $yellow-800: color-functions.color-shade($yellow, 60%) !default;
150
- $yellow-900: color-functions.color-shade($yellow, 80%) !default;
151
-
152
- $green-100: color-functions.color-tint($green, 80%) !default;
153
- $green-200: color-functions.color-tint($green, 60%) !default;
154
- $green-300: color-functions.color-tint($green, 40%) !default;
155
- $green-400: color-functions.color-tint($green, 20%) !default;
156
- $green-500: $green !default;
157
- $green-600: color-functions.color-shade($green, 20%) !default;
158
- $green-700: color-functions.color-shade($green, 40%) !default;
159
- $green-800: color-functions.color-shade($green, 60%) !default;
160
- $green-900: color-functions.color-shade($green, 80%) !default;
161
-
162
- $teal-100: color-functions.color-tint($teal, 80%) !default;
163
- $teal-200: color-functions.color-tint($teal, 60%) !default;
164
- $teal-300: color-functions.color-tint($teal, 40%) !default;
165
- $teal-400: color-functions.color-tint($teal, 20%) !default;
166
- $teal-500: $teal !default;
167
- $teal-600: color-functions.color-shade($teal, 20%) !default;
168
- $teal-700: color-functions.color-shade($teal, 40%) !default;
169
- $teal-800: color-functions.color-shade($teal, 60%) !default;
170
- $teal-900: color-functions.color-shade($teal, 80%) !default;
171
-
172
- $cyan-100: color-functions.color-tint($cyan, 80%) !default;
173
- $cyan-200: color-functions.color-tint($cyan, 60%) !default;
174
- $cyan-300: color-functions.color-tint($cyan, 40%) !default;
175
- $cyan-400: color-functions.color-tint($cyan, 20%) !default;
176
- $cyan-500: $cyan !default;
177
- $cyan-600: color-functions.color-shade($cyan, 20%) !default;
178
- $cyan-700: color-functions.color-shade($cyan, 40%) !default;
179
- $cyan-800: color-functions.color-shade($cyan, 60%) !default;
180
- $cyan-900: color-functions.color-shade($cyan, 80%) !default;
@@ -1,20 +0,0 @@
1
- $brand-facebook: #3b5998;
2
- $brand-youtube: #cc181e;
3
- $brand-twitter: #3cf;
4
- $brand-skype: #00aff0;
5
- $brand-linkedin: #1565c0;
6
- $brand-whatsapp: #4ac959;
7
- $brand-telegram: #08c;
8
- $brand-twitch: #6441a4;
9
- $brand-pinterest: #e60023;
10
- $brand-reddit: #ff4301;
11
- $brand-tumblr: #35465c;
12
- $brand-patreon: #f96854;
13
- $brand-kickstarter: #05ce78;
14
- $brand-instagram: #f09433;
15
- $brand-tiktok: #25f4ee;
16
- $brand-google: #dc4a38;
17
- $brand-paypal: #003087;
18
- $brand-paypal2: #f2b938;
19
- $advanced-brand-instagram: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
20
- $advanced-brand-tiktok: linear-gradient(90deg, #25f4ee 0%, #000 30%, #000 50%, #000 70%, #fe2c55 100%);
@@ -1,53 +0,0 @@
1
- @use "../functions/colors" as color-functions;
2
-
3
- $flatrica-green: #06a763 !default;
4
- $manga-red: #d41816 !default;
5
-
6
- $flatrica-green-100: color-functions.color-tint($flatrica-green, 80%);
7
- $flatrica-green-200: color-functions.color-tint($flatrica-green, 60%);
8
- $flatrica-green-300: color-functions.color-tint($flatrica-green, 40%);
9
- $flatrica-green-400: color-functions.color-tint($flatrica-green, 20%);
10
- $flatrica-green-500: $flatrica-green;
11
- $flatrica-green-600: color-functions.color-shade($flatrica-green, 20%);
12
- $flatrica-green-700: color-functions.color-shade($flatrica-green, 40%);
13
- $flatrica-green-800: color-functions.color-shade($flatrica-green, 60%);
14
- $flatrica-green-900: color-functions.color-shade($flatrica-green, 80%);
15
-
16
- $manga-red-100: color-functions.color-tint($manga-red, 80%);
17
- $manga-red-200: color-functions.color-tint($manga-red, 60%);
18
- $manga-red-300: color-functions.color-tint($manga-red, 40%);
19
- $manga-red-400: color-functions.color-tint($manga-red, 20%);
20
- $manga-red-500: $manga-red;
21
- $manga-red-600: color-functions.color-shade($manga-red, 20%);
22
- $manga-red-700: color-functions.color-shade($manga-red, 40%);
23
- $manga-red-800: color-functions.color-shade($manga-red, 60%);
24
- $manga-red-900: color-functions.color-shade($manga-red, 80%);
25
-
26
- $colors-collection: (
27
- "core": (
28
- "flatrica-green": $flatrica-green,
29
- "manga-red": $manga-red,
30
- ),
31
- "flatrica-green": (
32
- "100": $flatrica-green-100,
33
- "200": $flatrica-green-200,
34
- "300": $flatrica-green-300,
35
- "400": $flatrica-green-400,
36
- "500": $flatrica-green-500,
37
- "600": $flatrica-green-600,
38
- "700": $flatrica-green-700,
39
- "800": $flatrica-green-800,
40
- "900": $flatrica-green-900,
41
- ),
42
- "manga-red": (
43
- "100": $manga-red-100,
44
- "200": $manga-red-200,
45
- "300": $manga-red-300,
46
- "400": $manga-red-400,
47
- "500": $manga-red-500,
48
- "600": $manga-red-600,
49
- "700": $manga-red-700,
50
- "800": $manga-red-800,
51
- "900": $manga-red-900,
52
- ),
53
- );
@@ -1,205 +0,0 @@
1
- @forward "brands";
2
- @forward "customs";
3
- @forward "bootstrap";
4
-
5
- @use "bootstrap" as bootstrap;
6
- @use "customs" as customs;
7
- @use "brands" as brands;
8
-
9
- $colors-collection:
10
- (
11
- // BOOTSTRAP
12
- "grey": (
13
- "100": bootstrap.$gray-100,
14
- "200": bootstrap.$gray-200,
15
- "300": bootstrap.$gray-300,
16
- "400": bootstrap.$gray-400,
17
- "500": bootstrap.$gray-500,
18
- "600": bootstrap.$gray-600,
19
- "700": bootstrap.$gray-700,
20
- "800": bootstrap.$gray-800,
21
- "900": bootstrap.$gray-900,
22
- ),
23
- "blue": (
24
- "100": bootstrap.$blue-100,
25
- "200": bootstrap.$blue-200,
26
- "300": bootstrap.$blue-300,
27
- "400": bootstrap.$blue-400,
28
- "500": bootstrap.$blue-500,
29
- "600": bootstrap.$blue-600,
30
- "700": bootstrap.$blue-700,
31
- "800": bootstrap.$blue-800,
32
- "900": bootstrap.$blue-900,
33
- ),
34
- "indigo": (
35
- "100": bootstrap.$indigo-100,
36
- "200": bootstrap.$indigo-200,
37
- "300": bootstrap.$indigo-300,
38
- "400": bootstrap.$indigo-400,
39
- "500": bootstrap.$indigo-500,
40
- "600": bootstrap.$indigo-600,
41
- "700": bootstrap.$indigo-700,
42
- "800": bootstrap.$indigo-800,
43
- "900": bootstrap.$indigo-900,
44
- ),
45
- "purple": (
46
- "100": bootstrap.$purple-100,
47
- "200": bootstrap.$purple-200,
48
- "300": bootstrap.$purple-300,
49
- "400": bootstrap.$purple-400,
50
- "500": bootstrap.$purple-500,
51
- "600": bootstrap.$purple-600,
52
- "700": bootstrap.$purple-700,
53
- "800": bootstrap.$purple-800,
54
- "900": bootstrap.$purple-900,
55
- ),
56
- "pink": (
57
- "100": bootstrap.$pink-100,
58
- "200": bootstrap.$pink-200,
59
- "300": bootstrap.$pink-300,
60
- "400": bootstrap.$pink-400,
61
- "500": bootstrap.$pink-500,
62
- "600": bootstrap.$pink-600,
63
- "700": bootstrap.$pink-700,
64
- "800": bootstrap.$pink-800,
65
- "900": bootstrap.$pink-900,
66
- ),
67
- "red": (
68
- "100": bootstrap.$red-100,
69
- "200": bootstrap.$red-200,
70
- "300": bootstrap.$red-300,
71
- "400": bootstrap.$red-400,
72
- "500": bootstrap.$red-500,
73
- "600": bootstrap.$red-600,
74
- "700": bootstrap.$red-700,
75
- "800": bootstrap.$red-800,
76
- "900": bootstrap.$red-900,
77
- ),
78
- "orange": (
79
- "100": bootstrap.$orange-100,
80
- "200": bootstrap.$orange-200,
81
- "300": bootstrap.$orange-300,
82
- "400": bootstrap.$orange-400,
83
- "500": bootstrap.$orange-500,
84
- "600": bootstrap.$orange-600,
85
- "700": bootstrap.$orange-700,
86
- "800": bootstrap.$orange-800,
87
- "900": bootstrap.$orange-900,
88
- ),
89
- "yellow": (
90
- "100": bootstrap.$yellow-100,
91
- "200": bootstrap.$yellow-200,
92
- "300": bootstrap.$yellow-300,
93
- "400": bootstrap.$yellow-400,
94
- "500": bootstrap.$yellow-500,
95
- "600": bootstrap.$yellow-600,
96
- "700": bootstrap.$yellow-700,
97
- "800": bootstrap.$yellow-800,
98
- "900": bootstrap.$yellow-900,
99
- ),
100
- "green": (
101
- "100": bootstrap.$green-100,
102
- "200": bootstrap.$green-200,
103
- "300": bootstrap.$green-300,
104
- "400": bootstrap.$green-400,
105
- "500": bootstrap.$green,
106
- "600": bootstrap.$green-500,
107
- "700": bootstrap.$green-600,
108
- "800": bootstrap.$green-700,
109
- "900": bootstrap.$green-800,
110
- ),
111
- "teal": (
112
- "100": bootstrap.$teal-100,
113
- "200": bootstrap.$teal-200,
114
- "300": bootstrap.$teal-300,
115
- "400": bootstrap.$teal-400,
116
- "500": bootstrap.$teal-500,
117
- "600": bootstrap.$teal-600,
118
- "700": bootstrap.$teal-700,
119
- "800": bootstrap.$teal-800,
120
- "900": bootstrap.$teal-900,
121
- ),
122
- "cyan": (
123
- "100": bootstrap.$cyan-100,
124
- "200": bootstrap.$cyan-200,
125
- "300": bootstrap.$cyan-300,
126
- "400": bootstrap.$cyan-400,
127
- "500": bootstrap.$cyan-500,
128
- "600": bootstrap.$cyan-600,
129
- "700": bootstrap.$cyan-700,
130
- "800": bootstrap.$cyan-800,
131
- "900": bootstrap.$cyan-900,
132
- ),
133
-
134
- // CUSTOM
135
- "flatrica-green": (
136
- "100": customs.$flatrica-green-100,
137
- "200": customs.$flatrica-green-200,
138
- "300": customs.$flatrica-green-300,
139
- "400": customs.$flatrica-green-400,
140
- "500": customs.$flatrica-green-500,
141
- "600": customs.$flatrica-green-600,
142
- "700": customs.$flatrica-green-700,
143
- "800": customs.$flatrica-green-800,
144
- "900": customs.$flatrica-green-900,
145
- ),
146
- "manga-red": (
147
- "100": customs.$manga-red-100,
148
- "200": customs.$manga-red-200,
149
- "300": customs.$manga-red-300,
150
- "400": customs.$manga-red-400,
151
- "500": customs.$manga-red-500,
152
- "600": customs.$manga-red-600,
153
- "700": customs.$manga-red-700,
154
- "800": customs.$manga-red-800,
155
- "900": customs.$manga-red-900,
156
- ),
157
-
158
- // BRANDS
159
- "brand": (
160
- "facebook": brands.$brand-facebook,
161
- "youtube": brands.$brand-youtube,
162
- "twitter": brands.$brand-twitter,
163
- "skype": brands.$brand-skype,
164
- "linkedin": brands.$brand-linkedin,
165
- "whatsapp": brands.$brand-whatsapp,
166
- "telegram": brands.$brand-telegram,
167
- "twitch": brands.$brand-twitch,
168
- "pinterest": brands.$brand-pinterest,
169
- "reddit": brands.$brand-reddit,
170
- "tumblr": brands.$brand-tumblr,
171
- "patreon": brands.$brand-patreon,
172
- "kickstarter":brands.$brand-kickstarter,
173
- "instagram": brands.$brand-instagram,
174
- "tiktok": brands.$brand-tiktok,
175
- "google": brands.$brand-google,
176
- "paypal": brands.$brand-paypal,
177
- "paypal2": brands.$brand-paypal2,
178
- ),
179
-
180
- // CORE
181
- "core": (
182
- "blue": bootstrap.$blue,
183
- "indigo": bootstrap.$indigo,
184
- "purple": bootstrap.$purple,
185
- "pink": bootstrap.$pink,
186
- "red": bootstrap.$red,
187
- "orange": bootstrap.$orange,
188
- "yellow": bootstrap.$yellow,
189
- "green": bootstrap.$green,
190
- "teal": bootstrap.$teal,
191
- "cyan": bootstrap.$cyan,
192
- "black": bootstrap.$black,
193
- "white": bootstrap.$white,
194
- "gray": bootstrap.$gray-500,
195
- "gray-dark": bootstrap.$gray-900,
196
- "flatrica-green": customs.$flatrica-green,
197
- "manga-red": customs.$manga-red,
198
- ),
199
-
200
- // ADVANCED
201
- "advanced": (
202
- "brand-instagram": brands.$advanced-brand-instagram,
203
- "brand-tiktok": brands.$advanced-brand-tiktok,
204
- ),
205
- );
@@ -1,111 +0,0 @@
1
- @use "sass:color";
2
- @use "sass:math";
3
- @use "sass:string";
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 mix(rgba($foreground, 1), $background, opacity($foreground) * 100%);
12
- }
13
-
14
-
15
- /*
16
- * Tint a color: mix a color with white
17
- * function credited to https://getbootstrap.com/
18
- */
19
- @function color-tint($color, $weight) {
20
- @return mix(white, $color, $weight);
21
- }
22
-
23
-
24
- /*
25
- * Shade a color: mix a color with black
26
- * function credited to https://getbootstrap.com/
27
- */
28
- @function color-shade($color, $weight) {
29
- @return mix(black, $color, $weight);
30
- }
31
-
32
-
33
- /*
34
- * Shade the color if the weight is positive, else tint it
35
- * function credited to https://getbootstrap.com/
36
- */
37
- @function color-shift($color, $weight) {
38
- @return if($weight > 0, color-shade($color, $weight), color-tint($color, -$weight));
39
- }
40
-
41
-
42
- /**
43
- * Compares contrast of a given color to the light/dark arguments and returns whichever is most "contrasty"
44
- */
45
- @function color-contrast($color: #fff, $dark: #000, $light: #fff) {
46
- @if type-of($color) != color or $color == transparent {
47
- @return inherit;
48
- }
49
- $color-brightness: color-brightness($color);
50
- $light-text-brightness: color-brightness($light);
51
- $dark-text-brightness: color-brightness($dark);
52
-
53
- @return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark);
54
- }
55
-
56
-
57
-
58
- // Return WCAG2.1 relative luminance
59
- // See https://www.w3.org/TR/WCAG/#dfn-relative-luminance
60
- // See https://en.wikipedia.org/wiki/Relative_luminance
61
- // Gives %, less than 50 darker is better, less than 50, lighter.
62
- @function color-brightness($color) {
63
- // fallback
64
- @if $color == transparent or type-of($color) != color {
65
- @return 100;
66
- }
67
- @return math.div(((red($color) * .299) + (green($color) * .587) + (blue($color) * .114)), 255 * 100%);
68
- }
69
-
70
-
71
- /**
72
- * Hex to RGB (only numbers, transparentize would add rgba(*))
73
- */
74
- @function hex2rgb($color: #fff){
75
- @if $color == transparent or type-of($color) != color {
76
- @return $color;
77
- }
78
- @return red($color), green($color), blue($color);
79
- }
80
-
81
-
82
- /**
83
- * RGB to Hex
84
- */
85
- @function rgb2hex($color: rgb(255,255,255)){
86
- @if $color == transparent or type-of($color) != color {
87
- @return $color;
88
- }
89
- $ie-hex: ie_hex_str($color);
90
- @return string.unquote('#' + string.slice(color.ie-hex-str($color), 4));
91
- }
92
-
93
-
94
- /**
95
- * Create default collection
96
- */
97
- @function create-collection($color){
98
- $list: (
99
- "100": color-tint($color, 80%),
100
- "200": color-tint($color, 60%),
101
- "300": color-tint($color, 40%),
102
- "400": color-tint($color, 20%),
103
- "500": $color,
104
- "600": color-shade($color, 20%),
105
- "700": color-shade($color, 40%),
106
- "800": color-shade($color, 60%),
107
- "900": color-shade($color, 80%)
108
- );
109
-
110
- @return $list
111
- }
@@ -1,23 +0,0 @@
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{
9
- @return $value;
10
- }
11
- }
12
- @return null;
13
- }
14
-
15
- /*
16
- * If the color is transparent, return inherit
17
- */
18
- @function no-transparent-var($color: transparent){
19
- @if $color == transparent {
20
- @return inherit;
21
- }
22
- @return $color;
23
- }
@@ -1,31 +0,0 @@
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
- }
package/src/index.scss DELETED
@@ -1,14 +0,0 @@
1
- @forward "./colors";
2
-
3
- @forward "./mixins/build-scrollbar";
4
- @forward "./mixins/build-aspect-ratio";
5
-
6
- @forward "mixins/build-compatibility";
7
- @forward "./mixins/create-colors";
8
- @forward "./mixins/create-instruction";
9
- @forward "./mixins/create-helper-margin";
10
- @forward "./mixins/create-helper-padding";
11
-
12
- @forward "./functions/colors";
13
- @forward "./functions/helpers";
14
- @forward "./functions/strings";
@@ -1,34 +0,0 @@
1
- /**
2
- * Use in the parent\container, to be coupled with {build-aspect-ratio-anchor}
3
- */
4
- @mixin build-aspect-ratio-container($ratio: 100%){
5
- position: relative;
6
-
7
- &::before{
8
- content: "";
9
- display: block;
10
- padding-top: 100%;
11
- }
12
- }
13
-
14
- /**
15
- * Use in the child that "gives" form to the parent that has the respective {build-aspect-ratio-container}
16
- */
17
- @mixin build-aspect-ratio-anchor($ratio: 100%){
18
- position: absolute;
19
- top: 0;
20
- left: 0;
21
- width: 100%;
22
- height: 100%;
23
- }
24
-
25
- /**
26
- * aspect ratio shortcut
27
- */
28
- @mixin build-aspect-ratio($ratio: 100%){
29
- @include build-aspect-ratio-container($ratio);
30
-
31
- & > * {
32
- @include build-aspect-ratio-anchor($ratio);
33
- }
34
- }