The problem with the url() function when using data URL #3907
Replies: 1 comment 3 replies
-
I have identified the problem, the Merge CSS Files feature in OpenMage config. Most likely, when OpenMage concatenates the CSS files creating a single one, it also alters the links in the URL's, adding the absolute path where that file is located. This explains why all Bootstrap links are affected. The problem is not only that it adds links, but that it also alters parts of the existing string. Here is the proof Before merging url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'
} After merging url("https://www.mydomain.tld/skin/frontend/default/custom_theme/css/data:image/svg+xml,%3csv")xmlns='http://www.w3.org/2000/svg'
} %3csvg becomes %3csv)" => g is replaced by ") As a temporary solution, I moved the Bootstrap CSS file out of the merging process so that it is no longer concatenated, but this issue requires an investigation. Regarding this feature in OpenMage, opinions have been divided over time, some use it, others don't, choosing for Magento extensions, CDNs, HTTP/2. My opinion is that as long as it is still in the OpenMage code and creates problems, it must be fixed. |
Beta Was this translation helpful? Give feedback.
-
I have to revamp a whole OpenMage theme based on Bootstrap 5.3 (I tried Tailwind+DaisyUI before but I don't have too much time for learning new stuff). I discovered this issue when I tried implementing a modal. The close X sign was not appearing in the modal box, then I inspected the CSS code.
This is the Bootstrap CSS file content for the .btn-close class:
This is the CSS file from the browser cache for the same class:
As can be seen, the path where the bootstrap.css file is located was taken in the url() function even it is a data URL. Did anyone encountered this issue and how could I avoid it and stop adding the absolute path? There are too many Bootstrap classes that have this issue.
Beta Was this translation helpful? Give feedback.
All reactions