clreq icon indicating copy to clipboard operation
clreq copied to clipboard

feat: support dark mode

Open kirklin opened this issue 1 year ago β€’ 8 comments

Fixes #611


Preview | Diff

kirklin avatar Mar 19 '24 06:03 kirklin

Deploy Preview for clreq ready!

Name Link
Latest commit 248bff97ad91fc2b7f05f1d137670c0ce3c5fbdd
Latest deploy log https://app.netlify.com/sites/clreq/deploys/66385a93a09ac500082a5bec
Deploy Preview https://deploy-preview-612--clreq.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 19 '24 06:03 netlify[bot]

Thanks for your PR, @kirklin!

Unfortunately, simply adding darkMode: true is not enough. We need to customize the colors in CSS with @media (prefers-color-scheme: dark) {...} and CSS custom properties, like https://github.com/w3c/clreq/blob/60649c5cad7cc804d0979183de3c9da2e7489ae9/local.css#L147-L160 and https://github.com/w3c/clreq/blob/60649c5cad7cc804d0979183de3c9da2e7489ae9/local.css#L59

xfq avatar Mar 20 '24 01:03 xfq

We also need to make dark mode versions for at least some of the images in the document.

xfq avatar Mar 20 '24 01:03 xfq

Thanks for updating the PR! I made some comments.

IMHO we can consider using CSS custom properties (like https://github.com/w3c/bp-i18n-specdev/pull/130/files ), so that when updating the colour, it is easier to remember that we also have a dark theme that needs to be updated.

xfq avatar Mar 25 '24 06:03 xfq

And we also need to update https://github.com/w3c/clreq/blob/7d515699e5d805ddf7183173ab910a1d294ddf65/local.css#L327

xfq avatar Mar 25 '24 06:03 xfq

image I'm wondering if we should just reverse this colour. make the green for Traditional Chinese directly into purple for Traditional Chinese.

kirklin avatar Mar 26 '24 06:03 kirklin

Per https://github.com/w3c/respec/pull/4700 , please remove darkMode: true and use:

<meta name="color-scheme" content="light dark">

xfq avatar May 06 '24 04:05 xfq

There are still some problems with manually switching the colour theme. Let’s wait until https://github.com/w3c/respec/issues/4687 is resolved.

xfq avatar May 19 '24 11:05 xfq