http://lesscss.org/functions/#misc-functions-data-uri
Magento 2.1 EE, Magento 2.1.1 EE
include to your less file
.class { background-image: data-uri('../images/image.jpg'); }
./bin/magento setup:static-content:deploy
or run grunt
insert in css base64/utf-8 image source
.class { background-image: url('data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=='); }
css after deploy
.class { background-image: url(/var/www/var/view_preprocessed/css/frontend/Theme/default/en_US/images/image.jpg); }
RuntimeError: error evaluating function 'data-uri': ENOENT: no such file or directory, open 'pub/static/frontend/Theme/default/en_US/images/image.jpg' in pub/static/frontend/Theme/default/en_US/css/source/_image.less
~~
It's works only with grunt and if set app/design full path for image
.class { background-image: data-uri('../../../../../../../app/design/frontend/Theme/default/web/images/image.jpg'); }
Shitcode, shitcode everywhere 馃憤
@denis-g, thank you for your report.
We've created internal ticket(s) MAGETWO-82196 to track progress on the issue.
Hi @denis-g
This ticket has been marked as "Triage Wanted"
due to low user involvement over time. Over the next 2 weeks we are looking for additional community feedback to decide if it should be archived or not. More information on this is available on the GitHub wiki.
Thank you for collaboration.
@denis-g thank you for your report.
Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.
You may learn more about this initiative following this link.
Please feel free to comment or reopen the ticket if you think it should be reviewed once more. Thank you for collaboration.