bgset

1.0.4 • Public • Published

Bgset

🖼 Responsive background images microlibrary (277b gzipped)

Example usage

Bgset requires <script> tag to be present with data attributes

<div class="container">
     <script data-src="/images/original.png" data-bgset="[/images/mobile.png (min-width: 0px) and (max-width: 400px)],[/images/tablet.png, (min-width: 401px) and (max-width: 800px)],[/images/desktop.png, (min-width: 801px)]"></script> 
     <div class="background"> // This element will receive style="background: /images/*.png"
     </div> 
</div>

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i bgset

Weekly Downloads

16

Version

1.0.4

License

MIT

Unpacked Size

8.37 kB

Total Files

6

Last publish

Collaborators

  • mateusz.luczak