Conversation
This is a preparation for using the new Less utils from `ipl\Web` to simplify the comparison of the old and new stylesheets.
This reverts commit 7c58b3c. Remove variable exports as they were never used in our modules or community modules, and using this feature is discouraged.
Replace the in-tree `Icinga\Less\` visitor layer with its equivalents from `ipl\Web\Less`, where the same color-variable and light-mode functionality is maintained as a shared library. `LessCompiler` is updated to delegate to `WikimediaLessCompiler`, assembling source via `@import (less)` directives and accepting a `$minify` flag directly on `render()` rather than through a separate `compress()` call.
Add missing PHP type declarations to properties and methods, replace long-form `array()` syntax with short `[]` syntax, tighten PHPDoc comments, and correct "LESS" to "Less".
ipl-webipl\Web\Less
lippserd
commented
Apr 10, 2026
| ); | ||
|
|
||
| if (in_array($path, $special)) { | ||
| putenv('ICINGAWEB_ENVIRONMENT=production'); |
Member
Author
There was a problem hiding this comment.
Please note that this must be removed before merging the PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Because the in-tree Less visitor requires
wikimedia/less.php, that dependency has to live inicinga-php-thirdparty.icinga-php-libraryalready carries Less-related code with the same dependency, so this PR consolidates everything intoicinga-php-libraryand removes the duplicate in-tree implementation.Icinga\Less\visitor layer in favor of the sharedipl\Web\Lesslibrary, which maintains modernized equivalent CSS var replacement and light-mode functionality.LessCompiler— the feature was never used by any our modules or community modules.LessCompilerto delegate toipl\Web\Less, assembling sources via@import (less)directives; pass the$minifyflag directly torender()instead of via a separatecompress()call.LessCompilerwith PHP type declarations, short array syntax, and tightened PHPDoc.For testing, use 7da4917 as the baseline, which adapts light mode rule evaluation order to match the new visitor.
Here is my test summary:
The stylesheets are nearly identical. All but one difference are cosmetic normalizations introduced by the new version of the wikimedia Less parser:
.5em→0.5em#dddddd→#ddd#ffffff→white,#ff0000→redtransparent→rgba(0,0,0,0)var()expressions.0stripped2.0em→2em,1.0→1calc()kept as fractionscalc(14.28571429%)→calc(100% / 7)1em→1em/1There is one functional difference: the light-mode background color gains an extra level of indirection via a new CSS var call (because it uses
@light-body-bg-color):The new CSS var replacement visitor from
ipl\Webruns independently from the light mode call visitor, and therefore also adds var overrides to such detached rulesets. Everything else is normalization noise.closes #5457
requires Icinga/icinga-php-thirdparty#115
requires Icinga/ipl-web#365