Skip to content

Commit 10ba00d

Browse files
author
patched.codes[bot]
committed
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/sdk/stack-theme.mdx
1 parent dacecd1 commit 10ba00d

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: StackTheme
3+
---
4+
5+
# StackTheme
6+
7+
A component that applies a theme configuration to its children. It sets up the necessary styles and scripts for theming.
8+
9+
## Parameters
10+
11+
- `theme` (optional): `ThemeConfig` - A configuration object for customizing the theme. It can include `light` and `dark` mode colors, as well as a `radius` property.
12+
- `children` (optional): `React.ReactNode` - The child components to be wrapped by the theme.
13+
- `nonce` (optional): `string` - A unique identifier used for script and style security.
14+
15+
## Example
16+
17+
```tsx
18+
import { StackTheme } from '@stackframe/stack';
19+
20+
function App() {
21+
const customTheme = {
22+
light: {
23+
background: '#ffffff',
24+
foreground: '#000000',
25+
// ... other color properties
26+
},
27+
dark: {
28+
background: '#000000',
29+
foreground: '#ffffff',
30+
// ... other color properties
31+
},
32+
radius: '4px'
33+
};
34+
35+
return (
36+
<StackTheme theme={customTheme}>
37+
<YourAppComponents />
38+
</StackTheme>
39+
);
40+
}
41+
``` </StackTheme>
42+
);
43+
}
44+
```

0 commit comments

Comments
 (0)