-
Notifications
You must be signed in to change notification settings - Fork 7
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
ColorSchemeContext + Selector component + implemented in ThreePanelLa… #218
base: develop
Are you sure you want to change the base?
Conversation
…yout and PanelLayout
Please let me know your experience with whether the color schemes work on your local machine, and I will finish the feature by updating all instances of |
We need a GPT plugin that will automatically answer our questions! In the mean time, my most sincere recommendation is to copy and paste everything you wrote here directly into chat gpt and work from there. |
Also this is a fun idea! |
Here's what GPT 4 has to say in response to your OP: Your implementation sounds well-structured, and you've definitely hit some challenges that are commonly faced when implementing theming in an application. Below are some suggestions that might help you: Issues with client-side vs server-side renderingIt's common to run into issues with server-side vs. client-side rendering when dealing with dynamic themes. One common approach to this problem is to set a default theme on the server side and then switch to the user's chosen theme as soon as the client-side JavaScript runs. You might do something like this in your main app file: import React, { useEffect } from 'react';
import { useColorScheme } from './ColorSchemeContext';
const App = () => {
const { setColorScheme, colorScheme } = useColorScheme();
useEffect(() => {
// Check localStorage or some other client-side storage
const storedColorScheme = localStorage.getItem('colorScheme');
if (storedColorScheme) {
setColorScheme(storedColorScheme);
}
}, []);
// ... rest of your app
}; Implementing it across the application
Hopefully, these recommendations give you a direction to proceed. If you have more specific questions or need further code examples, feel free to ask. |
Also it may be that the color theme is managed by tailwind 🤷 |
Hey @usselman this is great work. But it might be overkill you could have done it using the next-themes library that we already use, here's an article re: how to do that : https://dlw-nextjs-tailwindcss-theming.vercel.app/ The keyword we are using throughout the app for the color theme is |
also If I were to redesign the app from scratch, I would use daisyUI which is built on top of tailwind and has built in themes |
Thanks, that's helpful. I'll go ahead and refactor with that in mind. |
I've implemented a rudimentary way to switch color schemes but I'm reaching the limit of my knowledge.
Issues:
bg-primary-300
with:
but there's no easy way to just replace it all throughout the application, so I would like it to be reviewed first before I go ahead and try to do everything.
Any recommendations welcome! Thank you.