Skip to content

Commit

Permalink
fix: map theme to class using ValueObject in injected script (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgavrilov authored Dec 14, 2024
1 parent 57c0561 commit 1b51044
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion next-themes/src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const script = (
const classes = isClass && value ? themes.map(t => value[t] || t) : themes
if (isClass) {
el.classList.remove(...classes)
el.classList.add(theme)
el.classList.add(value[theme] || theme)
} else {
el.setAttribute(attr, theme)
}
Expand Down

0 comments on commit 1b51044

Please sign in to comment.