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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?