Skip to content

Instantly share code, notes, and snippets.

@vitto
Last active August 29, 2015 14:04
Show Gist options
  • Save vitto/43336ba8160bbe11d109 to your computer and use it in GitHub Desktop.
Save vitto/43336ba8160bbe11d109 to your computer and use it in GitHub Desktop.
Frontsize - Example for backgroundRetinaResponsive mixin
...
// frontsize app.less file inside your theme folder
// you can override your @root-path like in background-size-responsive.less
@use-root-path : true;
@root-path : "/path/to/local/images/";
...
.my-super-background {
.size(100%, 600px);
@backgroundSize : cover;
@baseUrl : "http://placehold.it/";
.backgroundRetinaResponsive(
"1920x600&text=standard-background-on-full-hd",
"3840x1200&text=retina-background-on-full-hd",
"1280x600&text=standard-background-on-hd-ready",
"2560x1200&text=retina-background-on-hd-ready",
"1024x600&text=standard-background-on-tablet-landscape",
"2048x1200&text=retina-background-on-tablet-landscape",
"768x600&text=standard-background-on-tablet-portrait",
"1536x1200&text=retina-background-on-tablet-portrait",
"480x600&text=standard-background-on-smartphone-landscape",
"960x1200&text=retina-background-on-smartphone-landscape",
"320x600&text=standard-background-on-smartphone-portrait",
"640x1200&text=retina-background-on-smartphone-portrait",
@backgroundSize,
@baseUrl
);
}
<div class="my-super-background"></div>
@vitto
Copy link
Author

vitto commented Jul 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment