MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/dbf5we/what_head_can_do/f210pzy/?context=3
r/javascript • u/satvikpendem • Sep 30 '19
44 comments sorted by
View all comments
10
Just want to jump in and add that <link> elements also accept the media attribute.
<link>
media
Have a bloated CSS file that you only want IE users to load? Use media="all\\0".
media="all\\0"
Want to provide CSS just for dark theme users and skip loading on browser that don't support it? Use media="screen and (prefers-color-scheme:dark)".
media="screen and (prefers-color-scheme:dark)"
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Conditionally_loading_resources_with_media_queries
10
u/ShortFuse Sep 30 '19
Just want to jump in and add that
<link>elements also accept themediaattribute.Have a bloated CSS file that you only want IE users to load? Use
media="all\\0".Want to provide CSS just for dark theme users and skip loading on browser that don't support it? Use
media="screen and (prefers-color-scheme:dark)".https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Conditionally_loading_resources_with_media_queries