I was trying to wrap PHP DebugBar inside a Flarum extension and pretty much hit a wall.
The CSS gets destroyed because the /
between two numbers of pixels in the source files is parsed as a calculation. (I register assets directly from the debugbar composer package)
This seems to be a valid CSS syntax (probably recent) and has nothing to do with math. In this case it impacts the background positions. This syntax can also be used for font sizes and probably other things.
From what I've seen, Flarum does not distinguish between CSS and LESS files, they all go through the LESS parser at the end. So I don't think I can disable this behavior while still using Flarum assets management. I could pre-parse the file to add escape symbols around these /
but this won't be very efficient...
A solution would be to configure LESS with the StrictMath option so all calculations need to be placed in parenthesis. Some extensions may need to update the math in their LESS files, so this could be a good thing to do before stable if we enable this setting.
Has anybody faced this problem ? Is it too dangerous to enable this option for Flarum ?
The pull request is very easy to do. However I have no idea about the implications it would have on existing and future extensions...