unjs / undocs

Minimal Documentation theme and CLI for shared usage across UnJS projects.
https://undocs.pages.dev/
MIT License
143 stars 12 forks source link

refactor: use Cookies to store color instead of localStorage #119

Closed ToBinio closed 3 months ago

ToBinio commented 3 months ago

πŸ”— Linked issue

❓ Type of change

πŸ“š Description

This PR changes the way the color choice is stored from localStorage to Cookies. This is so that SSR also knows the color choice of the user. Currently, SSR always sends the default color so you get kinda flash banged if you have a different setting.

I know that the workaround with the Cookie expiration date isn't the cleanest. But I believe it would be worth it for the improved UX. If you disagree or have a better idea of how to fix the problem let me know.

πŸ“ Checklist

pi0 commented 3 months ago

Hi. Thanks for your time on this PR but undocs is meant to output static files so this change doesn't pretty much works with this current design.