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

> For performance reasons, the server could have inlined `dark.css` based on `Sec-CH-Prefers-Color-Scheme: dark`, and then only add the line `<link rel="stylesheet" href="light.css" media="(prefers-color-scheme: light)" />` in the server-generated source code, so loading of `light.css` would work on-demand.

Thank you for the great example @tomayac. I really like it because it is a good illustration of how the proposed micro-optimization to load performance could be achieved. At the same time it demonstrates my concern of shifting client-side style and resource management to the server.

In this case, if the `dark.css` is inlined into the document as a number of CSS rules. When the color scheme changes and `light.css` is loaded, the user will experience unexpected effects because rules from the two stylesheets will co-exist (because one of the stylesheets is inlined).

It is hard to justify such a huge shift of client-to-server responsibility and all the potential breakage for arguably minimal performance gain. At least in the case of media features, not CH in general.  

-- 
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-928053365

Received on Monday, 27 September 2021 16:33:23 UTC