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

Dark Mode not working #3482

Open
raizpvp opened this issue Dec 1, 2023 · 3 comments
Open

Dark Mode not working #3482

raizpvp opened this issue Dec 1, 2023 · 3 comments

Comments

@raizpvp
Copy link

raizpvp commented Dec 1, 2023

What version of rsuite are you using?

5.46.1

What version of React are you using?

18.2

What version of TypeScript are you using (if any)?

No response

What browser are you using?

Chrome

Describe the Bug

I want to switch the theme from Light to Dark and modify the primary color. However, I am encountering an issue where only the primary color changes, and the overall theme switch is not working. I am using React with Vite and Less.
custom-theme.less:
@enable-dark-mode: true; @primary-color: #7d1e28;

main.less
@import 'rsuite/styles/index.less'; @import 'custom-theme.less';
image
image
image
image
image

Expected Behavior

No response

To Reproduce

React, Vite & Less:
follow this tutorial: https://rsuitejs.com/guide/official-themes/

@firstdorsal
Copy link

I just wrapped the App in the custom provider like this

...
render = () => {
        return (
            <CustomProvider theme="dark">
                Your App
            </CustomProvider>
        );
    };
....

@raizpvp
Copy link
Author

raizpvp commented Dec 1, 2023

I just wrapped the App in the custom provider like this

...
render = () => {
        return (
            <CustomProvider theme="dark">
                Your App
            </CustomProvider>
        );
    };
....

This works to activate the dark mode. But then I can't change the primary color.

@simonguo
Copy link
Member

simonguo commented Dec 6, 2023

This works to activate the dark mode. But then I can't change the primary color.

The corresponding less variable in dark mode is @primary-color-dark.

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

No branches or pull requests

3 participants