2017 © Pedro Peláez
 

component picturefill

A responsive image polyfill for <picture>, srcset, sizes, and more.

image

scottjehl/picturefill

A responsive image polyfill for <picture>, srcset, sizes, and more.

  • Monday, March 20, 2017
  • by ricg
  • Repository
  • 403 Watchers
  • 9696 Stars
  • 2,358 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1066 Forks
  • 37 Open issues
  • 17 Versions
  • 12 % Grown

The README.md

Picturefill

A responsive image polyfill. * Authors: See Authors.txt * License: MIT, (*1)

This project is archived and deprecated!

At the time, it helped us transition to responsive image HTML patterns until browsers supported them. Support and fallback strategies are now very good, and this project is no longer needed or recommended. Thanks everyone!`, (*2)

build-status Join Slack channel picturefill on npm, (*3)

Picturefill has three versions:, (*4)

  • Version 1 mimics the Picture element pattern with span elements. It is no longer maintained.
  • Version 2 is a lightweight polyfill of the Picture element draft specification.
  • Version 3.0.3 is the current stable release.

Usage, Demos, Docs

To find out how to use Picturefill, visit the project site., (*5)

The gotchas

Be it browser issues, the responsive images specifications, or Picturefill itself, there are a couple gotchas you should be aware of when working with Picturefill:, (*6)

  • Firefox 38 and 39 has some bugs [1] [2] [3] where images won't update on screen resize. These issues are addressed by Picturefill 3.0.0, and was fixed in Firefox 41., (*7)

  • Per the picture spec, using % isn't allowed in the sizes attribute. Using % will fallback to 100vw., (*8)

  • Trying to use the src attribute in a browser that doesn't support picture natively can result in a double download. To avoid this, don't use the src attribute on the img tag:, (*9)

<picture>
    <source srcset="../img/sample.svg" media="(min-width: 768px)" />
    <img srcset="default.png" alt="Sample pic" />
</picture>
  • If you only want to have an image show up at certain sizes, and not show up at others, you will need to use a transparent placeholder gif:
<picture>
    <source srcset="../img/sample.svg" media="(min-width: 768px)" />
    <img srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
        alt="Sample pic" />
</picture>

Contributing

For information on how to contribute code to Picturefill, check out CONTRIBUTING.md, (*10)

Issues

If you find a bug in Picturefill, please add it to the issue tracker, (*11)

Discussion

Picturefill discussion takes place via Slack. For an invitation, visit https://pf-slackin.herokuapp.com/, (*12)

Support

There are currently no known unsupported browsers, provided that you use the markup patterns provided., (*13)

The Versions

20/03 2017

dev-master

9999999-dev http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

20/03 2017

3.0.3

3.0.3.0 http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

19/06 2016

dev-export-attr-method

dev-export-attr-method http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

12/04 2016

3.0.x-dev

3.0.9999999.9999999-dev http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

25/02 2016

dev-respect-initial-src

dev-respect-initial-src http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

12/02 2016

3.0.2

3.0.2.0 http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

12/02 2016

dev-pf-sizes-test-2

dev-pf-sizes-test-2 http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

12/02 2016

dev-pf-sizes-test

dev-pf-sizes-test http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

05/02 2016

dev-remove-unused-mime-types

dev-remove-unused-mime-types http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

05/02 2016

dev-deprecate-picturefill-json

dev-deprecate-picturefill-json http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

10/11 2015

dev-pf3-plugin-docs

dev-pf3-plugin-docs http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

06/10 2015

dev-update-stable-version

dev-update-stable-version http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

30/09 2015

3.0.1

3.0.1.0 http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

30/09 2015

3.0.0

3.0.0.0 http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

08/09 2015

3.0.0-rc1

3.0.0.0-RC1 http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

05/08 2015

dev-saveData-cached

dev-saveData-cached http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT

10/07 2015

3.0.0-beta1

3.0.0.0-beta1 http://scottjehl.github.com/picturefill/

A responsive image polyfill for <picture>, srcset, sizes, and more.

  Sources   Download

MIT