picturefill

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

  • 所有者: scottjehl/picturefill
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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.

主要指标

概览
名称与所有者scottjehl/picturefill
主编程语言JavaScript
编程语言HTML (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2012-02-21 08:35:14
推送于2022-09-06 15:00:20
最后一次提交2022-09-06 11:00:20
发布数24
最新版本名称3.0.3 (发布于 2017-03-20 17:14:46)
第一版名称initial (发布于 2013-02-27 08:58:27)
用户参与
星数9.9k
关注者数341
派生数1.1k
提交数805
已启用问题?
问题数430
打开的问题数1
拉请求数160
打开的拉请求数0
关闭的拉请求数122
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?