Joel Mellon
Joel Mellon

Reputation: 43

Magento CSS property background-image:url issue with data:image/svg+xml;base64

Magento page rendering forces the ccs property background-image:url() to add the domain and directories from the root for values that are base 64 encoded images. For example background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxu....)

will be rendered background-image:url(http://domain.com/path-to-css/data:image/svg+xml;base64,PHN2ZyB4bWxu....).

I am looking for a CSS switch/setting that forces the application to recognize it is encoded data instead of a URL requiring relative completion. This generates a 404 error for the non existent image and never renders the encoded image.

Upvotes: 2

Views: 2183

Answers (2)

sTE
sTE

Reputation: 21

It is a bug in Magento css and js combine, minifier. If you turn css combine off, it will work perfectly.

How to turn on/off: http://www.metacdn.com/speed-up-magento/combine-and-minify-js-css

Upvotes: 2

Joel Mellon
Joel Mellon

Reputation: 43

This is related to the doc type. base64 images work in html 5 doc types, i.e. !DOCTYPE html . My magneto current configuration !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" .

Upvotes: -1

Related Questions