Skip to content

Commit 2dd1c64

Browse files
authored
Merge pull request #536 from components-ai/theme-box-shadows
Add support for box shadows in theme
2 parents 820baf5 + 5a373ac commit 2dd1c64

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.changeset/cool-hounds-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@compai/css-gui': patch
3+
---
4+
5+
Add support for box shadows in theme

apps/docs/data/default-theme.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,16 @@ export const defaultTheme: any = {
270270
},
271271
description: '',
272272
durations: [],
273-
boxShadows: {},
273+
boxShadows: {
274+
0: '0px 3px 6px 0px rgba(0, 0, 0, 0.16), 0px 3px 6px 0px rgba(0, 0, 0, 0.23)',
275+
1: '0px 14px 28px 0px rgba(0, 0, 0, 0.25), 0px 10px 10px 0px rgba(0, 0, 0, 0.22)',
276+
2: '0px 1px 1px 0px rgba(0, 0, 0, 0.11), 0px 2px 2px 0px rgba(0, 0, 0, 0.11), 0px 4px 4px 0px rgba(0, 0, 0, 0.11), 0px 6px 8px 0px rgba(0, 0, 0, 0.11), 0px 8px 16px 0px rgba(0, 0, 0, 0.11)',
277+
3: '0px 1px 1px 0px rgba(0, 0, 0, 0.15), 0px 2px 2px 0px rgba(0, 0, 0, 0.15), 0px 4px 4px 0px rgba(0, 0, 0, 0.15), 0px 8px 8px 0px rgba(0, 0, 0, 0.15)',
278+
4: '0px 3px 6px 0px rgba(0, 0, 0, 0.16), 0px 3px 6px 0px rgba(0, 0, 0, 0.23)',
279+
5: '0px 1px 1px 0px rgba(0, 0, 0, 0.08), 0px 2px 2px 0px rgba(0, 0, 0, 0.12), 0px 4px 4px 0px rgba(0, 0, 0, 0.16), 0px 8px 8px 0px rgba(0, 0, 0, 0.20)',
280+
6: '0px 14px 28px 0px rgba(0, 0, 0, 0.25), 0px 10px 10px 0px rgba(0, 0, 0, 0.22)',
281+
7: '0px 10px 20px 0px rgba(0, 0, 0, 0.19), 0px 6px 6px 0px rgba(0, 0, 0, 0.23)',
282+
},
274283
textShadows: {},
275284
easingFunctions: {},
276285
gradients: {},

packages/gui/src/components/schemas/box-shadow.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { joinSchemas } from './joinSchemas'
33
import { listSchema } from './list'
44
import { objectSchema } from './object'
55
import { keyword, length } from './primitives'
6+
import { themeRecord } from './theme'
67
import { toggle } from './toggle'
78

89
const singleBoxShadow = objectSchema({
@@ -22,4 +23,5 @@ export const boxShadow = joinSchemas([
2223
itemSchema: singleBoxShadow,
2324
}),
2425
keyword(['none']),
26+
themeRecord('boxShadows'),
2527
])

packages/gui/src/components/schemas/theme.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function themeScale(path: string): DataTypeSchema<ThemeValue> {
4343
}
4444
}
4545

46-
// Theme properties for stuff represented by a string names
46+
// Theme properties for stuff represented by a string name
4747
export function themeRecord(path: string): DataTypeSchema<ThemeNamedValue> {
4848
return {
4949
type: 'theme',

0 commit comments

Comments
 (0)