@guebbit/css-toolkit 1.0.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/.stylelintignore +2 -0
- package/.stylelintrc.json +23 -0
- package/LICENSE +661 -0
- package/README.md +5 -0
- package/docs/.postcssrc.cjs +12 -0
- package/docs/.vitepress/config.ts +89 -0
- package/docs/.vitepress/theme/index.js +12 -0
- package/docs/colors/bootstrap.md +1 -0
- package/docs/colors/brands.md +1 -0
- package/docs/colors/customs.md +1 -0
- package/docs/functions/colors.md +66 -0
- package/docs/functions/helpers.md +1 -0
- package/docs/functions/strings.md +1 -0
- package/docs/index.md +1 -0
- package/docs/logo.svg +55 -0
- package/docs/logotype.svg +149 -0
- package/docs/mixins/build-aspect-ratio.md +1 -0
- package/docs/mixins/build-compatibility.md +23 -0
- package/docs/mixins/build-scrollbar.md +19 -0
- package/docs/mixins/create-colors.md +1 -0
- package/docs/mixins/create-helper-margin.md +25 -0
- package/docs/mixins/create-helper-padding.md +24 -0
- package/docs/mixins/create-instruction.md +33 -0
- package/index.scss +1 -0
- package/package.json +326 -0
- package/src/colors/_bootstrap.scss +180 -0
- package/src/colors/_brands.scss +20 -0
- package/src/colors/_customs.scss +53 -0
- package/src/colors/_index.scss +205 -0
- package/src/functions/_colors.scss +111 -0
- package/src/functions/_helpers.scss +23 -0
- package/src/functions/_strings.scss +31 -0
- package/src/index.scss +14 -0
- package/src/mixins/_build-aspect-ratio.scss +34 -0
- package/src/mixins/_build-compatibility.scss +28 -0
- package/src/mixins/_build-scrollbar.scss +32 -0
- package/src/mixins/_create-colors.scss +119 -0
- package/src/mixins/_create-helper-margin.scss +39 -0
- package/src/mixins/_create-helper-padding.scss +40 -0
- package/src/mixins/_create-instruction.scss +11 -0
- package/test/compile.test.js +19 -0
- package/test/lint.test.js +33 -0
- package/test.scss +65 -0
- package/vite.config.ts +26 -0
|
@@ -0,0 +1,205 @@
|
|
|
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
|
+
);
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +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);
|
|
31
|
+
}
|
package/src/index.scss
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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";
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +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
|
|
28
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +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.hex2rgb($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.hex2rgb(color-functions.color-contrast($scolor))};
|
|
114
|
+
// _}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* t - applies the spacing for margin-top
|
|
4
|
+
* b - applies the spacing for margin-bottom
|
|
5
|
+
* l - applies the spacing for margin-left
|
|
6
|
+
* r - applies the spacing for margin-right
|
|
7
|
+
* x - applies the spacing for both *-left and *-right
|
|
8
|
+
* y - applies the spacing for both *-top and *-bottom
|
|
9
|
+
* a - applies the spacing for the property in all directions
|
|
10
|
+
*
|
|
11
|
+
* @param {Array<name,value>[]} measure-list - postfix name and value
|
|
12
|
+
*/
|
|
13
|
+
@mixin create-helper-margin($measure-list: (), $important: false, $prefix: "") {
|
|
14
|
+
@each $name, $val in $measure-list {
|
|
15
|
+
.#{$prefix}mt-#{$name} {
|
|
16
|
+
margin-top: #{$val} #{if($important == true, "!important", "")};
|
|
17
|
+
}
|
|
18
|
+
.#{$prefix}mb-#{$name} {
|
|
19
|
+
margin-bottom: #{$val} #{if($important == true, "!important", "")};
|
|
20
|
+
}
|
|
21
|
+
.#{$prefix}ml-#{$name} {
|
|
22
|
+
margin-left: #{$val} #{if($important == true, "!important", "")};
|
|
23
|
+
}
|
|
24
|
+
.#{$prefix}mr-#{$name} {
|
|
25
|
+
margin-right: #{$val} #{if($important == true, "!important", "")};
|
|
26
|
+
}
|
|
27
|
+
.#{$prefix}mx-#{$name} {
|
|
28
|
+
margin-right: #{$val} #{if($important == true, "!important", "")};
|
|
29
|
+
margin-left: #{$val} #{if($important == true, "!important", "")};
|
|
30
|
+
}
|
|
31
|
+
.#{$prefix}my-#{$name} {
|
|
32
|
+
margin-top: #{$val} #{if($important == true, "!important", "")};
|
|
33
|
+
margin-bottom: #{$val} #{if($important == true, "!important", "")};
|
|
34
|
+
}
|
|
35
|
+
.#{$prefix}ma-#{$name} {
|
|
36
|
+
margin: #{$val} #{if($important == true, "!important", "")};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* t - applies the spacing for padding-top
|
|
4
|
+
* b - applies the spacing for padding-bottom
|
|
5
|
+
* l - applies the spacing for padding-left
|
|
6
|
+
* r - applies the spacing for padding-right
|
|
7
|
+
* x - applies the spacing for both *-left and *-right
|
|
8
|
+
* y - applies the spacing for both *-top and *-bottom
|
|
9
|
+
* a - applies the spacing for the property in all directions
|
|
10
|
+
|
|
11
|
+
* @param {Array<name,value>[]} measure-list - postfix name and value
|
|
12
|
+
*/
|
|
13
|
+
@mixin create-helper-padding($measure-list: (), $important: false, $prefix: "") {
|
|
14
|
+
|
|
15
|
+
@each $name, $val in $measure-list {
|
|
16
|
+
.#{$prefix}pt-#{$name} {
|
|
17
|
+
padding-top: #{$val} #{if($important == true, "!important", "")};
|
|
18
|
+
}
|
|
19
|
+
.#{$prefix}pb-#{$name} {
|
|
20
|
+
padding-bottom: #{$val} #{if($important == true, "!important", "")};
|
|
21
|
+
}
|
|
22
|
+
.#{$prefix}pl-#{$name} {
|
|
23
|
+
padding-left: #{$val} #{if($important == true, "!important", "")};
|
|
24
|
+
}
|
|
25
|
+
.#{$prefix}pr-#{$name} {
|
|
26
|
+
padding-right: #{$val} #{if($important == true, "!important", "")};
|
|
27
|
+
}
|
|
28
|
+
.#{$prefix}px-#{$name} {
|
|
29
|
+
padding-right: #{$val} #{if($important == true, "!important", "")};
|
|
30
|
+
padding-left: #{$val} #{if($important == true, "!important", "")};
|
|
31
|
+
}
|
|
32
|
+
.#{$prefix}py-#{$name} {
|
|
33
|
+
padding-top: #{$val} #{if($important == true, "!important", "")};
|
|
34
|
+
padding-bottom: #{$val} #{if($important == true, "!important", "")};
|
|
35
|
+
}
|
|
36
|
+
.#{$prefix}pa-#{$name} {
|
|
37
|
+
padding: #{$val} #{if($important == true, "!important", "")};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|