mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-08 06:28:37 +00:00
* feat(www): more chart examples * feat: add themes support on blocks page * chore: build registry * fix: colors on charts * fix: styles * fix: downgrade rehype-pretty-code * chore: fix * fix: frame * fix: code
32 lines
593 B
TypeScript
32 lines
593 B
TypeScript
"use client"
|
|
|
|
import { useThemesConfig } from "@/hooks/use-themes-config"
|
|
|
|
export function ThemesStyle() {
|
|
const { themesConfig } = useThemesConfig()
|
|
|
|
if (!themesConfig.activeTheme) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<style>
|
|
{`
|
|
.themes-wrapper,
|
|
[data-chart] {
|
|
${Object.entries(themesConfig.activeTheme.cssVars.light)
|
|
.map(([key, value]) => `${key}: ${value};`)
|
|
.join("\n")}
|
|
}
|
|
|
|
.dark .themes-wrapper,
|
|
.dark [data-chart] {
|
|
${Object.entries(themesConfig.activeTheme.cssVars.dark)
|
|
.map(([key, value]) => `${key}: ${value};`)
|
|
.join("\n")}
|
|
}
|
|
`}
|
|
</style>
|
|
)
|
|
}
|