Skip to content

Commit

Permalink
fix(colors): move css variables to base layer
Browse files Browse the repository at this point in the history
Resolves #3075
  • Loading branch information
benjamincanac committed Jan 16, 2025
1 parent 86e1888 commit 533ccec
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/runtime/plugins/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ')}
}
}`
})

Expand Down

0 comments on commit 533ccec

Please sign in to comment.