StyleGuides / WritingStyleGuide

The official Red Hat guide to writing clear, concise, and consistent technical documentation.
Creative Commons Attribution Share Alike 4.0 International
71 stars 19 forks source link

Dark Mode selection does not persist across page refreshes #581

Open jdandrea opened 1 week ago

jdandrea commented 1 week ago

Steps to reproduce:

  1. Open the Style Guide page.
  2. Select Toggle Dark Mode at top-right. The page updates accordingly.
  3. Reload the page. Dark Mode is no longer active.

I have created and tested a modest change that adds Dark/Light Mode persistence across page refreshes. It relies on the localStorage object. This behavior gracefully degrades if the object is unavailable.

I will open a PR with the proposed change, assign to @harpasin for review, and link back to this issue.

jdandrea commented 1 week ago

@harpasin I realized that the change is not made in this repository!

Before I open a PR, please feel free to review as it stands. I do not have publican set up just yet, so I'm unable to build. However, I was able to verify these changes using a static HTML file, then make matching updates to a fork of the XSLT. (I can see that I need to remove some hard tabs. I will do that in a subsequent commit.)

harpasin commented 5 days ago

@jdandrea This issue is correct, reload change the dark mode to light mode. Assign me PR to review when it's ready. Please ping me if you need any help with the issue.

jdandrea commented 4 days ago

Thanks, @harpasin!

To be clear, were you able to apply my changes and verify that both dark and light mode selections persist across page reloads? I don't want to open a PR unless I'm sure it is verified by at least one reviewer.

I may have the ability to verify this with a proper build within the week. Meanwhile, I have confidence that the change I've made ought to work. I'd still like to double check with an actual build, of course.

Thank you!