Magento2: LESS data-uri not work

Created on 2 Sep 2016  路  3Comments  路  Source: magento/magento2

http://lesscss.org/functions/#misc-functions-data-uri

Preconditions

  1. Magento 2.1 EE, Magento 2.1.1 EE

    Steps to reproduce

  2. include to your less file
    .class { background-image: data-uri('../images/image.jpg'); }

  3. run deploy static content
    ./bin/magento setup:static-content:deploy
  4. or run grunt

    Expected result

  5. insert in css base64/utf-8 image source
    .class { background-image: url('data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=='); }

    Actual result

  6. css after deploy
    .class { background-image: url(/var/www/var/view_preprocessed/css/frontend/Theme/default/en_US/images/image.jpg); }

  7. or after run grunt - error msg
    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 馃憤

Frontend Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x bug report triage wanted

All 3 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings