dark mode #1104
Replies: 3 comments 2 replies
-
I love your Moon Phase Switch. I love it so much I might steal it (again), but... I think the use case is edgy enough that it doesn't need to be part of core skeleton. Having the ability to switch back to system theme is really only necessary on a website that I'm going to be on all day long, and most Skeleton projects probably won't end up in that category. That said, there are a lot of things I wish were in Skeleton but I realize aren't practical or realistic to have as part of the core library. I would propose that your Moon Phase Switch be the first entrant into a robust and vibrant ecosystem of plug-and-play Skeleton extensions. Aesthetically, Skeleton is about the best UI system I've seen even though other systems may have more features. If people are building functionality around Skeleton without having to pester the core maintainers, I think the community will continue to grow and adoption will accelerate. |
Beta Was this translation helpful? Give feedback.
-
By the way, you can pass in any 3 components you want. That really simplified a11y because skeleton icon buttons passed in just work. I don't think it is edgy, but how you want the web to work. Here, take a look at the second button from the top right. https://tailwindcss.com/ Our current 2 way switch is actually disabling built in tailwind functionality. It is most certainly at odds with how every single dark mode capable desktop app works. What we put in the core matters. It forms the default. Hunting down stuff elsewhere is a smaller chance affair. |
Beta Was this translation helpful? Give feedback.
-
Doing it 3 ways with replicating the system default is a very cool idea, but there's still a couple of problems. So the "adhere to system preference" setting would mean that a browser needs to be restarted/refreshed to reflect the current system preference in windows afaik which is just bad as well. What I'm trying to say is that this is (sad as it is to say) a bit at the cutting edge of web development and capabilities and if we want to avoid bleeding and pain, waiting a bit might not be the worst option. |
Beta Was this translation helpful? Give feedback.
-
So based on this conversation with our intrepid leader I went forth to gather data. https://discord.com/channels/1003691521280856084/1003699523522142399/1080749824653135932
I am not working at Adobe anymore so no Adobe dollars to spend on user studies. But school me if I am ignorant of The Way.
However the meta question is really, what is the state of dark mode? This starts on the device where we ask our Mac, iPhone, iPad, PC, Android, Arduino? to be 'dark' or 'light' or 'auto' etc. (The latter is my choice and I supplement that with a reduced glare and blue light setting at night time.)
So I went through all 47 apps open in my dock. Trash is a duplicate and Launcher is N/A. The following had no dark mode:
Conclusion
So I actually modified my view a lot. I agree with Chris it should be simple. I now think this is how every website should work:
This is accomplished by the existing
autoModeWatcher()
andsetInitialClassState()
in LightSwitch.Ointment Flies
There is one fly in the ointment. Not all websites rock good dark or light modes. Also user preferences are fickle so sometimes they want to force a light or dark choice. I like to code in dark mode only as an example. But users should be able to revert to the system setting again, it's polite.
Recommendation
I would recommend upgrading the current binary choice switch that disables going back to the system mode with one that does. https://xgrams.vercel.app/ has a refactoring of the current code that only adds that specific part (moon button, top left). A lot of hacking went into that version to simplify some stuff and I figured out some svelty ways of doing other things, it was quite the adventure! I renamed everything so it can coexist with LightSwitch with no chance of colliding variables, npm doppelgangers, unkown knowns, etc. That process would get reversed if we want this switch of course.
I think reducing the choices we give skeleton users here is important, with an emphasis on "doing the right thing automatically". I read substantial amounts of the showcase thread and saw the lamentations that people tend to just copy the given AppShell etc. as is!
Discussion needed (post 1.0)
Anyway, thoughts, comments, discussion. I doubt I covered all angles on the topic. Also I found a related discussion about the sausage of how we do dark mode vs tailwind which also has a pure css as well as a system mode which I think we don't support yet, at least not according to a quick test.
Beta Was this translation helpful? Give feedback.
All reactions