UNPKG

ab-interchange

Version:

AB-interchange: While responsive image loading is not really an easy task even today, here is a solution to manage conditional (based on breakpoints) loading of img, background-image or even HTML content.

22 lines (19 loc) 654 B
import Prism from 'prismjs/components/prism-core'; import 'prismjs/components/prism-clike'; import 'prismjs/components/prism-javascript'; import 'prismjs/themes/prism.css'; AB.plugins.mediaQuery({ bp: { smallOnly: 'screen and (max-width: 767px)', mediumOnly: 'screen and (min-width: 768px) and (max-width: 1024px)', medium: 'screen and (min-width: 768px)', largeOnly: 'screen and (min-width: 1025px) and (max-width: 1280px)', large: 'screen and (min-width: 1025px)' } }); AB.plugins.interchange({ lazySettings: { offscreen: 1.25, layout: 'fluid' // can be "fixed" to fixed dimensions (not fluid) } });