Skip to content

Instantly share code, notes, and snippets.

@JakeBeresford
Last active January 8, 2016 20:32
Show Gist options
  • Save JakeBeresford/dd84d76e5363060a3d78 to your computer and use it in GitHub Desktop.
Save JakeBeresford/dd84d76e5363060a3d78 to your computer and use it in GitHub Desktop.
HTML5 Picture SublimeText Snippet - for responsive images
<!----------------------------------------------------------------------------
This snippet should be used in conjunction with PictureFill from Scottjehl
https://github.com/scottjehl/picturefill
----------------------------------------------------------------------------->
<snippet>
<content><![CDATA[
<picture>
<source media="(min-width: 64em)" src="${1:high-res.jpg}">
<source media="(min-width: 37.5em)" src="${2:med-res.jpg}">
<source src="${3:low-res.jpg}">
<img src="${4:fallback.jpg}" alt="This picture loads on non-supporting browsers.">
<p>${5:Accessible text.}</p>
</picture>
]]></content>
<tabTrigger>pic</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment