picturefill

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

  • Owner: scottjehl/picturefill
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Picturefill

A responsive image polyfill.

build-status picturefill on npm

Picturefill has three versions:

  • 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.

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:

<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

Issues

If you find a bug in Picturefill, please add it to the issue tracker

Discussion

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

Support

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

Main metrics

Overview
Name With Ownerscottjehl/picturefill
Primary LanguageJavaScript
Program languageHTML (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2012-02-21 08:35:14
Pushed At2022-09-06 15:00:20
Last Commit At2022-09-06 11:00:20
Release Count24
Last Release Name3.0.3 (Posted on 2017-03-20 17:14:46)
First Release Nameinitial (Posted on 2013-02-27 08:58:27)
用户参与
Stargazers Count9.9k
Watchers Count341
Fork Count1.1k
Commits Count805
Has Issues Enabled
Issues Count430
Issue Open Count1
Pull Requests Count160
Pull Requests Open Count0
Pull Requests Close Count122
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private