kubernetes-sigs / reference-docs

Tools to build reference documentation for Kubernetes APIs and CLIs.
Apache License 2.0
87 stars 102 forks source link

add button to toggle dark/light mode #337

Closed xrstf closed 10 months ago

xrstf commented 10 months ago

This adds a simple button to the page to toggle between a light and dark mode. The dark mode is based on Bootstrap colors:

2023-09-17T13-59-48

tengqm commented 10 months ago

This is nice. Maybe we can add this to the k8s.io/docs website as well?

tengqm commented 10 months ago

/lgtm /approve

k8s-ci-robot commented 10 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tengqm, xrstf

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/reference-docs/blob/master/OWNERS)~~ [tengqm] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
xrstf commented 10 months ago

For the Kubernetes website it might make sense to wait for it to use Bootstrap 5, which has better native support for it. This implementation here that I made is quite cheap, for the full website we probabl want something more robust/fine-tuned. But that's beyond my capabilities :-)

sftim commented 10 months ago

See https://github.com/kubernetes/website/issues/37444

I'd prefer to have the button act only as an override for the user's own preference, when that preference is available.