webgems icon indicating copy to clipboard operation
webgems copied to clipboard

Create light mode switch

Open lostdesign opened this issue 5 years ago • 18 comments

Use CSS root var to swap app theme

lostdesign avatar Jun 15 '19 01:06 lostdesign

Hi @lostdesign if it is still in plan, Can I take this up ?

SarathSantoshDamaraju avatar Aug 22 '19 09:08 SarathSantoshDamaraju

Hi @SarathSantoshDamaraju, you can sure take this up yeah! Maybe sync with @Shiroraven as he also proposed something on the discord server.

lostdesign avatar Aug 22 '19 09:08 lostdesign

@lostdesign Cant find him on devcord channel (am i checking at a wrong place?). I will start working on it till he replies here and we can cor-ordinate on this thread.

SarathSantoshDamaraju avatar Aug 22 '19 09:08 SarathSantoshDamaraju

Hey, @SarathSantoshDamaraju thanks for showing interest in helping out, I left devcord quite a while ago due to personal reasons. You can contact me on Discord using my tag Shiroraven#4302 or just work from this thread. 👍

Shiroraven avatar Aug 22 '19 10:08 Shiroraven

Can we use this thread ? and do you have thoughts on this theme switcher as @lostdesign mentioned?

SarathSantoshDamaraju avatar Aug 22 '19 10:08 SarathSantoshDamaraju

While possible, i would recommend against it because alot of developers are getting notified about every action that happens here.

For now i just created a component for the actual switch as a concept. Screenshot (19) Screenshot (20)

Shiroraven avatar Aug 22 '19 10:08 Shiroraven

I'm currently trying to figure out the best way to change the CSS upon switching the theme, maybe adding a class of .light or .dark to the body would work?

Shiroraven avatar Aug 22 '19 10:08 Shiroraven

Sure.

And only .light class would do as dark theme is by default. And can be accomplished with few style changes. Just for reference I made a quick edit in browser. Screenshot 2019-08-22 at 4 16 40 PM

I assume you can complete this. let me know otherwise.

SarathSantoshDamaraju avatar Aug 22 '19 11:08 SarathSantoshDamaraju

looks good! We have to make sure to replace the blue parts though due to contrast

Shiroraven avatar Aug 22 '19 11:08 Shiroraven

also we need the webgems logo cleaned up

Shiroraven avatar Aug 22 '19 11:08 Shiroraven

i can push my switch component and you can tinker around with the css if you want should be done then?

Shiroraven avatar Aug 22 '19 11:08 Shiroraven

Sure

SarathSantoshDamaraju avatar Aug 23 '19 04:08 SarathSantoshDamaraju

@Shiroraven Let me know after pushing the component

SarathSantoshDamaraju avatar Aug 26 '19 08:08 SarathSantoshDamaraju

Just want to also propose to make use of the prefers-color-scheme media query.

@media (prefers-color-scheme: dark) {

}

@media (prefers-color-scheme: light) {

}

And make adjustments to the theme-color meta tag currently it's set to #FFFFFF

Hammster avatar Oct 13 '19 08:10 Hammster

<!-- dark mode -->
<link rel="stylesheet"
      href="dark.css"
      media="(prefers-color-scheme: dark)">

<!-- light mode -->
<link rel="stylesheet"
      href="light.css"
      media="(prefers-color-scheme: light)">

This code will help, too.

hsh2001 avatar Oct 22 '19 06:10 hsh2001

@SarathSantoshDamaraju @Shiroraven any updates on this?

lostdesign avatar Oct 25 '19 10:10 lostdesign

Hello, can I work on this issue?

mallikarjun2000 avatar Feb 06 '21 15:02 mallikarjun2000

Thanks

nguyenphungsang avatar Aug 16 '21 12:08 nguyenphungsang