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

Have a Light mode #44

Open
Rishabh-malhotraa opened this issue Oct 5, 2021 · 3 comments
Open

Have a Light mode #44

Rishabh-malhotraa opened this issue Oct 5, 2021 · 3 comments
Assignees

Comments

@Rishabh-malhotraa
Copy link
Owner

Requirement

  • Have a light mode for the entire editor page. Currently, we only support changing the theme of the Codemirror editor instance, but no other components.

The theme palette I use is the following:- VS-dark

First, we need to decide which palette we would be using for the light theme and then implement this in a modular way.

This is a big issue, so before trying to fix this, let me know how you approach this in a maintainable way.

By maintainable, I mean you don't have to change CSS hex codes in every component but have it defined from a global theme.modules.css file, and all the components derive CSS from that file.

@GaganpreetKaurKalsi
Copy link
Collaborator

Hi Rishabh!
To add the theme feature we can have a theme.css file which includes the theme name as className and have all the theme related css in it. Then we can use useState hook to determine the theme. We can pass this state into the components as props and use it as className. Whenever the user changes the theme, the state is updated and as it is passed as prop(className) to components, the css will be applied based on the theme.css file and the component will rerender with the new theme. I hope I am clear with my approach.

If you find that my approach is feasible, you may assign me the issue. I would be happy to work on it.

@AshokRajKoribilli
Copy link

Hi Rishabh!
To add the light theme feature to all components we create a global CSS file with both light and dark themes. Then we can use the useState hook to determine the theme. We can pass this state into the components as props and use it as className. Whenever the user changes the theme, the state is updated and as it is passed as a prop(className) to components, the CSS will be applied based on the theme.css file and the component will rerender with the new theme. I hope I am clear with my approach.

If you find that my approach is feasible, you may assign me the issue. I would be happy to work on it.

@ashutosh4036
Copy link

We can add a slider button that can switch between light and dark theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants