blueimp / Gallery

blueimp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading.
https://blueimp.github.io/Gallery/
Other
3.75k stars 983 forks source link

Use Less data-uri to inline css assets instead of relying on relative… #202

Closed danielwestendorf closed 9 years ago

danielwestendorf commented 9 years ago

… URLs

Problem

A common pain point is making sure that image assets are available at a relative URL. This isn't always possible, or users of the library may forget.

Solution

Less now provides the data-uri function which Base64 encodes the image directly into the CSS. The reduces network overhead for data that is likely going to be retrieved anyway, removing the dependency on relative URLs.

blueimp commented 9 years ago

Thanks for your contribution, @danielwestendorf. For a production website I totally agree with you, it makes sense to use a data-uri instead. For this demo though I only use LESS as a minifier and prefer to keep the pre-compiled version as working CSS.