mikke89 / RmlUi

RmlUi - The HTML/CSS User Interface library evolved
https://mikke89.github.io/RmlUiDoc/
MIT License
2.57k stars 295 forks source link

RCSS Sprite sheet src doesn't support url(path) or "path" #571

Closed andreasschultes closed 5 months ago

andreasschultes commented 5 months ago

This is an issue if a css preprocessor like sass is used. Because the path results in some cases into a syntax error.

I think before storing value the "" should be removed. And in addition the url variant should also be supported.

Core/StyleSheetParser.cpp:118

The definition of url is defined here: https://www.w3.org/TR/css-values-4/#urls

I think image is also affected by this issue.

I can make a pull request to fix this.

mikke89 commented 5 months ago

Right, I think it makes sense to use the same parsing rules as for other strings, looks like we don't do that. This way we should get behavior such as double quotes for free. We could make it so by adding a string parser for the src property.

This won't give us support for url() though. Hm, I am more reluctant about this. I don't see how we benefit from that internally right now, and I don't feel like we should add complexity just for the sake of easing compliance with certain external tools and pipelines.

andreasschultes commented 5 months ago

image property works with "path"

andreasschultes commented 5 months ago

I think the url and src properties are only useful if we have/use css variables, so I think the using of the String parser if enough for now.