Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mapping to multiple class names #298

Closed
wants to merge 8 commits into from

Conversation

Ti-tanium
Copy link

@Ti-tanium Ti-tanium commented Jun 5, 2024

Fixes: #292 #221

This PR would allow users to map one theme to multiple custom classes.

The value can now accept a string or string[] as value.

if we want to map a theme to multiple custom theme values, we can simply pass an array:

<ThemeProvider attribute='class' value={{ pink: ['my-pink-theme', 'another-pink-theme'] }}>

When the selected theme is pink, both my-pink-theme and another-pink-theme will be added as class names.

Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-themes-basic ❌ Failed (Inspect) Jun 5, 2024 7:18pm
next-themes-tailwind ❌ Failed (Inspect) Jun 5, 2024 7:18pm
next-themes-with-app-dir ❌ Failed (Inspect) Jun 5, 2024 7:18pm

@dir
Copy link

dir commented Oct 1, 2024

+1 to this, would be so helpful

@Ti-tanium Ti-tanium closed this by deleting the head repository Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request]:setTheme multiple classes for next-themes
2 participants