StyleGuides / WritingStyleGuide

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

Dark Mode selection does not persist across page refreshes #581

Closed jdandrea closed 3 months ago

jdandrea commented 5 months 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 5 months 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 months 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 5 months 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!

jdandrea commented 4 months ago

Hello, @harpasin!

At last, I am able to build the publican-brand-redhat rpm and test my changes. It turns out there is one thing I forgot regarding the use of xsl:template vs xsl:include, so I will fix that and re-verify, then I'll create a PR.