Re: [csswg-drafts] [css-mediaqueries] Expose User Preference Media Queries as HTTP Client Hint or HTTP Header (#4162)

I'd like to add my support as well. We're 100% dedicated to supporting specifically the prefers-color-scheme accessibility feature, but with our SSR setup it's currently practically impossible to prevent the default theme being briefly rendered on first load before the view is hydrated on the client-side, unless we sacrifice time to first contentful paint by displaying the page only after hydration. Getting this information in the request header would allow us to properly render with the expected color scheme right away.

I understand that we _could_ use CSS variables and ship both light and dark themes with the initial rendered HTML, but we're using styled-components as a CSS-in-JS styling solution, as many others do. Systematically, this means our theme is rendered using JS so we have no way to render the page properly without knowing the user preference on the server render. Unless we invest weeks into changing our styling toolchain, that is…

-- 
GitHub Notification of comment by efstajas
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4162#issuecomment-631400330 using your GitHub account

Received on Wednesday, 20 May 2020 10:51:30 UTC