XWIKI-23655: Convert print.less to CSS #4808
Open
+108
−112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira URL
https://jira.xwiki.org/browse/XWIKI-23655
Changes
Description
Clarifications
print.lessis declared in flamingo BUT it's used bybootstrap.lessin the bootstrap module.bootstrap.lessis used instyle.less.vmfrom flamingo.print.lessdid not contain variable or mixin declaration, removing it will not break other LESS files from bootstrap in unexpected ways.print.css(that probably existed before we used bootstrap). This makes it so that just renaming the file would be confusing. Instead of creating two filesprint.cssin slightly different places, I decided to move the code previously inprint.lessin the existing file.print.lesswhich was overridden by the flamingo one. Since we now have access to our own bootstrap fork, it's easy to set an(optional)tag on theprint.lessimport so that we don't have to keep an empty file in flamingo..cssfile because the resources were loaded in this order. This allows to keep the**Order of appearance**criteria of the CSS cascade the same as it was and avoid unexpected regressions.print.cssuses the media attribute of thelinkelement to load the stylesheet only in print mode. On the other hand,print.lesswas always loaded but a print media query was above all of its blocks. As far as I understand from https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Media_queries/Printing , there is no difference in the result so we might as well use the same method for both and put them together.Screenshots & Video
Here is a screenshot of the updated source on my local instance (I removed the minimized version to make the change, the fact that it's not getting the minimized version is normal).

Executed Tests
Manual tests on my local instance, see screenshot above.
Successfully built
mvn clean install -f xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources -Pqualityandmvn clean install -f xwiki-platform-core/xwiki-platform-bootstrap/ -Pquality.Expected merging strategy