stdlib-js / www

Website for stdlib, a standard library for JavaScript and Node.js.
https://stdlib.io
Apache License 2.0
7 stars 8 forks source link

Support automatic light/dark mode theme based on OS #56

Open kgryte opened 1 year ago

kgryte commented 1 year ago

Currently, one must explicitly toggle light/dark mode in the API docs. Would be nice to have an option where light/dark mode can be automatically toggled based on the host system setting.

This should be possible. E.g., GitHub supports this for their site.

krishnaagrawal7508 commented 6 months ago

Does it have to be automatic? or there could be a toggle button to switch between the two modes as per their preferences?

kgryte commented 6 months ago

@krishnaagrawal7508 We already support such a setting. This request is about supporting the use case where users configure their OS to, e.g., toggle their system theme based on time of day. Right now, users have to manually toggle the theme. It would be nice to have an "auto" setting which simply queries the host setting and updates the site theme accordingly.