aadeshkulkarni / figuringout

Blogging + Social Media + AI | Opensource | Javascript | ReactJS | HonoJS | Prisma
https://figuringout.life
MIT License
72 stars 78 forks source link

Feature | Dark / Light mode #150

Open aadeshkulkarni opened 3 weeks ago

aadeshkulkarni commented 3 weeks ago

Setup Dark & Light mode for the app where light mode = currrent setup.

The Color, typography, spacing, roundedness, etc. should be easily configurable from 1 config file. Build using tailwind CSS.

Ensure that you're implementing modes in the most optimised, efficient manner.

DO NOT BREAK EXISTING FEATURES

vverma022 commented 3 weeks ago

I'd like to work on this feature. As the project is in tailwind I would try implementing it using the selector strategy.

aadeshkulkarni commented 3 weeks ago

Sure. only 1 issue can be assigned to a contributor at a time.

If no one claims the issue before you complete #146, will assign it to you.

vverma022 commented 3 weeks ago

Sure. only 1 issue can be assigned to a contributor at a time.

If no one claims the issue before you complete #146, will assign it to you.

Can you assign it

aadeshkulkarni commented 3 weeks ago

Sure

aadeshkulkarni commented 3 weeks ago

@vverma022 - Please set the primary, secondary colors for both light and dark mode in tailwind.config.js And then use bg-primary / bg-secondary in the code.

This would be a much cleaner approach and will be easier to maintain in future

Shashan17J commented 1 week ago

@aadeshkulkarni Assign this to me.

aadeshkulkarni commented 6 days ago

Share your approach first.

Shashan17J commented 6 days ago

1.Enable the 'darkMode' feature in the 'tailwind.config.js' file.

  1. Create a component that toggles dark mode and save preference in localStorage.
  2. Modify the logout function to preserve the dark mode preference.
  3. And then style the UI Ex. dark:bg-white.
aadeshkulkarni commented 6 days ago

We are planning to integrate Shadcn soon. Can you implement dark modes using Shadcn ?

vverma022 commented 6 days ago

We are planning to integrate Shadcn soon. Can you implement dark modes using Shadcn ? I'll do it I have the code base already.

vverma022 commented 6 days ago

If shadcn needs to be implemented then the implication will be easy as well as structuring the app-bar component. I'll make a new brach to solve this issue as the current one has its issues.

Shashan17J commented 6 days ago

I have already implemented dark mode; only a few things remain. @aadeshkulkarni Screenshot 2024-06-26 120153 Screenshot 2024-06-26 115049 Screenshot 2024-06-26 115105 Screenshot 2024-06-26 115631 Screenshot 2024-06-26 115654 Screenshot 2024-06-26 115751 Screenshot 2024-06-26 120610

Shashan17J commented 6 days ago

@aadeshkulkarni if this is OK, then I can create a pull request for this issue.

aadeshkulkarni commented 6 days ago

@Shashan17J - Is this done using shadcn ?

Shashan17J commented 6 days ago

@aadeshkulkarni without shadcn.

aadeshkulkarni commented 6 days ago

In that case, pause. @vverma022 - Can you build it using shadcn ? If yes, please share timelines.

vverma022 commented 6 days ago

In that case, pause. @vverma022 - Can you build it using shadcn ? If yes, please share timelines.

Probably yes, Shadcn already provides dark theme as well as the toggle component. I'll try and get it done by tomorrow. Any preferences or suggestions ?

aadeshkulkarni commented 6 days ago

In that case, pause. @vverma022 - Can you build it using shadcn ? If yes, please share timelines.

Probably yes, Shadcn already provides dark theme as well as the toggle component. I'll try and get it done by tomorrow. Any preferences or suggestions ?

Yes.

Break the task down into steps.

Step 1: Try to setup shadcn first. And see everything works as is currently. (Light mode i mean) Step 2: Add dark mode incrementally. One page at a time. Start with simple pages like Sign up, Sign in. Make sure you commit your code on each step with the appropriate commit messages. Step 3: Once all pages are done. Check components.

Don't add any Shadcn components for now. (unless absolutely necessary). We will do it as a separate ticket.

Document everything that you achieved and also things that can be done later.

vverma022 commented 6 days ago

As of now I have just added 2 components. A button and a dropdown which will act as the trigger's for the dark mode. So instead of using one of the default colour schemes implement it manually by changing and adding theme's in the index.css and tailwind files.

vverma022 commented 6 days ago

As of now I have just added 2 components. A button and a dropdown which will act as the trigger's for the dark mode. So instead of using one of the default colour schemes implement it manually by changing and adding theme's in the index.css and tailwind files.

Screenshot 2024-06-26 at 9 44 10 PM
vverma022 commented 6 days ago

Revising the date of completion I might take a bit more than a day. But it'll be done before this week