app-studio 0.7.2 → 0.7.5
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/README.md +35 -35
- package/dist/app-studio.cjs.development.js +144 -165
- package/dist/app-studio.cjs.development.js.map +1 -1
- package/dist/app-studio.cjs.production.min.js +1 -1
- package/dist/app-studio.esm.js +144 -165
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/app-studio.umd.development.js +144 -165
- package/dist/app-studio.umd.development.js.map +1 -1
- package/dist/app-studio.umd.production.min.js +1 -1
- package/dist/stories/ScrollAnimation.stories.d.ts +1 -1
- package/docs/Animation.md +3 -3
- package/docs/Components.md +8 -8
- package/docs/Design.md +2 -2
- package/docs/Events.md +30 -30
- package/docs/Hooks.md +6 -6
- package/docs/README.md +31 -31
- package/docs/Responsive.md +3 -3
- package/docs/Theming.md +183 -150
- package/package.json +1 -1
package/docs/Theming.md
CHANGED
|
@@ -7,14 +7,14 @@ Theming is an essential part of any application. It allows you to maintain a con
|
|
|
7
7
|
App-Studio provides an extensive color system with three types of colors:
|
|
8
8
|
|
|
9
9
|
### 1. Singleton Colors (Basic Colors)
|
|
10
|
-
These are simple named colors accessible via `color
|
|
10
|
+
These are simple named colors accessible via `color-{name}`:
|
|
11
11
|
|
|
12
12
|
- **Basic Colors**: `white`, `black`, `red`, `green`, `blue`, `yellow`, `cyan`, `magenta`, `grey`, `orange`, `brown`, `purple`, `pink`, `lime`, `teal`, `navy`, `olive`, `maroon`, `gold`, `silver`, `indigo`, `violet`, `beige`, `turquoise`, `coral`, `chocolate`, `skyBlue`, `plum`, `darkGreen`, `salmon`
|
|
13
13
|
|
|
14
|
-
**Usage**: `color
|
|
14
|
+
**Usage**: `color-white`, `color-gold`, `color-turquoise`
|
|
15
15
|
|
|
16
16
|
### 2. Color Palettes (Shaded Colors)
|
|
17
|
-
Each palette has 9 shades (50, 100, 200, 300, 400, 500, 600, 700, 800, 900) accessible via `color
|
|
17
|
+
Each palette has 9 shades (50, 100, 200, 300, 400, 500, 600, 700, 800, 900) accessible via `color-{palette}-{shade}`:
|
|
18
18
|
|
|
19
19
|
**Available Palettes**:
|
|
20
20
|
- **Alpha Channels**: `whiteAlpha`, `blackAlpha` - RGBA colors with varying opacity
|
|
@@ -25,56 +25,84 @@ Each palette has 9 shades (50, 100, 200, 300, 400, 500, 600, 700, 800, 900) acce
|
|
|
25
25
|
- **Greens**: `teal`, `emerald`, `green`, `lime`
|
|
26
26
|
- **Yellows & Oranges**: `yellow`, `amber`, `orange`
|
|
27
27
|
|
|
28
|
-
**Usage**: `color
|
|
28
|
+
**Usage**: `color-blue-500`, `color-rose-200`, `color-gray-800`
|
|
29
29
|
|
|
30
30
|
### 3. Theme Colors
|
|
31
|
-
Custom theme colors defined in your theme configuration, accessible via `theme
|
|
31
|
+
Custom theme colors defined in your theme configuration, accessible via `theme-{path}`:
|
|
32
32
|
|
|
33
33
|
**Default Theme Colors**:
|
|
34
|
-
- `theme
|
|
35
|
-
- `theme
|
|
36
|
-
- `theme
|
|
37
|
-
- `theme
|
|
38
|
-
- `theme
|
|
39
|
-
- `theme
|
|
40
|
-
- `theme
|
|
34
|
+
- `theme-primary` - Main brand color (default: black)
|
|
35
|
+
- `theme-secondary` - Secondary brand color (default: blue)
|
|
36
|
+
- `theme-success` - Success state color (default: green.500)
|
|
37
|
+
- `theme-error` - Error state color (default: red.500)
|
|
38
|
+
- `theme-warning` - Warning state color (default: orange.500)
|
|
39
|
+
- `theme-disabled` - Disabled state color (default: gray.500)
|
|
40
|
+
- `theme-loading` - Loading state color (default: dark-500)
|
|
41
41
|
|
|
42
|
-
You can extend these with custom theme paths like `theme
|
|
42
|
+
You can extend these with custom theme paths like `theme-button-background` or `theme-header-text`.
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
Access light or dark mode colors directly, regardless of current theme:
|
|
44
|
+
**Theme Colors with Alpha Transparency**:
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
- **Dark Mode**: `dark.{colorName}` or `dark.{palette}.{shade}`
|
|
46
|
+
You can add alpha transparency to any theme color by appending a numeric value (0-1000):
|
|
49
47
|
|
|
50
|
-
**
|
|
48
|
+
**Syntax**: `theme-{key}-{alpha}`
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
**Examples**:
|
|
51
|
+
- `theme-primary-100` → Primary color with 10% opacity
|
|
52
|
+
- `theme-primary-500` → Primary color with 50% opacity
|
|
53
|
+
- `theme-secondary-200` → Secondary color with 20% opacity
|
|
54
|
+
- `theme-error-300` → Error color with 30% opacity
|
|
55
|
+
|
|
56
|
+
This is especially useful for creating subtle backgrounds, overlays, or hover states using your theme colors:
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
<View backgroundColor="theme-primary-100" padding={20}>
|
|
60
|
+
<Text color="theme-primary">Subtle primary background</Text>
|
|
61
|
+
</View>
|
|
62
|
+
|
|
63
|
+
<Button
|
|
64
|
+
backgroundColor="theme-secondary"
|
|
65
|
+
>
|
|
66
|
+
Hover me
|
|
67
|
+
</Button>
|
|
53
68
|
```
|
|
54
|
-
color.* → Direct color access (current theme mode)
|
|
55
|
-
├─ color.white → Singleton colors
|
|
56
|
-
└─ color.blue.500 → Palette colors with shades
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
### 4. Mode-Specific Colors
|
|
71
|
+
Access light or dark mode colors directly, regardless of current theme:
|
|
72
|
+
|
|
73
|
+
- **Light Mode**: `light-{colorName}` or `light-{palette}-{shade}`
|
|
74
|
+
- **Dark Mode**: `dark-{colorName}` or `dark-{palette}-{shade}`
|
|
61
75
|
|
|
62
|
-
light
|
|
63
|
-
├─ light.white
|
|
64
|
-
└─ light.blue.500
|
|
76
|
+
**Usage**: `light-white`, `dark-blue-500`, `light-gray-100`
|
|
65
77
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
### Color System Hierarchy
|
|
79
|
+
```
|
|
80
|
+
color-* → Direct color access (current theme mode)
|
|
81
|
+
├─ color-white → Singleton colors
|
|
82
|
+
├─ color-blue-500 → Palette colors with shades
|
|
83
|
+
└─ color-blue-500-200 → Palette colors with alpha (20% opacity)
|
|
84
|
+
|
|
85
|
+
theme-* → Custom theme configuration
|
|
86
|
+
├─ theme-primary → Theme color
|
|
87
|
+
├─ theme-primary-100 → Theme color with alpha (10% opacity)
|
|
88
|
+
└─ theme-button-background → Nested theme path
|
|
89
|
+
|
|
90
|
+
light-* → Always use light mode colors
|
|
91
|
+
├─ light-white
|
|
92
|
+
└─ light-blue-500
|
|
93
|
+
|
|
94
|
+
dark-* → Always use dark mode colors
|
|
95
|
+
├─ dark-white
|
|
96
|
+
└─ dark-red-200
|
|
69
97
|
```
|
|
70
98
|
|
|
71
99
|
### 5. Alpha Transparency (4th Parameter)
|
|
72
100
|
|
|
73
101
|
Add dynamic transparency to any palette color using a 4th parameter. The alpha value ranges from 0-1000, which maps to CSS opacity percentages (0%-100%).
|
|
74
102
|
|
|
75
|
-
**Syntax**: `color
|
|
103
|
+
**Syntax**: `color-{palette}-{shade}-{alpha}`
|
|
76
104
|
|
|
77
|
-
**Alpha Value Range**:
|
|
105
|
+
**Alpha Value Range**:
|
|
78
106
|
- `0` = fully transparent (0% opacity)
|
|
79
107
|
- `500` = semi-transparent (50% opacity)
|
|
80
108
|
- `1000` = fully opaque (100% opacity)
|
|
@@ -86,9 +114,9 @@ Instead of computing RGBA values in JavaScript, App-Studio uses the modern CSS `
|
|
|
86
114
|
- **Standards-based**: Uses native CSS color functions
|
|
87
115
|
|
|
88
116
|
**Examples**:
|
|
89
|
-
- `color
|
|
90
|
-
- `color
|
|
91
|
-
- `color
|
|
117
|
+
- `color-black-900-200` → `color-mix(in srgb, var(--color-black-900) 20%, transparent)` - Black with 20% opacity
|
|
118
|
+
- `color-blue-500-500` → `color-mix(in srgb, var(--color-blue-500) 50%, transparent)` - Blue-500 with 50% opacity
|
|
119
|
+
- `color-red-600-800` → `color-mix(in srgb, var(--color-red-600) 80%, transparent)` - Red-600 with 80% opacity
|
|
92
120
|
|
|
93
121
|
**Use Cases**:
|
|
94
122
|
- Create semi-transparent overlays without defining new alpha color palettes
|
|
@@ -98,13 +126,13 @@ Instead of computing RGBA values in JavaScript, App-Studio uses the modern CSS `
|
|
|
98
126
|
|
|
99
127
|
```javascript
|
|
100
128
|
// Semi-transparent overlay
|
|
101
|
-
<View backgroundColor="color
|
|
102
|
-
<Text color="color
|
|
129
|
+
<View backgroundColor="color-black-900-300" padding={20}>
|
|
130
|
+
<Text color="color-white">30% opacity black overlay</Text>
|
|
103
131
|
</View>
|
|
104
132
|
|
|
105
133
|
// Glassmorphism card
|
|
106
|
-
<View
|
|
107
|
-
backgroundColor="color
|
|
134
|
+
<View
|
|
135
|
+
backgroundColor="color-gray-100-200"
|
|
108
136
|
backdropFilter="blur(10px)"
|
|
109
137
|
padding={20}
|
|
110
138
|
>
|
|
@@ -112,8 +140,8 @@ Instead of computing RGBA values in JavaScript, App-Studio uses the modern CSS `
|
|
|
112
140
|
</View>
|
|
113
141
|
|
|
114
142
|
// Gradient with alpha colors (CSS variables!)
|
|
115
|
-
<View
|
|
116
|
-
background="linear-gradient(135deg, color
|
|
143
|
+
<View
|
|
144
|
+
background="linear-gradient(135deg, color-red-500-200 0%, color-blue-500-1000 100%)"
|
|
117
145
|
padding={20}
|
|
118
146
|
>
|
|
119
147
|
<Text>Gradient with variable-based alpha colors</Text>
|
|
@@ -238,10 +266,10 @@ Now that the theme is available, you can use it in your components. All color re
|
|
|
238
266
|
App-Studio supports multiple ways to reference colors:
|
|
239
267
|
|
|
240
268
|
1. **Direct Color Values**: `"#fff"`, `"rgb(255,0,0)"`, `"transparent"`
|
|
241
|
-
2. **Singleton Colors**: `"color
|
|
242
|
-
3. **Palette Colors**: `"color
|
|
243
|
-
4. **Theme Colors**: `"theme
|
|
244
|
-
5. **Mode-Specific Colors**: `"light
|
|
269
|
+
2. **Singleton Colors**: `"color-white"`, `"color-gold"`, `"color-turquoise"`
|
|
270
|
+
3. **Palette Colors**: `"color-blue-500"`, `"color-rose-200"`, `"color-gray-800"`
|
|
271
|
+
4. **Theme Colors**: `"theme-primary"`, `"theme-button-background"`
|
|
272
|
+
5. **Mode-Specific Colors**: `"light-white"`, `"dark-blue-500"`
|
|
245
273
|
|
|
246
274
|
### Examples
|
|
247
275
|
|
|
@@ -251,23 +279,23 @@ import { Button } from '@app-studio/web';
|
|
|
251
279
|
|
|
252
280
|
function Example() {
|
|
253
281
|
return (
|
|
254
|
-
<View backgroundColor="color
|
|
282
|
+
<View backgroundColor="color-blue">
|
|
255
283
|
{/* Using palette colors with shades */}
|
|
256
|
-
<View backgroundColor="color
|
|
257
|
-
<Text color="theme
|
|
284
|
+
<View backgroundColor="color-blueGray-500">
|
|
285
|
+
<Text color="theme-primary">Hello</Text>
|
|
258
286
|
</View>
|
|
259
287
|
|
|
260
288
|
{/* Using theme colors */}
|
|
261
|
-
<Button backgroundColor="theme
|
|
289
|
+
<Button backgroundColor="theme-button-background">Hello</Button>
|
|
262
290
|
|
|
263
291
|
{/* Using singleton colors */}
|
|
264
|
-
<View backgroundColor="color
|
|
265
|
-
<Text color="color
|
|
292
|
+
<View backgroundColor="color-turquoise" padding={10}>
|
|
293
|
+
<Text color="color-white">Turquoise Background</Text>
|
|
266
294
|
</View>
|
|
267
295
|
|
|
268
296
|
{/* Using alpha colors for transparency */}
|
|
269
|
-
<View backgroundColor="color
|
|
270
|
-
<Text color="color
|
|
297
|
+
<View backgroundColor="color-blackAlpha-500">
|
|
298
|
+
<Text color="color-whiteAlpha-900">Semi-transparent</Text>
|
|
271
299
|
</View>
|
|
272
300
|
</View>
|
|
273
301
|
);
|
|
@@ -279,54 +307,54 @@ function Example() {
|
|
|
279
307
|
Each palette below has shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900
|
|
280
308
|
|
|
281
309
|
**Alpha Transparency**:
|
|
282
|
-
- `color
|
|
283
|
-
- `color
|
|
310
|
+
- `color-whiteAlpha-{shade}` - White with alpha (rgba)
|
|
311
|
+
- `color-blackAlpha-{shade}` - Black with alpha (rgba)
|
|
284
312
|
|
|
285
313
|
**Neutral Colors**:
|
|
286
|
-
- `color
|
|
287
|
-
- `color
|
|
288
|
-
- `color
|
|
289
|
-
- `color
|
|
290
|
-
- `color
|
|
291
|
-
- `color
|
|
292
|
-
- `color
|
|
293
|
-
- `color
|
|
294
|
-
- `color
|
|
295
|
-
- `color
|
|
296
|
-
- `color
|
|
297
|
-
- `color
|
|
298
|
-
- `color
|
|
314
|
+
- `color-white-{shade}` - White to light gray scale
|
|
315
|
+
- `color-black-{shade}` - Black to dark gray scale
|
|
316
|
+
- `color-gray-{shade}` - True gray scale
|
|
317
|
+
- `color-slate-{shade}` - Cool gray with blue undertones
|
|
318
|
+
- `color-zinc-{shade}` - Neutral gray scale
|
|
319
|
+
- `color-neutral-{shade}` - True neutral gray
|
|
320
|
+
- `color-stone-{shade}` - Warm gray with brown undertones
|
|
321
|
+
- `color-dark-{shade}` - Dark neutral scale
|
|
322
|
+
- `color-light-{shade}` - Light neutral scale
|
|
323
|
+
- `color-warmGray-{shade}` - Warm gray tones
|
|
324
|
+
- `color-trueGray-{shade}` - True neutral gray (legacy)
|
|
325
|
+
- `color-coolGray-{shade}` - Cool gray tones
|
|
326
|
+
- `color-blueGray-{shade}` - Blue-tinted gray
|
|
299
327
|
|
|
300
328
|
**Red & Pink Family**:
|
|
301
|
-
- `color
|
|
302
|
-
- `color
|
|
303
|
-
- `color
|
|
329
|
+
- `color-rose-{shade}` - Rose pink tones
|
|
330
|
+
- `color-pink-{shade}` - Pink tones
|
|
331
|
+
- `color-red-{shade}` - Red tones
|
|
304
332
|
|
|
305
333
|
**Purple Family**:
|
|
306
|
-
- `color
|
|
307
|
-
- `color
|
|
308
|
-
- `color
|
|
334
|
+
- `color-fuchsia-{shade}` - Bright purple-pink
|
|
335
|
+
- `color-purple-{shade}` - Purple tones
|
|
336
|
+
- `color-violet-{shade}` - Violet tones
|
|
309
337
|
|
|
310
338
|
**Blue Family**:
|
|
311
|
-
- `color
|
|
312
|
-
- `color
|
|
313
|
-
- `color
|
|
314
|
-
- `color
|
|
339
|
+
- `color-indigo-{shade}` - Deep blue-purple
|
|
340
|
+
- `color-blue-{shade}` - Blue tones
|
|
341
|
+
- `color-lightBlue-{shade}` - Light blue tones
|
|
342
|
+
- `color-cyan-{shade}` - Cyan tones
|
|
315
343
|
|
|
316
344
|
**Green Family**:
|
|
317
|
-
- `color
|
|
318
|
-
- `color
|
|
319
|
-
- `color
|
|
320
|
-
- `color
|
|
345
|
+
- `color-teal-{shade}` - Teal (blue-green)
|
|
346
|
+
- `color-emerald-{shade}` - Emerald green
|
|
347
|
+
- `color-green-{shade}` - Green tones
|
|
348
|
+
- `color-lime-{shade}` - Lime green
|
|
321
349
|
|
|
322
350
|
**Yellow & Orange Family**:
|
|
323
|
-
- `color
|
|
324
|
-
- `color
|
|
325
|
-
- `color
|
|
351
|
+
- `color-yellow-{shade}` - Yellow tones
|
|
352
|
+
- `color-amber-{shade}` - Amber (orange-yellow)
|
|
353
|
+
- `color-orange-{shade}` - Orange tones
|
|
326
354
|
|
|
327
355
|
### Accessing Specific Theme Mode Colors
|
|
328
356
|
|
|
329
|
-
You can directly access colors from a specific theme mode regardless of the current theme mode using the `light
|
|
357
|
+
You can directly access colors from a specific theme mode regardless of the current theme mode using the `light-` or `dark-` prefix:
|
|
330
358
|
|
|
331
359
|
```javascript
|
|
332
360
|
import { View, Text } from 'app-studio';
|
|
@@ -335,11 +363,11 @@ function Example() {
|
|
|
335
363
|
return (
|
|
336
364
|
<View>
|
|
337
365
|
{/* Always use light mode white color regardless of current theme mode */}
|
|
338
|
-
<Text color="light
|
|
366
|
+
<Text color="light-white">Always light mode white</Text>
|
|
339
367
|
|
|
340
|
-
{/* Always use dark mode red
|
|
341
|
-
<View backgroundColor="dark
|
|
342
|
-
<Text>Always dark mode red
|
|
368
|
+
{/* Always use dark mode red-200 color regardless of current theme mode */}
|
|
369
|
+
<View backgroundColor="dark-red-200">
|
|
370
|
+
<Text>Always dark mode red-200 background</Text>
|
|
343
371
|
</View>
|
|
344
372
|
</View>
|
|
345
373
|
);
|
|
@@ -350,7 +378,7 @@ This is useful when you need to access a specific theme mode's color regardless
|
|
|
350
378
|
|
|
351
379
|
### Direct Theme Color Access
|
|
352
380
|
|
|
353
|
-
App-Studio allows you to directly call theme colors using
|
|
381
|
+
App-Studio allows you to directly call theme colors using dash notation format. This makes your code more readable and maintainable:
|
|
354
382
|
|
|
355
383
|
```javascript
|
|
356
384
|
import { View, Text } from 'app-studio';
|
|
@@ -359,21 +387,21 @@ function Example() {
|
|
|
359
387
|
return (
|
|
360
388
|
<View>
|
|
361
389
|
{/* Access light theme colors directly */}
|
|
362
|
-
<Text color="light
|
|
363
|
-
<View backgroundColor="light
|
|
390
|
+
<Text color="light-white">White text in light mode</Text>
|
|
391
|
+
<View backgroundColor="light-blue-500">
|
|
364
392
|
<Text>Light blue background</Text>
|
|
365
393
|
</View>
|
|
366
394
|
|
|
367
395
|
{/* Access dark theme colors directly */}
|
|
368
|
-
<Text color="dark
|
|
369
|
-
<View backgroundColor="dark
|
|
396
|
+
<Text color="dark-white">White text in dark mode</Text>
|
|
397
|
+
<View backgroundColor="dark-red-200">
|
|
370
398
|
<Text>Dark red background</Text>
|
|
371
399
|
</View>
|
|
372
400
|
|
|
373
401
|
{/* Mix and match in the same component */}
|
|
374
402
|
<View
|
|
375
|
-
backgroundColor="light
|
|
376
|
-
borderColor="dark
|
|
403
|
+
backgroundColor="light-gray-100"
|
|
404
|
+
borderColor="dark-gray-800"
|
|
377
405
|
borderWidth={1}
|
|
378
406
|
>
|
|
379
407
|
<Text>Mixed theme colors</Text>
|
|
@@ -383,7 +411,7 @@ function Example() {
|
|
|
383
411
|
}
|
|
384
412
|
```
|
|
385
413
|
|
|
386
|
-
This direct access syntax works with all color-related properties and can be used with both singleton colors (like `white`, `black`) and palette colors (like `red
|
|
414
|
+
This direct access syntax works with all color-related properties and can be used with both singleton colors (like `white`, `black`) and palette colors (like `red-200`, `blue-500`). It provides a convenient way to reference specific theme colors without having to use the `getColor` function from the `useTheme` hook.
|
|
387
415
|
|
|
388
416
|
### Smart Text Contrast
|
|
389
417
|
|
|
@@ -449,19 +477,19 @@ import { ThemeProvider, View, Text, Button } from 'app-studio';
|
|
|
449
477
|
// Custom theme configuration
|
|
450
478
|
const theme = {
|
|
451
479
|
main: {
|
|
452
|
-
primary: 'color
|
|
453
|
-
secondary: 'color
|
|
454
|
-
accent: 'color
|
|
480
|
+
primary: 'color-blue-600', // References a palette color
|
|
481
|
+
secondary: 'color-purple-500',
|
|
482
|
+
accent: 'color-orange-400'
|
|
455
483
|
},
|
|
456
484
|
components: {
|
|
457
485
|
button: {
|
|
458
|
-
background: 'color
|
|
459
|
-
text: 'color
|
|
460
|
-
disabled: 'color
|
|
486
|
+
background: 'color-emerald-500',
|
|
487
|
+
text: 'color-white',
|
|
488
|
+
disabled: 'color-gray-400'
|
|
461
489
|
},
|
|
462
490
|
card: {
|
|
463
|
-
background: 'color
|
|
464
|
-
border: 'color
|
|
491
|
+
background: 'color-white',
|
|
492
|
+
border: 'color-gray-200'
|
|
465
493
|
}
|
|
466
494
|
}
|
|
467
495
|
};
|
|
@@ -493,40 +521,40 @@ function Example() {
|
|
|
493
521
|
return (
|
|
494
522
|
<ThemeProvider theme={theme} colors={customColors} mode="light">
|
|
495
523
|
{/* Using theme colors */}
|
|
496
|
-
<View backgroundColor="theme
|
|
497
|
-
<Text color="theme
|
|
524
|
+
<View backgroundColor="theme-components-card-background" padding={20}>
|
|
525
|
+
<Text color="theme-main-primary" fontSize={24}>
|
|
498
526
|
Primary Theme Color
|
|
499
527
|
</Text>
|
|
500
528
|
|
|
501
529
|
{/* Using palette colors directly */}
|
|
502
|
-
<View backgroundColor="color
|
|
503
|
-
<Text color="color
|
|
530
|
+
<View backgroundColor="color-rose-100" padding={10} marginTop={10}>
|
|
531
|
+
<Text color="color-rose-900">Rose palette color</Text>
|
|
504
532
|
</View>
|
|
505
533
|
|
|
506
534
|
{/* Using singleton colors */}
|
|
507
|
-
<View backgroundColor="color
|
|
508
|
-
<Text color="color
|
|
535
|
+
<View backgroundColor="color-turquoise" padding={10} marginTop={10}>
|
|
536
|
+
<Text color="color-white">Turquoise singleton</Text>
|
|
509
537
|
</View>
|
|
510
538
|
|
|
511
539
|
{/* Using custom colors */}
|
|
512
|
-
<View backgroundColor="color
|
|
513
|
-
<Text color="color
|
|
540
|
+
<View backgroundColor="color-brand" padding={10} marginTop={10}>
|
|
541
|
+
<Text color="color-white">Custom brand color</Text>
|
|
514
542
|
</View>
|
|
515
543
|
|
|
516
544
|
{/* Using mode-specific colors */}
|
|
517
|
-
<View backgroundColor="light
|
|
518
|
-
<Text color="dark
|
|
545
|
+
<View backgroundColor="light-gray-100" padding={10} marginTop={10}>
|
|
546
|
+
<Text color="dark-gray-900">Always light background, dark text</Text>
|
|
519
547
|
</View>
|
|
520
548
|
|
|
521
549
|
{/* Using alpha transparency */}
|
|
522
|
-
<View backgroundColor="color
|
|
523
|
-
<Text color="color
|
|
550
|
+
<View backgroundColor="color-blackAlpha-500" padding={10} marginTop={10}>
|
|
551
|
+
<Text color="color-whiteAlpha-900">Semi-transparent overlay</Text>
|
|
524
552
|
</View>
|
|
525
553
|
|
|
526
554
|
{/* Button using theme */}
|
|
527
555
|
<Button
|
|
528
|
-
backgroundColor="theme
|
|
529
|
-
color="theme
|
|
556
|
+
backgroundColor="theme-components-button-background"
|
|
557
|
+
color="theme-components-button-text"
|
|
530
558
|
>
|
|
531
559
|
Themed Button
|
|
532
560
|
</Button>
|
|
@@ -542,32 +570,37 @@ When working with colors in App-Studio, use these patterns:
|
|
|
542
570
|
|
|
543
571
|
### Color Access Patterns
|
|
544
572
|
```javascript
|
|
545
|
-
// Pattern: color
|
|
546
|
-
"color
|
|
547
|
-
"color
|
|
548
|
-
"color
|
|
549
|
-
|
|
550
|
-
// Pattern: color
|
|
551
|
-
"color
|
|
552
|
-
"color
|
|
553
|
-
"color
|
|
554
|
-
|
|
555
|
-
// Pattern: color
|
|
556
|
-
"color
|
|
557
|
-
"color
|
|
558
|
-
"color
|
|
559
|
-
|
|
560
|
-
// Pattern: theme
|
|
561
|
-
"theme
|
|
562
|
-
"theme
|
|
563
|
-
|
|
564
|
-
// Pattern:
|
|
565
|
-
"
|
|
566
|
-
"
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
"
|
|
573
|
+
// Pattern: color-{name}
|
|
574
|
+
"color-white" // → "#FFFFFF" (in light mode) or "#000000" (in dark mode)
|
|
575
|
+
"color-gold" // → "#FFD700"
|
|
576
|
+
"color-turquoise" // → "#40E0D0"
|
|
577
|
+
|
|
578
|
+
// Pattern: color-{palette}-{shade}
|
|
579
|
+
"color-blue-500" // → "#3b82f6" (light) or "#60a5fa" (dark)
|
|
580
|
+
"color-rose-200" // → "#fecdd3" (light) or "#6b112f" (dark)
|
|
581
|
+
"color-gray-800" // → "#27272a" (light) or "#f4f4f5" (dark)
|
|
582
|
+
|
|
583
|
+
// Pattern: color-{palette}-{shade}-{alpha} (CSS color-mix!)
|
|
584
|
+
"color-black-900-200" // → "color-mix(in srgb, var(--color-black-900) 20%, transparent)"
|
|
585
|
+
"color-blue-500-500" // → "color-mix(in srgb, var(--color-blue-500) 50%, transparent)"
|
|
586
|
+
"color-red-600-800" // → "color-mix(in srgb, var(--color-red-600) 80%, transparent)"
|
|
587
|
+
|
|
588
|
+
// Pattern: theme-{path}
|
|
589
|
+
"theme-primary" // → Resolves to your theme's primary color
|
|
590
|
+
"theme-button-background" // → Resolves to nested theme path
|
|
591
|
+
|
|
592
|
+
// Pattern: theme-{key}-{alpha} (CSS color-mix!)
|
|
593
|
+
"theme-primary-100" // → "color-mix(in srgb, var(--theme-primary) 10%, transparent)"
|
|
594
|
+
"theme-primary-500" // → "color-mix(in srgb, var(--theme-primary) 50%, transparent)"
|
|
595
|
+
"theme-secondary-200" // → "color-mix(in srgb, var(--theme-secondary) 20%, transparent)"
|
|
596
|
+
|
|
597
|
+
// Pattern: light-{name} or light-{palette}-{shade}
|
|
598
|
+
"light-white" // → Always "#FFFFFF" (light mode)
|
|
599
|
+
"light-blue-500" // → Always "#3b82f6" (light mode value)
|
|
600
|
+
|
|
601
|
+
// Pattern: dark-{name} or dark-{palette}-{shade}
|
|
602
|
+
"dark-white" // → Always "#000000" (dark mode white)
|
|
603
|
+
"dark-red-200" // → Always "#6b112f" (dark mode value)
|
|
571
604
|
|
|
572
605
|
// Direct values (unchanged)
|
|
573
606
|
"#ff0000" // → "#ff0000"
|
|
@@ -594,13 +627,13 @@ coolGray, blueGray, slate, zinc, neutral, stone
|
|
|
594
627
|
### Shades Available
|
|
595
628
|
Each palette has these shades: `50, 100, 200, 300, 400, 500, 600, 700, 800, 900`
|
|
596
629
|
|
|
597
|
-
**Note**: For a `1000` shade (fully opaque), use the alpha parameter: `color
|
|
630
|
+
**Note**: For a `1000` shade (fully opaque), use the alpha parameter: `color-{palette}-900-1000`
|
|
598
631
|
|
|
599
632
|
### Theme Mode Behavior
|
|
600
633
|
- **Light Mode**: Uses `defaultLightPalette` and `defaultLightColors`
|
|
601
634
|
- **Dark Mode**: Uses `defaultDarkPalette` and `defaultDarkColors`
|
|
602
|
-
- Colors automatically switch based on `themeMode` unless using `light
|
|
603
|
-
- Color values are inverted for dark mode (e.g., `color
|
|
635
|
+
- Colors automatically switch based on `themeMode` unless using `light-*` or `dark-*` prefix
|
|
636
|
+
- Color values are inverted for dark mode (e.g., `color-white` becomes black in dark mode)
|
|
604
637
|
|
|
605
638
|
## Using Colors with Animations
|
|
606
639
|
|
package/package.json
CHANGED