Open lukewarlow opened 10 months ago
Just a quick note on how much of this could be polyfilled for older browsers.
Can be polyfilled:
<link media="..." rel="stylesheet">
<link href="..." media="..." rel="icon">
<meta name="theme-color" media="..." content="...">
<source media="..." type="...">
<meta name="color-scheme" content="...">
color-scheme
Cannot be polyfilled:
@media (...) { ... }
@import (...) media-query-list
Unfortunately @media is one of the main benefits of this API.
@media
Based on https://github.com/GoogleChromeLabs/container-query-polyfill it may be possible to transpile the preference media queries for <style> and same-origin <link> elements
<style>
<link>
Just a quick note on how much of this could be polyfilled for older browsers.
Can be polyfilled:
<link media="..." rel="stylesheet">
(using the disabled attribute)<link href="..." media="..." rel="icon">
(modifying the href attribute)<meta name="theme-color" media="..." content="...">
(modifying the name attribute)<source media="..." type="...">
(modifying the type attribute)<meta name="color-scheme" content="...">
(overriding the content attribute)color-scheme
CSS property (by overriding the CSS property value)Cannot be polyfilled:
@media (...) { ... }
(CSS media queries cannot always be polyfilled)@import (...) media-query-list
(CSS imports cannot be polyfilled)Unfortunately
@media
is one of the main benefits of this API.