Skip to content

Instantly share code, notes, and snippets.

@vitto
Last active August 29, 2015 14:03
Show Gist options
  • Save vitto/615b72591549762143a1 to your computer and use it in GitHub Desktop.
Save vitto/615b72591549762143a1 to your computer and use it in GitHub Desktop.
Frontsize - How to use backgroundRetina mixin
...
// case for first-background
@use-root-path : false;
...
// case for second-background
@use-root-path : true;
@root-path : "http://placehold.it/";
...
// case for third-background, .third-background shows how to override the app.less @root-path
@use-root-path : true;
@root-path : "http://my-website.com/";
...
<div>First example</div>
<div class="first-background bottom-margin"></div>
<div>Second example</div>
<div class="second-background bottom-margin"></div>
<div>Third example</div>
<div class="third-background"></div>
.first-background {
.size(650px, 300px);
.backgroundRetina("http://placehold.it/650x300", "http://placehold.it/1300x600", cover);
}
.second-background {
.size(100%, 300px);
.backgroundRetina("650x300", "1300x600", cover);
}
.third-background {
.size(100%, 300px);
.backgroundRetina("650x300", "1300x600", cover, "http://another-website.com/");
}
@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