@alauda/ui 10.0.1 → 10.0.2-beta.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/DESIGN.md +470 -0
- package/package.json +1 -1
package/DESIGN.md
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "10.0.1"
|
|
3
|
+
name: "Alauda UI"
|
|
4
|
+
description: "A design specification for dense enterprise console interfaces using Alauda UI tokens and SCSS theme tools."
|
|
5
|
+
metadata:
|
|
6
|
+
package: "@alauda/ui"
|
|
7
|
+
sourceOfTruth:
|
|
8
|
+
themePreset: "src/theme/_theme-preset.scss"
|
|
9
|
+
sassTokens: "src/theme/_base-var.scss"
|
|
10
|
+
sassMixins: "src/theme/_mixin.scss"
|
|
11
|
+
sassPatterns: "src/theme/_pattern.scss"
|
|
12
|
+
globalStyle: "src/theme/style.scss"
|
|
13
|
+
styleLanguage: "SCSS"
|
|
14
|
+
framework: "Angular"
|
|
15
|
+
cssPrefix: "aui"
|
|
16
|
+
colors:
|
|
17
|
+
blue: "rgb(0, 122, 245)"
|
|
18
|
+
blue-0: "rgb(0, 103, 208)"
|
|
19
|
+
blue-1: "rgb(38, 141, 246)"
|
|
20
|
+
blue-2: "rgb(77, 162, 248)"
|
|
21
|
+
blue-3: "rgb(102, 175, 249)"
|
|
22
|
+
blue-4: "rgb(179, 215, 252)"
|
|
23
|
+
blue-5: "rgb(204, 228, 253)"
|
|
24
|
+
blue-6: "rgb(229, 241, 254)"
|
|
25
|
+
blue-7: "rgb(242, 248, 254)"
|
|
26
|
+
primary: "{colors.blue}"
|
|
27
|
+
primary-0: "{colors.blue-0}"
|
|
28
|
+
primary-1: "{colors.blue-1}"
|
|
29
|
+
primary-2: "{colors.blue-2}"
|
|
30
|
+
primary-3: "{colors.blue-3}"
|
|
31
|
+
primary-4: "{colors.blue-4}"
|
|
32
|
+
primary-5: "{colors.blue-5}"
|
|
33
|
+
primary-6: "{colors.blue-6}"
|
|
34
|
+
primary-7: "{colors.blue-7}"
|
|
35
|
+
green: "rgb(0, 194, 97)"
|
|
36
|
+
green-0: "rgb(0, 165, 82)"
|
|
37
|
+
green-1: "rgb(38, 203, 120)"
|
|
38
|
+
green-2: "rgb(76, 212, 144)"
|
|
39
|
+
green-4: "rgb(179, 236, 207)"
|
|
40
|
+
green-6: "rgb(230, 249, 239)"
|
|
41
|
+
green-7: "rgb(242, 251, 246)"
|
|
42
|
+
success: "{colors.green}"
|
|
43
|
+
success-0: "{colors.green-0}"
|
|
44
|
+
success-1: "{colors.green-1}"
|
|
45
|
+
success-2: "{colors.green-2}"
|
|
46
|
+
success-4: "{colors.green-4}"
|
|
47
|
+
success-6: "{colors.green-6}"
|
|
48
|
+
success-7: "{colors.green-7}"
|
|
49
|
+
yellow: "rgb(245, 163, 0)"
|
|
50
|
+
yellow-0: "rgb(220, 146, 0)"
|
|
51
|
+
yellow-1: "rgb(246, 176, 38)"
|
|
52
|
+
yellow-2: "rgb(248, 190, 77)"
|
|
53
|
+
yellow-4: "rgb(252, 227, 179)"
|
|
54
|
+
yellow-6: "rgb(254, 245, 230)"
|
|
55
|
+
yellow-7: "rgb(254, 250, 243)"
|
|
56
|
+
warning: "{colors.yellow}"
|
|
57
|
+
warning-0: "{colors.yellow-0}"
|
|
58
|
+
warning-1: "{colors.yellow-1}"
|
|
59
|
+
warning-2: "{colors.yellow-2}"
|
|
60
|
+
warning-4: "{colors.yellow-4}"
|
|
61
|
+
warning-6: "{colors.yellow-6}"
|
|
62
|
+
warning-7: "{colors.yellow-7}"
|
|
63
|
+
red: "rgb(235, 0, 39)"
|
|
64
|
+
red-0: "rgb(199, 0, 33)"
|
|
65
|
+
red-1: "rgb(237, 38, 71)"
|
|
66
|
+
red-2: "rgb(241, 76, 103)"
|
|
67
|
+
red-4: "rgb(249, 179, 190)"
|
|
68
|
+
red-6: "rgb(253, 230, 233)"
|
|
69
|
+
red-7: "rgb(254, 243, 244)"
|
|
70
|
+
danger: "{colors.red}"
|
|
71
|
+
danger-0: "{colors.red-0}"
|
|
72
|
+
danger-1: "{colors.red-1}"
|
|
73
|
+
danger-2: "{colors.red-2}"
|
|
74
|
+
danger-4: "{colors.red-4}"
|
|
75
|
+
danger-6: "{colors.red-6}"
|
|
76
|
+
danger-7: "{colors.red-7}"
|
|
77
|
+
neutral-1: "rgb(50, 52, 55)"
|
|
78
|
+
neutral-2: "rgb(100, 102, 105)"
|
|
79
|
+
neutral-3: "rgb(124, 126, 129)"
|
|
80
|
+
neutral-4: "rgb(150, 152, 155)"
|
|
81
|
+
neutral-5: "rgb(174, 176, 179)"
|
|
82
|
+
neutral-6: "rgb(200, 202, 205)"
|
|
83
|
+
neutral-7: "rgb(212, 214, 217)"
|
|
84
|
+
neutral-8: "rgb(237, 239, 242)"
|
|
85
|
+
neutral-9: "rgb(247, 249, 252)"
|
|
86
|
+
neutral-10: "rgb(255, 255, 255)"
|
|
87
|
+
text-main: "{colors.neutral-1}"
|
|
88
|
+
text-secondary: "{colors.neutral-2}"
|
|
89
|
+
text-help: "{colors.neutral-4}"
|
|
90
|
+
text-disabled: "{colors.neutral-6}"
|
|
91
|
+
text-placeholder: "{colors.neutral-6}"
|
|
92
|
+
surface-page: "{colors.neutral-9}"
|
|
93
|
+
surface-button: "{colors.neutral-9}"
|
|
94
|
+
surface-raised: "{colors.neutral-10}"
|
|
95
|
+
surface-popper: "{colors.neutral-10}"
|
|
96
|
+
border-default: "{colors.neutral-7}"
|
|
97
|
+
divider: "{colors.neutral-8}"
|
|
98
|
+
shadow-origin: "{colors.neutral-1}"
|
|
99
|
+
white: "rgb(255, 255, 255)"
|
|
100
|
+
dark-blue: "rgb(61, 142, 255)"
|
|
101
|
+
dark-blue-0: "rgb(54, 116, 204)"
|
|
102
|
+
dark-blue-1: "rgb(109, 170, 255)"
|
|
103
|
+
dark-blue-2: "rgb(53, 111, 193)"
|
|
104
|
+
dark-blue-3: "rgb(50, 101, 173)"
|
|
105
|
+
dark-blue-4: "rgb(47, 85, 143)"
|
|
106
|
+
dark-blue-5: "rgb(40, 54, 81)"
|
|
107
|
+
dark-blue-6: "rgb(42, 64, 102)"
|
|
108
|
+
dark-blue-7: "rgb(44, 74, 122)"
|
|
109
|
+
dark-primary: "{colors.dark-blue}"
|
|
110
|
+
dark-green: "rgb(17, 182, 113)"
|
|
111
|
+
dark-green-0: "rgb(21, 146, 97)"
|
|
112
|
+
dark-green-1: "rgb(76, 200, 148)"
|
|
113
|
+
dark-green-2: "rgb(22, 139, 93)"
|
|
114
|
+
dark-green-4: "rgb(27, 103, 78)"
|
|
115
|
+
dark-green-6: "rgb(31, 74, 66)"
|
|
116
|
+
dark-green-7: "rgb(28, 88, 72)"
|
|
117
|
+
dark-success: "{colors.dark-green}"
|
|
118
|
+
dark-success-0: "{colors.dark-green-0}"
|
|
119
|
+
dark-success-1: "{colors.dark-green-1}"
|
|
120
|
+
dark-success-2: "{colors.dark-green-2}"
|
|
121
|
+
dark-success-4: "{colors.dark-green-4}"
|
|
122
|
+
dark-success-6: "{colors.dark-green-6}"
|
|
123
|
+
dark-success-7: "{colors.dark-green-7}"
|
|
124
|
+
dark-yellow: "rgb(237, 172, 44)"
|
|
125
|
+
dark-yellow-0: "rgb(186, 138, 45)"
|
|
126
|
+
dark-yellow-1: "rgb(241, 192, 96)"
|
|
127
|
+
dark-yellow-2: "rgb(176, 132, 45)"
|
|
128
|
+
dark-yellow-4: "rgb(126, 98, 47)"
|
|
129
|
+
dark-yellow-6: "rgb(86, 72, 49)"
|
|
130
|
+
dark-yellow-7: "rgb(105, 85, 48)"
|
|
131
|
+
dark-warning: "{colors.dark-yellow}"
|
|
132
|
+
dark-warning-0: "{colors.dark-yellow-0}"
|
|
133
|
+
dark-warning-1: "{colors.dark-yellow-1}"
|
|
134
|
+
dark-warning-2: "{colors.dark-yellow-2}"
|
|
135
|
+
dark-warning-4: "{colors.dark-yellow-4}"
|
|
136
|
+
dark-warning-6: "{colors.dark-yellow-6}"
|
|
137
|
+
dark-warning-7: "{colors.dark-yellow-7}"
|
|
138
|
+
dark-red: "rgb(226, 50, 79)"
|
|
139
|
+
dark-red-0: "rgb(178, 47, 72)"
|
|
140
|
+
dark-red-1: "rgb(233, 101, 123)"
|
|
141
|
+
dark-red-2: "rgb(168, 46, 70)"
|
|
142
|
+
dark-red-4: "rgb(121, 43, 63)"
|
|
143
|
+
dark-red-6: "rgb(83, 41, 57)"
|
|
144
|
+
dark-red-7: "rgb(101, 42, 60)"
|
|
145
|
+
dark-danger: "{colors.dark-red}"
|
|
146
|
+
dark-danger-0: "{colors.dark-red-0}"
|
|
147
|
+
dark-danger-1: "{colors.dark-red-1}"
|
|
148
|
+
dark-danger-2: "{colors.dark-red-2}"
|
|
149
|
+
dark-danger-4: "{colors.dark-red-4}"
|
|
150
|
+
dark-danger-6: "{colors.dark-red-6}"
|
|
151
|
+
dark-danger-7: "{colors.dark-red-7}"
|
|
152
|
+
dark-neutral-1: "rgb(238, 239, 243)"
|
|
153
|
+
dark-neutral-2: "rgb(200, 201, 205)"
|
|
154
|
+
dark-neutral-3: "rgb(184, 186, 194)"
|
|
155
|
+
dark-neutral-4: "rgb(152, 154, 162)"
|
|
156
|
+
dark-neutral-5: "rgb(144, 147, 159)"
|
|
157
|
+
dark-neutral-6: "rgb(120, 123, 135)"
|
|
158
|
+
dark-neutral-7: "rgb(92, 95, 107)"
|
|
159
|
+
dark-neutral-8: "rgb(67, 70, 82)"
|
|
160
|
+
dark-neutral-9: "rgb(24, 27, 39)"
|
|
161
|
+
dark-neutral-10: "rgb(36, 39, 51)"
|
|
162
|
+
dark-surface-page: "{colors.dark-neutral-9}"
|
|
163
|
+
dark-surface-raised: "{colors.dark-neutral-10}"
|
|
164
|
+
dark-surface-popper: "rgb(56, 59, 71)"
|
|
165
|
+
dark-border-default: "{colors.dark-neutral-7}"
|
|
166
|
+
dark-divider: "{colors.dark-neutral-8}"
|
|
167
|
+
typography:
|
|
168
|
+
body-small:
|
|
169
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif"
|
|
170
|
+
fontSize: "12px"
|
|
171
|
+
fontWeight: "400"
|
|
172
|
+
lineHeight: "16px"
|
|
173
|
+
body-medium:
|
|
174
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif"
|
|
175
|
+
fontSize: "14px"
|
|
176
|
+
fontWeight: "400"
|
|
177
|
+
lineHeight: "20px"
|
|
178
|
+
body-large:
|
|
179
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif"
|
|
180
|
+
fontSize: "16px"
|
|
181
|
+
fontWeight: "400"
|
|
182
|
+
lineHeight: "22px"
|
|
183
|
+
title-small:
|
|
184
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif"
|
|
185
|
+
fontSize: "16px"
|
|
186
|
+
fontWeight: "600"
|
|
187
|
+
lineHeight: "22px"
|
|
188
|
+
title-medium:
|
|
189
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif"
|
|
190
|
+
fontSize: "18px"
|
|
191
|
+
fontWeight: "600"
|
|
192
|
+
lineHeight: "24px"
|
|
193
|
+
title-large:
|
|
194
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif"
|
|
195
|
+
fontSize: "20px"
|
|
196
|
+
fontWeight: "600"
|
|
197
|
+
lineHeight: "28px"
|
|
198
|
+
rounded:
|
|
199
|
+
control: "2px"
|
|
200
|
+
surface: "4px"
|
|
201
|
+
circle: "9999px"
|
|
202
|
+
spacing:
|
|
203
|
+
xxs: "2px"
|
|
204
|
+
xs: "4px"
|
|
205
|
+
sm: "8px"
|
|
206
|
+
md: "12px"
|
|
207
|
+
lg: "16px"
|
|
208
|
+
xl: "20px"
|
|
209
|
+
xxl: "24px"
|
|
210
|
+
xxxl: "32px"
|
|
211
|
+
xxxxl: "40px"
|
|
212
|
+
control-height-mini: "24px"
|
|
213
|
+
control-height-small: "28px"
|
|
214
|
+
control-height-medium: "32px"
|
|
215
|
+
control-height-large: "40px"
|
|
216
|
+
control-padding-xxs: "5px"
|
|
217
|
+
control-padding-xs: "7px"
|
|
218
|
+
control-padding-small: "11px"
|
|
219
|
+
control-padding-medium: "15px"
|
|
220
|
+
control-padding-large: "19px"
|
|
221
|
+
icon-small: "12px"
|
|
222
|
+
icon-medium: "16px"
|
|
223
|
+
icon-large: "16px"
|
|
224
|
+
icon-xlarge: "24px"
|
|
225
|
+
components:
|
|
226
|
+
button-primary:
|
|
227
|
+
backgroundColor: "{colors.primary}"
|
|
228
|
+
textColor: "{colors.white}"
|
|
229
|
+
typography: "{typography.body-medium}"
|
|
230
|
+
rounded: "{rounded.control}"
|
|
231
|
+
height: "{spacing.control-height-medium}"
|
|
232
|
+
padding: "0 15px"
|
|
233
|
+
button-primary-hover:
|
|
234
|
+
backgroundColor: "{colors.primary-1}"
|
|
235
|
+
textColor: "{colors.white}"
|
|
236
|
+
button-primary-active:
|
|
237
|
+
backgroundColor: "{colors.primary-0}"
|
|
238
|
+
textColor: "{colors.white}"
|
|
239
|
+
button-primary-disabled:
|
|
240
|
+
backgroundColor: "{colors.primary-4}"
|
|
241
|
+
textColor: "{colors.white}"
|
|
242
|
+
button-default:
|
|
243
|
+
backgroundColor: "{colors.surface-button}"
|
|
244
|
+
textColor: "{colors.text-main}"
|
|
245
|
+
borderColor: "{colors.border-default}"
|
|
246
|
+
typography: "{typography.body-medium}"
|
|
247
|
+
rounded: "{rounded.control}"
|
|
248
|
+
height: "{spacing.control-height-medium}"
|
|
249
|
+
padding: "0 15px"
|
|
250
|
+
input-default:
|
|
251
|
+
backgroundColor: "{colors.surface-page}"
|
|
252
|
+
textColor: "{colors.text-main}"
|
|
253
|
+
borderColor: "{colors.border-default}"
|
|
254
|
+
typography: "{typography.body-medium}"
|
|
255
|
+
rounded: "{rounded.control}"
|
|
256
|
+
height: "{spacing.control-height-medium}"
|
|
257
|
+
padding: "0 7px"
|
|
258
|
+
input-focus:
|
|
259
|
+
borderColor: "{colors.primary}"
|
|
260
|
+
boxShadow: "0 0 0 2px rgba(var(--aui-color-primary), 0.16)"
|
|
261
|
+
input-error:
|
|
262
|
+
borderColor: "{colors.danger}"
|
|
263
|
+
boxShadow: "0 0 0 2px rgba(var(--aui-color-red), 0.16)"
|
|
264
|
+
text-main:
|
|
265
|
+
textColor: "{colors.text-main}"
|
|
266
|
+
typography: "{typography.body-medium}"
|
|
267
|
+
text-secondary:
|
|
268
|
+
textColor: "{colors.text-secondary}"
|
|
269
|
+
typography: "{typography.body-medium}"
|
|
270
|
+
surface-page:
|
|
271
|
+
backgroundColor: "{colors.surface-page}"
|
|
272
|
+
surface-raised:
|
|
273
|
+
backgroundColor: "{colors.surface-raised}"
|
|
274
|
+
rounded: "{rounded.surface}"
|
|
275
|
+
surface-popper:
|
|
276
|
+
backgroundColor: "{colors.surface-popper}"
|
|
277
|
+
rounded: "{rounded.control}"
|
|
278
|
+
boxShadow: "0 2px 8px 0 rgba(var(--aui-color-origin-shadow), 0.2)"
|
|
279
|
+
surface-modal:
|
|
280
|
+
backgroundColor: "{colors.surface-popper}"
|
|
281
|
+
rounded: "{rounded.control}"
|
|
282
|
+
boxShadow: "0 2px 8px 0 rgba(var(--aui-color-origin-shadow), 0.2)"
|
|
283
|
+
status-success:
|
|
284
|
+
textColor: "{colors.success}"
|
|
285
|
+
backgroundColor: "{colors.success-6}"
|
|
286
|
+
status-warning:
|
|
287
|
+
textColor: "{colors.warning}"
|
|
288
|
+
backgroundColor: "{colors.warning-6}"
|
|
289
|
+
status-danger:
|
|
290
|
+
textColor: "{colors.danger}"
|
|
291
|
+
backgroundColor: "{colors.danger-6}"
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
# Alauda UI Design System
|
|
295
|
+
|
|
296
|
+
This document defines the design system behind Alauda UI. It is written for coding agents that need to produce styles matching Alauda's product design language. Follow the Google `design.md` structure first; Alauda-specific SCSS guidance is included only where it helps implement the spec correctly.
|
|
297
|
+
|
|
298
|
+
## Overview
|
|
299
|
+
|
|
300
|
+
Alauda UI is a dense enterprise console design system. Its screens are used for operational workflows: data comparison, status monitoring, resource management, form entry, and fast corrective actions. The visual tone is calm, precise, and utilitarian.
|
|
301
|
+
|
|
302
|
+
The system optimizes for clarity, density, and consistency. It should not look like a marketing site, portfolio, or editorial page. Avoid large decorative hero sections, gradient-heavy backgrounds, oversized ornamental type, arbitrary accent colors, and card grids that do not serve a workflow.
|
|
303
|
+
|
|
304
|
+
When creating interface styles, start with the product task: what state must be scanned, what action must be taken, and what feedback must be visible. Use the tokens in this file to express hierarchy, density, state, and surface relationships.
|
|
305
|
+
|
|
306
|
+
## Colors
|
|
307
|
+
|
|
308
|
+
Use colors semantically. Do not choose a token because the raw color looks close; choose it because it expresses the intended role.
|
|
309
|
+
|
|
310
|
+
Primary blue is for interaction and brand emphasis: primary actions, active indicators, selected states, focus affordances, and links. Stronger or weaker primary steps are used only for interaction states such as hover, active, selected backgrounds, and disabled primary controls.
|
|
311
|
+
|
|
312
|
+
Status colors communicate system state:
|
|
313
|
+
|
|
314
|
+
- Success uses `success` and its steps.
|
|
315
|
+
- Warning uses `warning` and its steps.
|
|
316
|
+
- Error, danger, destructive actions, and failed states use `danger` and its steps.
|
|
317
|
+
- Informational active state can use `primary` when the component has no separate info palette.
|
|
318
|
+
|
|
319
|
+
Neutral colors define information hierarchy:
|
|
320
|
+
|
|
321
|
+
- `text-main`, `text-secondary`, `text-help`, `text-disabled`, and `text-placeholder` are preferred for text roles.
|
|
322
|
+
- `surface-page`, `surface-button`, `surface-raised`, and `surface-popper` define background roles.
|
|
323
|
+
- `border-default` and `divider` separate information without heavy visual weight.
|
|
324
|
+
- `shadow-origin` is an input to shadow formulas, not a visible text or icon color.
|
|
325
|
+
|
|
326
|
+
Alauda CSS color variables store RGB triplets, not complete CSS colors. In SCSS, prefer theme helpers. In raw CSS, wrap the variable.
|
|
327
|
+
|
|
328
|
+
```scss
|
|
329
|
+
@use '@alauda/ui/theme/var' as var;
|
|
330
|
+
|
|
331
|
+
.summary {
|
|
332
|
+
color: var.use-text-color(main);
|
|
333
|
+
background-color: var.use-rgb(n-10);
|
|
334
|
+
border: 1px solid var.use-rgb(border);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.raw-css-example {
|
|
338
|
+
color: rgb(var(--aui-color-main-text));
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Never write `color: var(--aui-color-primary)`. Never introduce missing palette steps.
|
|
343
|
+
|
|
344
|
+
## Typography
|
|
345
|
+
|
|
346
|
+
Alauda UI typography is compact and task-oriented. `body-medium` is the default product text style: 14px text on a 20px line. Use larger type only for real hierarchy, such as page titles, section titles, or tab headers.
|
|
347
|
+
|
|
348
|
+
Use the SCSS text mixin when writing custom styles. It keeps font size, line height, weight, and text color aligned with the design tokens.
|
|
349
|
+
|
|
350
|
+
```scss
|
|
351
|
+
@use '@alauda/ui/theme/mixin' as mixin;
|
|
352
|
+
|
|
353
|
+
.section-title {
|
|
354
|
+
@include mixin.text-set(l, main, bolder);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.help-text {
|
|
358
|
+
@include mixin.text-set(s, help);
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Do not scale font sizes with viewport width. Do not use display-scale typography inside compact panels, table cells, form rows, or operational toolbars.
|
|
363
|
+
|
|
364
|
+
## Layout
|
|
365
|
+
|
|
366
|
+
Layout should support scanning and repeated action. A typical enterprise console screen contains a title or context header, a toolbar or filter area, a primary data/form surface, and contextual feedback. Surfaces should be quiet; the data and state should carry the page.
|
|
367
|
+
|
|
368
|
+
Use spacing tokens to create rhythm. The base working gap is 8px. Use 12px and 16px for section spacing, 20px and above for larger separation. Avoid arbitrary values such as 6px, 10px, 14px, 18px, or 30px unless an existing component requires them.
|
|
369
|
+
|
|
370
|
+
Control density follows a fixed height scale:
|
|
371
|
+
|
|
372
|
+
- Mini: 24px for compact embedded controls.
|
|
373
|
+
- Small: 28px for dense toolbars and table-adjacent controls.
|
|
374
|
+
- Medium: 32px for normal working density.
|
|
375
|
+
- Large: 40px for intentionally spacious forms.
|
|
376
|
+
|
|
377
|
+
Use page and raised surfaces semantically. `surface-page` is the default background. `surface-raised` is for framed content. Borders and dividers should be subtle and structural, not decorative.
|
|
378
|
+
|
|
379
|
+
## Elevation & Depth
|
|
380
|
+
|
|
381
|
+
Elevation represents hierarchy, overlay position, or focus. It is not decoration. Use the existing shadow mixins and pattern mixins rather than custom shadow formulas.
|
|
382
|
+
|
|
383
|
+
```scss
|
|
384
|
+
@use '@alauda/ui/theme/var' as var;
|
|
385
|
+
@use '@alauda/ui/theme/mixin' as mixin;
|
|
386
|
+
@use '@alauda/ui/theme/pattern' as pattern;
|
|
387
|
+
|
|
388
|
+
.raised-surface {
|
|
389
|
+
@include pattern.shadow-2;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.floating-panel {
|
|
393
|
+
background-color: var.use-rgb(popper-bg);
|
|
394
|
+
@include mixin.popper-shadow;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.modal-panel {
|
|
398
|
+
@include mixin.modal-shadow;
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Focus rings are part of depth. Use `outline-shadow(...)`; it adapts opacity for light and dark themes.
|
|
403
|
+
|
|
404
|
+
```scss
|
|
405
|
+
@use '@alauda/ui/theme/mixin' as mixin;
|
|
406
|
+
|
|
407
|
+
.custom-control.isFocused {
|
|
408
|
+
@include mixin.outline-shadow(primary);
|
|
409
|
+
}
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Do not use large blurred shadows, glow effects, or colored decorative shadows.
|
|
413
|
+
|
|
414
|
+
## Shapes
|
|
415
|
+
|
|
416
|
+
Shapes are restrained. Most controls use the small 2px radius. Larger framed surfaces use 4px. Circular controls and pills should derive from the component height or use a full radius.
|
|
417
|
+
|
|
418
|
+
Use shape to clarify affordance, not to decorate. Do not introduce large rounded cards or soft pill containers unless the existing component pattern requires them.
|
|
419
|
+
|
|
420
|
+
## Components
|
|
421
|
+
|
|
422
|
+
Component tokens in the front matter describe style roles, not an exhaustive API catalog. Use them as examples of how primitives compose into controls, input states, text roles, surfaces, and status feedback.
|
|
423
|
+
|
|
424
|
+
For SCSS, use Alauda's theme tools:
|
|
425
|
+
|
|
426
|
+
```scss
|
|
427
|
+
@use '@alauda/ui/theme/var' as var;
|
|
428
|
+
@use '@alauda/ui/theme/mixin' as mixin;
|
|
429
|
+
@use '@alauda/ui/theme/pattern' as pattern;
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Core helpers:
|
|
433
|
+
|
|
434
|
+
- `var.use-var(name)` returns `var(--aui-<name>)`.
|
|
435
|
+
- `var.use-rgb(name)` returns `rgb(var(--aui-color-<name>))`.
|
|
436
|
+
- `var.use-rgb(name, level)` returns a palette step, for example `var.use-rgb(primary, 6)`.
|
|
437
|
+
- `var.use-rgba(name, opacity)` returns `rgba(var(--aui-color-<name>), <opacity>)`.
|
|
438
|
+
- `var.use-text-color(level)` returns semantic text roles such as `main`, `secondary`, `help`, `disabled`, or `placeholder`.
|
|
439
|
+
- `mixin.text-set(size, color, weight)` applies compact typography.
|
|
440
|
+
- `mixin.icon-set(size, color)` aligns icons to text rhythm.
|
|
441
|
+
- `mixin.theme-light` and `mixin.theme-dark` scope theme-aware overrides.
|
|
442
|
+
- `mixin.card-shadow`, `mixin.popper-shadow`, `mixin.modal-shadow`, and `mixin.modal-backdrop` encode surface depth.
|
|
443
|
+
- `mixin.transition(target)` and `mixin.scroll-bar` keep motion and scrollbars consistent.
|
|
444
|
+
- `pattern.shadow-0`, `pattern.shadow-2`, `pattern.shadow-8`, and `pattern.shadow-16` define raised surfaces.
|
|
445
|
+
|
|
446
|
+
Angular style-related inputs should map to design semantics. `size` usually means `large`, `medium`, `small`, or `mini`; use `medium` as the default product density. Inputs such as `type`, `status`, `plain`, `solid`, `disabled`, `readonly`, `loading`, `checked`, and `active` should express action hierarchy, feedback state, density, or interaction state. Prefer the style input over custom overrides when it exists.
|
|
447
|
+
|
|
448
|
+
Custom SCSS should compose layout around components or implement product-specific surfaces while still using these tokens and helpers.
|
|
449
|
+
|
|
450
|
+
## Do's and Don'ts
|
|
451
|
+
|
|
452
|
+
Do:
|
|
453
|
+
|
|
454
|
+
- Use the canonical token groups in this file when choosing color, type, spacing, radius, and component roles.
|
|
455
|
+
- Treat color as semantic state and hierarchy.
|
|
456
|
+
- Keep pages data-first, compact, and task-oriented.
|
|
457
|
+
- Use `@use '@alauda/ui/theme/var' as var`, `mixin`, and `pattern` for custom SCSS.
|
|
458
|
+
- Use `rgb(...)`/`rgba(...)` wrappers or Sass helpers for `--aui-color-*` variables.
|
|
459
|
+
- Use theme scopes instead of hard-coded dark-mode colors.
|
|
460
|
+
- Keep hover, active, focus, disabled, error, and loading states visible and dimensionally stable.
|
|
461
|
+
|
|
462
|
+
Don't:
|
|
463
|
+
|
|
464
|
+
- Do not simplify this document by removing Google-required token groups or canonical sections.
|
|
465
|
+
- Do not use raw hex colors for themeable UI.
|
|
466
|
+
- Do not use `var(--aui-color-*)` as a complete CSS color.
|
|
467
|
+
- Do not invent palette steps or unrelated accent colors.
|
|
468
|
+
- Do not inflate spacing or typography for decorative effect.
|
|
469
|
+
- Do not create one-off shadows, focus rings, scrollbars, or dark-mode overrides when theme mixins exist.
|
|
470
|
+
- Do not compensate for the wrong Angular style input with raw CSS overrides.
|