remix-run / react-router-website

The React Router website
https://reactrouter.com
MIT License
149 stars 33 forks source link

[Docs]: Documentation Light/Dark Theme #79

Open majamarijan opened 8 months ago

majamarijan commented 8 months ago

Describe what's incorrect/missing in the documentation

I noticed some misbehavior in the functionality when changing themes in React Router Docs. The theme is changing back or back and forth between dark/light when you:

  1. click on the theme icon and change the theme and then immediately click on the h2 (for example in the Tutorial page heading with the id="data-writes--html-forms") or
  2. clicking on the empty space between the main text and the sidebar with the headings

This is checked on both Chrome (Version 118.0.5993.117 ) and Firefox (Version 118.0.5993.117 )

changeThemeProblem

brookslybrand commented 3 months ago

@majamarijan sorry no one ever got back to you on this

I've been spending some time cleaning up issues and updating the website. Is this still happening for you? I was unable to reproduce

majamarijan commented 3 months ago

Hi @brookslybrand! Yes, it is better (Chrome and Firefox), but the issue still exists => when change the theme and then click on the bookmark.

Clicking on the blank space on the page doesn't affect the theme anymore. That's corrected well!

themeChangingProblem

brookslybrand commented 3 months ago

@majamarijan, are you toggling your network speed or anything? I'm wondering if the action is getting cancelled before the cookie has a chance to update?

majamarijan commented 3 months ago

@brookslybrand , no toggling. Yeah, I think that's the problem. If the theme is changed, and I click on the bookmark in a half a second or less after changing the theme, then this happens. Or, I change the Theme and then double click on the bookmark (like # Tutorial). I do the same on the MDN website and this is not happening (they have the same theme button that opens a dialog).

Yet, it is now much better than before.