Skip to content

mateuszluczak/bgset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🖼 277b microlibrary for responsive backgrounds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published