Created
January 14, 2011 00:02
-
-
Save wilburhimself/778880 to your computer and use it in GitHub Desktop.
Background images with Less.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .bg(@filename, @repeat: 'no-repeat', @left: '0px', @top: '0px') { | |
| background: e(%('url(http://REPLACE WITH THE ABSOLUTE URL OF YOUR IMAGES FOLDER/%s) %s %s %s', @filename, @repeat, @left, @top)); | |
| } | |
| /* | |
| USAGE: | |
| Assuming the background image file is bg.png and the ABSOLUTE URL for our images folder is http://example.com/images this mixing can be used in a declaration like: | |
| .bg("bg.png", "repeat-x"); | |
| which will result in the following CSS: | |
| background: url(http://example.com/images/bg.png) repeat-x 0 0; | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment