Compass mixin for data URIs
Not sure if you've heard of this before, but Compass comes with a function to convert an image asset into a base64 data URI, using #{inline_image()}
An example:
.layer.padded
background: rgb(203,210,216) #{inline_image("pinstripes.png")}
See: https://github.com/chriseppstein/compass/commit/5a015b3824f280af56f1265bf8c3a7c64a252621
Written by Shaun O'Connell
Related protips
1 Response
Thanks for this. I am familiar with doing this on the command line with openssl base64 and just thought "I wonder if compass...". :)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#