Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cool-hounds-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@compai/css-gui': patch
---

Add support for box shadows in theme
11 changes: 10 additions & 1 deletion apps/docs/data/default-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,16 @@ export const defaultTheme: any = {
},
description: '',
durations: [],
boxShadows: {},
boxShadows: {
0: '0px 3px 6px 0px rgba(0, 0, 0, 0.16), 0px 3px 6px 0px rgba(0, 0, 0, 0.23)',
1: '0px 14px 28px 0px rgba(0, 0, 0, 0.25), 0px 10px 10px 0px rgba(0, 0, 0, 0.22)',
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)',
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)',
4: '0px 3px 6px 0px rgba(0, 0, 0, 0.16), 0px 3px 6px 0px rgba(0, 0, 0, 0.23)',
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)',
6: '0px 14px 28px 0px rgba(0, 0, 0, 0.25), 0px 10px 10px 0px rgba(0, 0, 0, 0.22)',
7: '0px 10px 20px 0px rgba(0, 0, 0, 0.19), 0px 6px 6px 0px rgba(0, 0, 0, 0.23)',
},
textShadows: {},
easingFunctions: {},
gradients: {},
Expand Down
2 changes: 2 additions & 0 deletions packages/gui/src/components/schemas/box-shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { joinSchemas } from './joinSchemas'
import { listSchema } from './list'
import { objectSchema } from './object'
import { keyword, length } from './primitives'
import { themeRecord } from './theme'
import { toggle } from './toggle'

const singleBoxShadow = objectSchema({
Expand All @@ -22,4 +23,5 @@ export const boxShadow = joinSchemas([
itemSchema: singleBoxShadow,
}),
keyword(['none']),
themeRecord('boxShadows'),
])
2 changes: 1 addition & 1 deletion packages/gui/src/components/schemas/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function themeScale(path: string): DataTypeSchema<ThemeValue> {
}
}

// Theme properties for stuff represented by a string names
// Theme properties for stuff represented by a string name
export function themeRecord(path: string): DataTypeSchema<ThemeNamedValue> {
return {
type: 'theme',
Expand Down