The following generates a base64 inline-image using sass/compass:
background-image:inline-image("paper.jpg", 'image/jpg');
Is there a way to do multiple background images, or do I have to precompress them myself to do it?
Thanks.
The inline-image function just outputs the url() string, so you can use multiple by doing this:
background: inline-image("front-image.jpg", 'image/jpg') no-repeat, inline-image("back-image.jpg", 'image/jpg') repeat-x
And you'll get the following css:
background: url('data:"image/jpg";base64,FRONTIMAGEDATAHERE') no-repeat, url('data:"image/jpg";base64,BACKIMAGEDATAHERE') repeat-x;
I added "no-repeat" and "repeat-x" otherwise the front-image will repeat and cover the back-image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With