Remove the new LessCSS URL rewriting in favor of a different approach.

Review Request #11048 — Created June 19, 2020 and submitted — Latest diff uploaded

Information

Djblets
release-2.0.x

Reviewers

The introduction of the new spinners brought along with it the usage of
a new LessCSS option, --rewrite-urls=all. The idea of this was to
allow consumers of a stylesheet have any URLs within it rewritten, so
that a variable that referenced a path relative to the LessCSS file
would be updated to point to the same file in the included stylesheet,
no matter where that stylesheet was located.

This worked fine for simple cases, but it broke down if all consumers of
the stylesheet didn't also use this option (which could break other
third-party stylesheets) and it triggered a LessCSS bug where URLs
passed by a consuming spreadsheet into a mixin that used detailed
rulesets would have their URLs rewritten to be relative to the file tha
defined the detached ruleset, breaking the URL.

We therefore can't use this option. This change turns it off, reverts
some updated URLs.

Since the original need was based on the spinner, the spinner now uses a
new approach. Instead of a path relative to the current file, it now
uses a path relative to the include path: djblets/images/....

This normally wouldn't work for image references, as it's intended for
@import statements, but data-uri() searches the include path, so we
can get away with it.

Tested building a package successfully, to make sure all media compiled.

Tested with Review Board, for standalone spinners, spinners on buttons
(which needed the previous URL-rewriting behavior), and datagrid icons
(as that was impacted by the URL rewriting).

Commits

Files

    Loading...