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

Bug - Dark mode does not respect system settings and defaults to light mode on every page load #3867

Closed
garrett opened this issue Jan 18, 2024 · 2 comments

Comments

@garrett
Copy link
Contributor

garrett commented Jan 18, 2024

Describe the problem

All pages for PatternFly.org are in light mode by default, regardless of system settings. Manually switching to dark mode does not work, except while on that page.

Expected behavior

PatternFly.org should default to the system color scheme. There can be a preference to override the theme (especially to preview widgets in light/dark modes for reference while developing), but it should be the system mode by default and there should be a way to get back to system default too.

Any other information?

Sadly, I often have vision issues where I need dark mode, either due to migraine or allergy problems. I have to set my system and apps to dark mode.

When it's not too bad, I still try to work, but blasting bright light in my face is physically painful and will make my headache and/or eye pain worse (depending on the cause). Too much brightness, and I can't even work.

(I also have astigmatism, which means I need light mode too, when I'm able to tolerate it. But when I need it, using dark mode overrides that for me.)

This was why I build dark mode in Cockpit and pushed for it in PatternFly. 😉 We should also have it for the website, especially since PatternFly has the ability to do so.

There should be a trinary setting, with auto, light, and dark. In Cockpit we have a switcher with text in the menu, like this:

screenshot of Cockpit's light/dark mode switcher

GNOME has an icon with text, which has light and dark. It's a toggle, as it is the system so it sets the system color scheme:

image

Discord has a trinary state, of light, dark, and system:

image

Since PatternFly is a reference site and people may need to see light and dark modes for widgets in cases where they do not want to change their system settings, I think it needs 3 manual states. As it uses a sun and moon icon currently, I'd suggest something like what GNOME uses for an icon, the half filled circle: ◐

This means, it could be accessible by default with the system setting and then someone could override it for reference (when they need reference dark/light widgets).

@garrett
Copy link
Contributor Author

garrett commented Jan 18, 2024

Here's a mockup of how it could look, based on the current site:

pf-dark-mode

Here is the SVG source:

pf-dark-mode

I used the sun and moon from the website, and made a light/dark icon. The light/dark system icon and the moon icon are the same sizes: 14 px. The sun is 20. The goal was to have each be roughly 16px wide, but the visual weight of the sun versus the moon is quite different, due to the sun's inner part and the rays. To make them all the same visual weight, I nudged down the system and dark mode icons and nudged up the light mode sun.

Here's an optimized (with svgo) pixel-perfect SVG icon I made for the system light/dark icon @ 14px:

pf-dark-mode-system-paths-opt
pf-dark-mode-system-paths-opt.svg

(It may be invisible in light mode. It does show up in dark mode, however. 😉 and the top bar on the PatternFly site is always dark.)

The icons should be obvious by context, but they should also have tooltips (which they appear to not have at the moment).

@nicolethoen nicolethoen moved this from Needs triage to Backlog in PatternFly Issues Jun 20, 2024
@edonehoo edonehoo added the Groom label Sep 12, 2024
@kmcfaul kmcfaul removed the bug label Oct 25, 2024
@edonehoo edonehoo removed the Groom label Nov 1, 2024
@edonehoo edonehoo moved this from Backlog to Needs triage in PatternFly Issues Nov 1, 2024
@edonehoo
Copy link
Collaborator

Closing: this was addressed via #4389. Let me know if you have questions!

@github-project-automation github-project-automation bot moved this from Needs triage to Done in PatternFly Issues Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants