fix(colors): move css variables to base layer

Resolves #3075
This commit is contained in:
Benjamin Canac
2025-01-16 12:22:25 +01:00
parent 86e1888474
commit 533ccec110

View File

@@ -19,13 +19,16 @@ export default defineNuxtPlugin(() => {
const root = computed(() => {
const { neutral, ...colors } = appConfig.ui.colors
return `:root {
return `@layer base {
:root {
${Object.entries(appConfig.ui.colors).map(([key, value]: [string, string]) => generateShades(key, value)).join('\n ')}
}
:root, .light {
${Object.keys(colors).map(key => generateColor(key, 500)).join('\n ')}
}
.dark {
}
.dark {
${Object.keys(colors).map(key => generateColor(key, 400)).join('\n ')}
}
}`
})