@acorex/styles 19.10.0-next.0 → 19.10.0-next.2
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/base/index.scss +22 -0
- package/{src/shared → components}/_drop-down.scss +2 -2
- package/{src/shared → components}/_editor-container.scss +2 -18
- package/{src/shared/_utils.scss → components/_uploader.scss} +11 -46
- package/{src/shared → components}/index.scss +3 -6
- package/index.scss +5 -7
- package/package.json +1 -1
- package/tailwind-base.js +203 -180
- package/themes/default.scss +24 -237
- package/utils/_theme-generator.scss +228 -0
- package/utils/_utils.scss +286 -0
- package/utils/index.scss +2 -0
- package/variables/_colors.scss +8 -0
- package/variables/_looks.scss +1 -0
- package/variables/index.scss +2 -0
- package/index.css +0 -988
- package/index.min.css +0 -1
- package/src/base/index.scss +0 -11
- package/src/shared/_inputs.scss +0 -0
- package/src/utility/index.scss +0 -4
- package/src/variables/_colors.scss +0 -2
- package/src/variables/_degrees.scss +0 -1
- package/src/variables/index.scss +0 -2
- package/themes/default.css +0 -1
- package/themes/test.scss +0 -237
- /package/{src/base → base}/_preflight.scss +0 -0
- /package/{src/shared → components}/_action-item.scss +0 -0
- /package/{src/shared → components}/_actionsheet.scss +0 -0
- /package/{src/shared → components}/_check-box.scss +0 -0
- /package/{src/shared → components}/_general-button.scss +0 -0
- /package/{src/shared → components}/_list.scss +0 -0
- /package/{src/shared → components}/_radio.scss +0 -0
- /package/{src/shared → components}/_ripple.scss +0 -0
- /package/{src/shared → components}/_table.scss +0 -0
- /package/{src/mixins → mixins}/_look.scss +0 -0
- /package/{src/mixins → mixins}/_media.scss +0 -0
- /package/{src/mixins → mixins}/_util.scss +0 -0
- /package/{src/mixins → mixins}/index.scss +0 -0
package/themes/default.scss
CHANGED
@@ -1,245 +1,32 @@
|
|
1
|
+
@use '../utils/index.scss' as *;
|
2
|
+
|
3
|
+
$theme-colors: (
|
4
|
+
'primary': #2563eb,
|
5
|
+
'secondary': #e84f88,
|
6
|
+
'success': #10b981,
|
7
|
+
'warning': #ffca28,
|
8
|
+
'danger': #ff2056,
|
9
|
+
'ghost': #71717a,
|
10
|
+
) !default;
|
11
|
+
|
12
|
+
$theme-surfaces: (
|
13
|
+
'light-start': #ffffff,
|
14
|
+
'light-end': #dee2e6,
|
15
|
+
'dark-start': #13161b,
|
16
|
+
'dark-end': #0c0e12,
|
17
|
+
) !default;
|
18
|
+
|
19
|
+
@forward '../variables/index.scss';
|
20
|
+
|
1
21
|
:root,
|
2
22
|
.ax-light {
|
3
23
|
--ax-sys-body-font-size: 1rem;
|
4
24
|
--ax-sys-size-base: 2.5rem;
|
5
|
-
--ax-sys-transition-duration: 150ms;
|
6
|
-
--ax-sys-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
7
|
-
--ax-sys-border-radius: 0.5rem;
|
8
|
-
--ax-sys-border-color: 233, 234, 235;
|
9
|
-
--ax-sys-body-bg-color: var(--ax-sys-color-surface-lowest);
|
10
|
-
--ax-sys-body-text-color: 22, 22, 22;
|
11
|
-
|
12
|
-
// Surfaces
|
13
|
-
--ax-sys-color-surface-light: 255, 255, 255;
|
14
|
-
--ax-sys-color-on-surface-light: 0, 0, 0;
|
15
|
-
--ax-sys-color-border-surface-light: 0, 0, 0;
|
16
|
-
|
17
|
-
--ax-sys-color-surface-lowest: 255, 255, 255;
|
18
|
-
--ax-sys-color-on-surface-lowest: 40, 40, 40;
|
19
|
-
--ax-sys-color-border-surface-lowest: 233, 236, 239;
|
20
|
-
|
21
|
-
--ax-sys-color-surface-low: 248, 249, 250;
|
22
|
-
--ax-sys-color-on-surface-low: 40, 40, 40;
|
23
|
-
--ax-sys-color-border-surface-low: 233, 236, 239;
|
24
|
-
|
25
|
-
--ax-sys-color-surface: 239, 241, 243;
|
26
|
-
--ax-sys-color-on-surface: 30, 30, 30;
|
27
|
-
--ax-sys-color-border-surface: 232, 235, 238;
|
28
|
-
|
29
|
-
--ax-sys-color-surface-high: 234, 237, 239;
|
30
|
-
--ax-sys-color-on-surface-high: 20, 20, 20;
|
31
|
-
--ax-sys-color-border-surface-high: 228, 231, 234;
|
32
|
-
|
33
|
-
--ax-sys-color-surface-highest: 230, 233, 236;
|
34
|
-
--ax-sys-color-on-surface-highest: 10, 10, 10;
|
35
|
-
--ax-sys-color-border-surface-highest: 225, 229, 233;
|
36
25
|
|
37
|
-
--ax-sys-
|
38
|
-
--ax-sys-color-on-surface-dark: 255, 255, 255;
|
39
|
-
--ax-sys-color-border-surface-dark: 255, 255, 255;
|
40
|
-
|
41
|
-
--ax-sys-color-input-surface: 255, 255, 255;
|
42
|
-
--ax-sys-color-input-surface-text: 30, 30, 30;
|
43
|
-
--ax-sys-color-input-surface-placeholder: 180, 180, 180;
|
44
|
-
--ax-sys-color-input-surface-border: 220, 220, 220;
|
45
|
-
|
46
|
-
--ax-sys-color-primary-50: 227, 244, 255;
|
47
|
-
--ax-sys-color-primary-100: 207, 231, 255;
|
48
|
-
--ax-sys-color-primary-200: 167, 207, 255;
|
49
|
-
--ax-sys-color-primary-300: 126, 181, 255;
|
50
|
-
--ax-sys-color-primary-400: 81, 154, 255;
|
51
|
-
--ax-sys-color-primary-500: 43, 127, 255;
|
52
|
-
--ax-sys-color-primary-600: 0, 97, 222;
|
53
|
-
--ax-sys-color-primary-700: 0, 66, 190;
|
54
|
-
--ax-sys-color-primary-800: 0, 31, 158;
|
55
|
-
--ax-sys-color-primary-900: 0, 0, 117;
|
56
|
-
--ax-sys-color-primary-950: 0, 0, 89;
|
57
|
-
--ax-sys-color-on-primary: 255, 255, 255;
|
58
|
-
--ax-sys-color-on-contrast-primary: 0, 0, 89;
|
59
|
-
|
60
|
-
--ax-sys-color-secondary-50: 231, 240, 255;
|
61
|
-
--ax-sys-color-secondary-100: 216, 226, 244;
|
62
|
-
--ax-sys-color-secondary-200: 188, 196, 214;
|
63
|
-
--ax-sys-color-secondary-300: 159, 168, 185;
|
64
|
-
--ax-sys-color-secondary-400: 132, 141, 157;
|
65
|
-
--ax-sys-color-secondary-500: 106, 114, 130;
|
66
|
-
--ax-sys-color-secondary-600: 83, 91, 107;
|
67
|
-
--ax-sys-color-secondary-700: 62, 69, 84;
|
68
|
-
--ax-sys-color-secondary-800: 42, 48, 62;
|
69
|
-
--ax-sys-color-secondary-900: 23, 29, 42;
|
70
|
-
--ax-sys-color-secondary-950: 14, 20, 32;
|
71
|
-
--ax-sys-color-on-secondary: 255, 255, 255;
|
72
|
-
--ax-sys-color-on-contrast-secondary: 14, 20, 32;
|
73
|
-
|
74
|
-
--ax-sys-color-success-50: 199, 255, 228;
|
75
|
-
--ax-sys-color-success-100: 152, 255, 206;
|
76
|
-
--ax-sys-color-success-200: 102, 247, 180;
|
77
|
-
--ax-sys-color-success-300: 78, 227, 162;
|
78
|
-
--ax-sys-color-success-400: 51, 207, 143;
|
79
|
-
--ax-sys-color-success-500: 1, 188, 125;
|
80
|
-
--ax-sys-color-success-600: 0, 153, 93;
|
81
|
-
--ax-sys-color-success-700: 0, 116, 67;
|
82
|
-
--ax-sys-color-success-800: 0, 80, 43;
|
83
|
-
--ax-sys-color-success-900: 0, 47, 21;
|
84
|
-
--ax-sys-color-success-950: 0, 32, 11;
|
85
|
-
--ax-sys-color-on-success: 255, 255, 255;
|
86
|
-
--ax-sys-color-on-contrast-success: 0, 32, 11;
|
87
|
-
|
88
|
-
--ax-sys-color-warning-50: 255, 242, 216;
|
89
|
-
--ax-sys-color-warning-100: 255, 233, 198;
|
90
|
-
--ax-sys-color-warning-200: 255, 213, 158;
|
91
|
-
--ax-sys-color-warning-300: 255, 192, 113;
|
92
|
-
--ax-sys-color-warning-400: 255, 170, 50;
|
93
|
-
--ax-sys-color-warning-500: 253, 154, 1;
|
94
|
-
--ax-sys-color-warning-600: 208, 116, 0;
|
95
|
-
--ax-sys-color-warning-700: 157, 85, 0;
|
96
|
-
--ax-sys-color-warning-800: 109, 55, 0;
|
97
|
-
--ax-sys-color-warning-900: 65, 28, 0;
|
98
|
-
--ax-sys-color-warning-950: 45, 16, 0;
|
99
|
-
--ax-sys-color-on-warning: 255, 255, 255;
|
100
|
-
--ax-sys-color-on-contrast-warning: 45, 16, 0;
|
101
|
-
|
102
|
-
--ax-sys-color-danger-50: 255, 233, 233;
|
103
|
-
--ax-sys-color-danger-100: 255, 216, 216;
|
104
|
-
--ax-sys-color-danger-200: 255, 181, 181;
|
105
|
-
--ax-sys-color-danger-300: 255, 142, 152;
|
106
|
-
--ax-sys-color-danger-400: 255, 94, 117;
|
107
|
-
--ax-sys-color-danger-500: 255, 32, 86;
|
108
|
-
--ax-sys-color-danger-600: 215, 0, 60;
|
109
|
-
--ax-sys-color-danger-700: 165, 0, 43;
|
110
|
-
--ax-sys-color-danger-800: 119, 0, 27;
|
111
|
-
--ax-sys-color-danger-900: 75, 0, 11;
|
112
|
-
--ax-sys-color-danger-950: 54, 0, 5;
|
113
|
-
--ax-sys-color-on-danger: 255, 255, 255;
|
114
|
-
--ax-sys-color-on-contrast-danger: 54, 0, 5;
|
26
|
+
--ax-sys-border-radius: 0.5rem;
|
115
27
|
|
116
|
-
--ax-sys-
|
117
|
-
--ax-sys-
|
118
|
-
--ax-sys-color-ghost-200: 228, 228, 231;
|
119
|
-
--ax-sys-color-ghost-300: 212, 212, 216;
|
120
|
-
--ax-sys-color-ghost-400: 159, 159, 169;
|
121
|
-
--ax-sys-color-ghost-500: 113, 113, 123;
|
122
|
-
--ax-sys-color-ghost-600: 82, 82, 92;
|
123
|
-
--ax-sys-color-ghost-700: 63, 63, 70;
|
124
|
-
--ax-sys-color-ghost-800: 39, 39, 42;
|
125
|
-
--ax-sys-color-ghost-900: 24, 24, 27;
|
126
|
-
--ax-sys-color-ghost-950: 9, 9, 11;
|
127
|
-
--ax-sys-color-on-ghost: 255, 255, 255;
|
128
|
-
--ax-sys-color-on-contrast-ghost: 24, 24, 27;
|
28
|
+
// --ax-sys-body-bg-color: var(--ax-sys-color-surface-lowest);
|
29
|
+
// --ax-sys-body-text-color: var(--ax-sys-color-surface-lowest-border);
|
129
30
|
}
|
130
31
|
|
131
|
-
|
132
|
-
--ax-sys-body-bg-color: var(--ax-sys-color-surface-lowest);
|
133
|
-
--ax-sys-body-text-color: 255, 255, 255;
|
134
|
-
|
135
|
-
--ax-sys-border-color: 34, 38, 47;
|
136
|
-
|
137
|
-
--ax-sys-color-surface-lowest: 15, 15, 15;
|
138
|
-
--ax-sys-color-on-surface-lowest: 220, 220, 220;
|
139
|
-
--ax-sys-color-border-surface-lowest: 20, 20, 20;
|
140
|
-
|
141
|
-
--ax-sys-color-surface-low: 20, 20, 20;
|
142
|
-
--ax-sys-color-on-surface-low: 230, 230, 230;
|
143
|
-
--ax-sys-color-border-surface-low: 25, 25, 25;
|
144
|
-
|
145
|
-
--ax-sys-color-surface: 25, 25, 25;
|
146
|
-
--ax-sys-color-on-surface: 240, 240, 240;
|
147
|
-
--ax-sys-color-border-surface: 34, 34, 34;
|
148
|
-
|
149
|
-
--ax-sys-color-surface-high: 29, 29, 29;
|
150
|
-
--ax-sys-color-on-surface-high: 250, 250, 250;
|
151
|
-
--ax-sys-color-border-surface-high: 43, 43, 43;
|
152
|
-
|
153
|
-
--ax-sys-color-surface-highest: 34, 34, 34;
|
154
|
-
--ax-sys-color-on-surface-highest: 255, 255, 255;
|
155
|
-
--ax-sys-color-border-surface-highest: 52, 52, 52;
|
156
|
-
|
157
|
-
--ax-sys-color-input-surface: var(--ax-sys-color-surface-lowest);
|
158
|
-
--ax-sys-color-input-surface-text: var(--ax-sys-color-on-surface-lowest);
|
159
|
-
--ax-sys-color-input-surface-placeholder: 100, 100, 100;
|
160
|
-
--ax-sys-color-input-surface-border: var(--ax-sys-color-border-surface);
|
161
|
-
|
162
|
-
--ax-sys-color-primary-50: 233, 247, 255;
|
163
|
-
--ax-sys-color-primary-100: 219, 238, 255;
|
164
|
-
--ax-sys-color-primary-200: 190, 221, 255;
|
165
|
-
--ax-sys-color-primary-300: 161, 203, 255;
|
166
|
-
--ax-sys-color-primary-400: 132, 185, 255;
|
167
|
-
--ax-sys-color-primary-500: 101, 166, 255;
|
168
|
-
--ax-sys-color-primary-600: 67, 146, 255;
|
169
|
-
--ax-sys-color-primary-700: 43, 127, 255;
|
170
|
-
--ax-sys-color-primary-800: 25, 112, 239;
|
171
|
-
--ax-sys-color-primary-900: 0, 98, 223;
|
172
|
-
--ax-sys-color-primary-950: 0, 90, 215;
|
173
|
-
--ax-sys-color-on-primary: 0, 0, 91;
|
174
|
-
--ax-sys-color-on-contrast-primary: 0, 12, 146;
|
175
|
-
|
176
|
-
--ax-sys-color-secondary-50: 240, 249, 255;
|
177
|
-
--ax-sys-color-secondary-100: 233, 242, 255;
|
178
|
-
--ax-sys-color-secondary-200: 219, 228, 243;
|
179
|
-
--ax-sys-color-secondary-300: 206, 214, 229;
|
180
|
-
--ax-sys-color-secondary-400: 192, 201, 215;
|
181
|
-
--ax-sys-color-secondary-500: 179, 187, 202;
|
182
|
-
--ax-sys-color-secondary-600: 166, 174, 188;
|
183
|
-
--ax-sys-color-secondary-700: 153, 161, 175;
|
184
|
-
--ax-sys-color-secondary-800: 135, 143, 157;
|
185
|
-
--ax-sys-color-secondary-900: 118, 126, 139;
|
186
|
-
--ax-sys-color-secondary-950: 110, 117, 131;
|
187
|
-
--ax-sys-color-on-secondary: 16, 22, 32;
|
188
|
-
--ax-sys-color-on-contrast-secondary: 40, 46, 57;
|
189
|
-
|
190
|
-
--ax-sys-color-success-50: 210, 255, 233;
|
191
|
-
--ax-sys-color-success-100: 180, 255, 219;
|
192
|
-
--ax-sys-color-success-200: 115, 255, 191;
|
193
|
-
--ax-sys-color-success-300: 99, 244, 178;
|
194
|
-
--ax-sys-color-success-400: 82, 230, 164;
|
195
|
-
--ax-sys-color-success-500: 63, 216, 151;
|
196
|
-
--ax-sys-color-success-600: 41, 202, 138;
|
197
|
-
--ax-sys-color-success-700: 1, 188, 125;
|
198
|
-
--ax-sys-color-success-800: 0, 170, 108;
|
199
|
-
--ax-sys-color-success-900: 0, 151, 91;
|
200
|
-
--ax-sys-color-success-950: 0, 141, 85;
|
201
|
-
--ax-sys-color-on-success: 0, 31, 10;
|
202
|
-
--ax-sys-color-on-contrast-success: 0, 59, 29;
|
203
|
-
|
204
|
-
--ax-sys-color-warning-50: 255, 245, 222;
|
205
|
-
--ax-sys-color-warning-100: 255, 238, 208;
|
206
|
-
--ax-sys-color-warning-200: 255, 224, 181;
|
207
|
-
--ax-sys-color-warning-300: 255, 210, 152;
|
208
|
-
--ax-sys-color-warning-400: 255, 195, 120;
|
209
|
-
--ax-sys-color-warning-500: 255, 180, 82;
|
210
|
-
--ax-sys-color-warning-600: 255, 165, 33;
|
211
|
-
--ax-sys-color-warning-700: 253, 154, 1;
|
212
|
-
--ax-sys-color-warning-800: 230, 133, 0;
|
213
|
-
--ax-sys-color-warning-900: 203, 114, 0;
|
214
|
-
--ax-sys-color-warning-950: 190, 105, 0;
|
215
|
-
--ax-sys-color-on-warning: 41, 13, 0;
|
216
|
-
--ax-sys-color-on-contrast-warning: 74, 34, 0;
|
217
|
-
|
218
|
-
--ax-sys-color-danger-50: 255, 240, 242;
|
219
|
-
--ax-sys-color-danger-100: 255, 230, 233;
|
220
|
-
--ax-sys-color-danger-200: 255, 210, 215;
|
221
|
-
--ax-sys-color-danger-300: 255, 189, 196;
|
222
|
-
--ax-sys-color-danger-400: 255, 167, 178;
|
223
|
-
--ax-sys-color-danger-500: 255, 144, 159;
|
224
|
-
--ax-sys-color-danger-600: 255, 117, 140;
|
225
|
-
--ax-sys-color-danger-700: 255, 99, 126;
|
226
|
-
--ax-sys-color-danger-800: 234, 80, 109;
|
227
|
-
--ax-sys-color-danger-900: 213, 59, 92;
|
228
|
-
--ax-sys-color-danger-950: 203, 48, 84;
|
229
|
-
--ax-sys-color-on-danger: 54, 0, 9;
|
230
|
-
--ax-sys-color-on-contrast-danger: 97, 0, 25;
|
231
|
-
|
232
|
-
--ax-sys-color-ghost-50: 9, 9, 11;
|
233
|
-
--ax-sys-color-ghost-100: 24, 24, 27;
|
234
|
-
--ax-sys-color-ghost-200: 39, 39, 42;
|
235
|
-
--ax-sys-color-ghost-300: 63, 63, 70;
|
236
|
-
--ax-sys-color-ghost-400: 82, 82, 92;
|
237
|
-
--ax-sys-color-ghost-500: 113, 113, 123;
|
238
|
-
--ax-sys-color-ghost-600: 159, 159, 169;
|
239
|
-
--ax-sys-color-ghost-700: 212, 212, 216;
|
240
|
-
--ax-sys-color-ghost-800: 228, 228, 231;
|
241
|
-
--ax-sys-color-ghost-900: 244, 244, 245;
|
242
|
-
--ax-sys-color-ghost-950: 250, 250, 250;
|
243
|
-
--ax-sys-color-on-ghost: 24, 24, 27;
|
244
|
-
--ax-sys-color-on-contrast-ghost: 244, 244, 245;
|
245
|
-
}
|
32
|
+
@include generate-pallete-variables($theme-colors, $theme-surfaces, true);
|
@@ -0,0 +1,228 @@
|
|
1
|
+
@use './utils' as *;
|
2
|
+
@use 'sass:color';
|
3
|
+
@use 'sass:meta';
|
4
|
+
@use 'sass:math';
|
5
|
+
@use 'sass:map';
|
6
|
+
|
7
|
+
@function generate-ghost-colors($primary, $impact-rate, $is-dark: false) {
|
8
|
+
@if $is-dark {
|
9
|
+
@return (
|
10
|
+
ax-sys-color-ghost-950: color.mix(white, $primary, (1 - $impact-rate) * 30%),
|
11
|
+
ax-sys-color-ghost-900: color.mix(white, $primary, (1 - $impact-rate) * 10%),
|
12
|
+
ax-sys-color-ghost-800: color.mix(white, $primary, (1 - $impact-rate) * 20%),
|
13
|
+
ax-sys-color-ghost-700: color.mix(white, $primary, (1 - $impact-rate) * 30%),
|
14
|
+
ax-sys-color-ghost-600: color.mix(white, $primary, (1 - $impact-rate) * 45%),
|
15
|
+
ax-sys-color-ghost-500: color.mix(white, $primary, (1 - $impact-rate) * 60%),
|
16
|
+
ax-sys-color-ghost-400: color.mix(white, $primary, (1 - $impact-rate) * 75%),
|
17
|
+
ax-sys-color-ghost-300: color.mix(white, $primary, (1 - $impact-rate) * 85%),
|
18
|
+
ax-sys-color-ghost-200: color.mix(white, $primary, (1 - $impact-rate) * 92%),
|
19
|
+
ax-sys-color-ghost-100: color.mix(white, $primary, (1 - $impact-rate) * 96%),
|
20
|
+
ax-sys-color-ghost-50: color.mix(white, $primary, (1 - $impact-rate) * 70%),
|
21
|
+
ax-sys-color-on-ghost: color.mix(black, $primary, $impact-rate * 8%),
|
22
|
+
//ax-sys-color-on-contrast-ghost: color.mix(white, $primary, (1 - $impact-rate) * 95%),
|
23
|
+
ax-sys-color-on-contrast-ghost: color.mix(black, $primary, $impact-rate * 8%)
|
24
|
+
);
|
25
|
+
} @else {
|
26
|
+
@return (
|
27
|
+
ax-sys-color-ghost-50: color.mix(white, $primary, (1 - $impact-rate) * 99%),
|
28
|
+
ax-sys-color-ghost-100: color.mix(white, $primary, (1 - $impact-rate) * 96%),
|
29
|
+
ax-sys-color-ghost-200: color.mix(white, $primary, (1 - $impact-rate) * 92%),
|
30
|
+
ax-sys-color-ghost-300: color.mix(white, $primary, (1 - $impact-rate) * 85%),
|
31
|
+
ax-sys-color-ghost-400: color.mix(white, $primary, (1 - $impact-rate) * 75%),
|
32
|
+
ax-sys-color-ghost-500: color.mix(white, $primary, (1 - $impact-rate) * 60%),
|
33
|
+
ax-sys-color-ghost-600: color.mix(white, $primary, (1 - $impact-rate) * 45%),
|
34
|
+
ax-sys-color-ghost-700: color.mix(white, $primary, (1 - $impact-rate) * 30%),
|
35
|
+
ax-sys-color-ghost-800: color.mix(white, $primary, (1 - $impact-rate) * 20%),
|
36
|
+
ax-sys-color-ghost-900: color.mix(white, $primary, (1 - $impact-rate) * 10%),
|
37
|
+
ax-sys-color-ghost-950: color.mix(white, $primary, (1 - $impact-rate) * 5%),
|
38
|
+
ax-sys-color-on-ghost: color.mix(white, $primary, (1 - $impact-rate) * 95%),
|
39
|
+
ax-sys-color-on-contrast-ghost: color.mix(black, $primary, $impact-rate * 8%)
|
40
|
+
);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
@function generate-surfaces-colors-variables($surfaces, $is-dark) {
|
45
|
+
// Extract the start and end colors for both light and dark themes
|
46
|
+
$start-color: map.get($surfaces, 'light-start');
|
47
|
+
$end-color: map.get($surfaces, 'light-end');
|
48
|
+
|
49
|
+
// If the dark theme is enabled, use the dark theme colors
|
50
|
+
@if $is-dark {
|
51
|
+
$start-color: map.get($surfaces, 'dark-start');
|
52
|
+
$end-color: map.get($surfaces, 'dark-end');
|
53
|
+
}
|
54
|
+
|
55
|
+
// Lightest Surface (start color)
|
56
|
+
$lightest-surface: $start-color;
|
57
|
+
$on-lightest-surface: contrast-text($lightest-surface, $is-dark);
|
58
|
+
$lightest-surface-border: border-color($lightest-surface, $is-dark);
|
59
|
+
|
60
|
+
// Lighter Surface: 80% of $start-color
|
61
|
+
$lighter-surface: color.mix($start-color, $end-color, 80%);
|
62
|
+
$on-lighter-surface: contrast-text($lighter-surface, $is-dark);
|
63
|
+
$lighter-surface-border: border-color($lighter-surface, $is-dark);
|
64
|
+
|
65
|
+
// Light Surface: 65% of $start-color
|
66
|
+
$light-surface: color.mix($start-color, $end-color, 65%);
|
67
|
+
$on-light-surface: contrast-text($light-surface, $is-dark);
|
68
|
+
$light-surface-border: border-color($light-surface, $is-dark);
|
69
|
+
|
70
|
+
// Base Surface: 50% of $start-color (the midpoint)
|
71
|
+
$surface: color.mix($start-color, $end-color, 50%);
|
72
|
+
$on-surface: contrast-text($surface, $is-dark);
|
73
|
+
$surface-border: border-color($surface, $is-dark);
|
74
|
+
|
75
|
+
// Dark Surface: 35% of $start-color
|
76
|
+
$dark-surface: color.mix($start-color, $end-color, 35%);
|
77
|
+
$on-dark-surface: contrast-text($dark-surface, $is-dark);
|
78
|
+
$dark-surface-border: border-color($dark-surface, $is-dark);
|
79
|
+
|
80
|
+
// Darker Surface: 20% of $start-color
|
81
|
+
$darker-surface: color.mix($start-color, $end-color, 20%);
|
82
|
+
$on-darker-surface: contrast-text($darker-surface, $is-dark);
|
83
|
+
$darker-surface-border: border-color($darker-surface, $is-dark);
|
84
|
+
|
85
|
+
// Darkest Surface (end color)
|
86
|
+
$darkest-surface: $end-color;
|
87
|
+
$on-darkest-surface: contrast-text($darkest-surface, $is-dark);
|
88
|
+
$darkest-surface-border: border-color($darkest-surface, $is-dark);
|
89
|
+
|
90
|
+
@return (
|
91
|
+
ax-sys-color-surface-lightest: $lightest-surface,
|
92
|
+
ax-sys-color-on-surface-lightest: $on-lightest-surface,
|
93
|
+
ax-sys-color-border-surface-lightest: $lightest-surface-border,
|
94
|
+
|
95
|
+
ax-sys-color-surface-lighter: $lighter-surface,
|
96
|
+
ax-sys-color-on-surface-lighter: $on-lighter-surface,
|
97
|
+
ax-sys-color-border-surface-lighter: $lighter-surface-border,
|
98
|
+
|
99
|
+
ax-sys-color-surface-light: $light-surface,
|
100
|
+
ax-sys-color-on-surface-light: $on-light-surface,
|
101
|
+
ax-sys-color-border-surface-light: $light-surface-border,
|
102
|
+
|
103
|
+
ax-sys-color-surface: $surface,
|
104
|
+
ax-sys-color-on-surface: $on-surface,
|
105
|
+
ax-sys-color-border-surface: $surface-border,
|
106
|
+
|
107
|
+
ax-sys-color-surface-dark: $dark-surface,
|
108
|
+
ax-sys-color-on-surface-dark: $on-dark-surface,
|
109
|
+
ax-sys-color-border-surface-dark: $dark-surface-border,
|
110
|
+
|
111
|
+
ax-sys-color-surface-darker: $darker-surface,
|
112
|
+
ax-sys-color-on-surface-darker: $on-darker-surface,
|
113
|
+
ax-sys-color-border-surface-darker: $darker-surface-border,
|
114
|
+
|
115
|
+
ax-sys-color-surface-darkest: $darkest-surface,
|
116
|
+
ax-sys-color-on-surface-darkest: $on-darkest-surface,
|
117
|
+
ax-sys-color-border-surface-darkest: $darkest-surface-border
|
118
|
+
);
|
119
|
+
}
|
120
|
+
|
121
|
+
@function generate-color-surfaces-variables($name, $color, $is-dark: false) {
|
122
|
+
$palette: light-palette-generator($color);
|
123
|
+
@if $is-dark {
|
124
|
+
$palette: dark-palette-generator($color);
|
125
|
+
}
|
126
|
+
|
127
|
+
// Lightest Surface
|
128
|
+
$lightest-surface: oklch-to-rgba(map.get($palette, 100));
|
129
|
+
$on-lightest-surface: contrast-text($lightest-surface, $is-dark);
|
130
|
+
$lightest-surface-border: border-color($lightest-surface, $is-dark);
|
131
|
+
|
132
|
+
// Lighter Surface
|
133
|
+
$lighter-surface: oklch-to-rgba(map.get($palette, 200));
|
134
|
+
$on-lighter-surface: contrast-text($lighter-surface, $is-dark);
|
135
|
+
$lighter-surface-border: border-color($lighter-surface, $is-dark);
|
136
|
+
|
137
|
+
// Light Surface
|
138
|
+
$light-surface: oklch-to-rgba(map.get($palette, 300));
|
139
|
+
$on-light-surface: contrast-text($light-surface, $is-dark);
|
140
|
+
$light-surface-border: border-color($light-surface, $is-dark);
|
141
|
+
|
142
|
+
// Base Surface
|
143
|
+
$surface: oklch-to-rgba(map.get($palette, 500));
|
144
|
+
$on-surface: contrast-text($surface, $is-dark);
|
145
|
+
$surface-border: border-color($surface, $is-dark);
|
146
|
+
|
147
|
+
// Dark Surface
|
148
|
+
$dark-surface: oklch-to-rgba(map.get($palette, 600));
|
149
|
+
$on-dark-surface: contrast-text($dark-surface, $is-dark);
|
150
|
+
$dark-surface-border: border-color($dark-surface, $is-dark);
|
151
|
+
|
152
|
+
// Darker Surface
|
153
|
+
$darker-surface: oklch-to-rgba(map.get($palette, 700));
|
154
|
+
$on-darker-surface: contrast-text($darker-surface, $is-dark);
|
155
|
+
$darker-surface-border: border-color($darker-surface, $is-dark);
|
156
|
+
|
157
|
+
// Darkest Surface
|
158
|
+
$darkest-surface: oklch-to-rgba(map.get($palette, 800));
|
159
|
+
$on-darkest-surface: contrast-text($darkest-surface, $is-dark);
|
160
|
+
$darkest-surface-border: border-color($darkest-surface, $is-dark);
|
161
|
+
|
162
|
+
@return (
|
163
|
+
ax-sys-color-#{$name}-lightest-surface: $lightest-surface,
|
164
|
+
ax-sys-color-on-#{$name}-lightest-surface: $on-lightest-surface,
|
165
|
+
ax-sys-color-border-#{$name}-lightest-surface: $lightest-surface-border,
|
166
|
+
|
167
|
+
ax-sys-color-#{$name}-lighter-surface: $lighter-surface,
|
168
|
+
ax-sys-color-on-#{$name}-lighter-surface: $on-lighter-surface,
|
169
|
+
ax-sys-color-border-#{$name}-lighter-surface: $lighter-surface-border,
|
170
|
+
|
171
|
+
ax-sys-color-#{$name}-light-surface: $light-surface,
|
172
|
+
ax-sys-color-on-#{$name}-light-surface: $on-light-surface,
|
173
|
+
ax-sys-color-border-#{$name}-light-surface: $light-surface-border,
|
174
|
+
|
175
|
+
ax-sys-color-#{$name}-surface: $surface,
|
176
|
+
ax-sys-color-on-#{$name}-surface: $on-surface,
|
177
|
+
ax-sys-color-border-#{$name}-surface: $surface-border,
|
178
|
+
|
179
|
+
ax-sys-color-#{$name}-dark-surface: $dark-surface,
|
180
|
+
ax-sys-color-on-#{$name}-dark-surface: $on-dark-surface,
|
181
|
+
ax-sys-color-border-#{$name}-dark-surface: $dark-surface-border,
|
182
|
+
|
183
|
+
ax-sys-color-#{$name}-darker-surface: $darker-surface,
|
184
|
+
ax-sys-color-on-#{$name}-darker-surface: $on-darker-surface,
|
185
|
+
ax-sys-color-border-#{$name}-darker-surface: $darker-surface-border,
|
186
|
+
|
187
|
+
ax-sys-color-#{$name}-darkest-surface: $darkest-surface,
|
188
|
+
ax-sys-color-on-#{$name}-darkest-surface: $on-darkest-surface,
|
189
|
+
ax-sys-color-border-#{$name}-darkest-surface: $darkest-surface-border
|
190
|
+
);
|
191
|
+
}
|
192
|
+
|
193
|
+
@mixin generate-pallete-variables($colors, $theme-surfaces, $generate-color-range: true) {
|
194
|
+
/************** Light Palette **************/
|
195
|
+
:root,
|
196
|
+
.ax-light {
|
197
|
+
// Generate Base Surfaces
|
198
|
+
@include convert-to-rgb(generate-surfaces-colors-variables($theme-surfaces, false));
|
199
|
+
// Generate Ranges
|
200
|
+
@if $generate-color-range {
|
201
|
+
/* Ranges */
|
202
|
+
@each $name, $color in $colors {
|
203
|
+
@include convert-to-rgb(generate-color-ranges-variables($name, $color, false));
|
204
|
+
}
|
205
|
+
}
|
206
|
+
// Generate Colored Surfaces
|
207
|
+
@each $name, $color in $colors {
|
208
|
+
@include convert-to-rgb(generate-color-surfaces-variables($name, $color, false));
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
/************** Dark Palette **************/
|
213
|
+
.ax-dark {
|
214
|
+
// Generate Base Surfaces
|
215
|
+
@include convert-to-rgb(generate-surfaces-colors-variables($theme-surfaces, true));
|
216
|
+
// Generate Ranges
|
217
|
+
@if $generate-color-range {
|
218
|
+
/* Ranges */
|
219
|
+
@each $name, $color in $colors {
|
220
|
+
@include convert-to-rgb(generate-color-ranges-variables($name, $color, true));
|
221
|
+
}
|
222
|
+
}
|
223
|
+
// Generate Colored Surfaces
|
224
|
+
@each $name, $color in $colors {
|
225
|
+
@include convert-to-rgb(generate-color-surfaces-variables($name, $color, true));
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|