Re: [w3ctag/design-reviews] User Preference Media Features Client Hints Headers (#632)

I've created a naive demo that shows how this can be done quite easily. You can play with it at https://bloom-accessible-offer.glitch.me/ and code at https://glitch.com/edit/#!/bloom-accessible-offer?path=server.js

TLDR;

```html
    <style media="(prefers-color-scheme: ${prefersColorScheme})">
      body {
        color: ${prefersColorScheme === 'dark' ? 'white' : 'black'}
      }
    </style>
    <link rel="stylesheet" href="${prefersColorScheme === 'dark' ? 'light' : 'dark'}.css" 
        media="(prefers-color-scheme: ${prefersColorScheme === 'dark' ? 'light' : 'dark'})" />
  ```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/632#issuecomment-929049227

Received on Tuesday, 28 September 2021 10:11:32 UTC