{"id":293636,"date":"2019-08-01T14:07:59","date_gmt":"2019-08-01T21:07:59","guid":{"rendered":"https:\/\/css-tricks.com\/?p=293636"},"modified":"2021-04-15T08:47:53","modified_gmt":"2021-04-15T15:47:53","slug":"weekly-platform-news-preventing-image-loads-with-the-picture-element-the-web-we-want-svg-styles-are-not-scoped","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/weekly-platform-news-preventing-image-loads-with-the-picture-element-the-web-we-want-svg-styles-are-not-scoped\/","title":{"rendered":"Weekly Platform News: Preventing Image Loads with the Picture Element, the Web We Want, Svg Styles Are Not Scoped"},"content":{"rendered":"

In this week’s week roundup of browser news, a trick for loading images conditionally using the picture element, your chance to tell bowser vendors about the web you want, and the styles applied to inline SVG elements are, well, not scoped only to that SVG.<\/p>\n

Let’s turn to the headlines…<\/p>\n

<\/p>\n

Preventing image loads with the picture element<\/h3>\n

You can use the <picture><\/picture><\/code> element to prevent an image from loading if a specific media query matches the user\u2019s environment (e.g., if the viewport width is larger or smaller than a certain length value). [Try out the demo:<\/p>\n

\n See the Pen
\nvoZENR<\/a> by \u0160ime Vidas (
@simevidas<\/a>)
\non
CodePen<\/a>.<\/span><\/p>\n

<picture>\n  <!-- show 1\u2a2f1 transparent image if viewport width \u2264 40em -->\n  <source media=\"(max-width: 40em)\" srcset=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\">\n\n  <!-- load only image if viewport width > 40em -->\n  <img src=\"product-large-screen.png\">\n<\/picture><\/code><\/pre>\n

(via Scott Jehl<\/a>)<\/small><\/p>\n

The Web We Want<\/h3>\n
\"\"<\/figure>\n

The Web We Want (webwewant.fyi<\/a>) is a new collaboration between browser vendors that aims to collect feedback from web developers about the current state of the web. You can submit a feature request on the website (“What do you want?””) and get a chance to present it at an event (An Event Apart, Smashing Conference, etc.).<\/p>\n

(via Aaron Gustafson<\/a>)<\/small><\/p>\n

In other news<\/h3>\n