From 44696f3dcc8266dc16046f44c2cb7c8a734d312f Mon Sep 17 00:00:00 2001 From: IanM Date: Wed, 25 Feb 2026 16:34:26 +0000 Subject: [PATCH] docs: document wikimedia/less.php 4.x to 5.x upgrade Adds a less.php dependency entry under the Dependencies section and a breaking change bullet under LESS Preprocessing for the math expression behaviour change in CSS custom properties introduced with Less.js 3.5+. Co-Authored-By: Claude Sonnet 4.6 --- docs/extend/update-2_0.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/extend/update-2_0.md b/docs/extend/update-2_0.md index fbab3258e..3aa7e9400 100644 --- a/docs/extend/update-2_0.md +++ b/docs/extend/update-2_0.md @@ -180,6 +180,10 @@ In `composer.json`: * If you have a `php` requirement, make sure it is not below `^8.2`. * If you have `blomstra/gdpr` as a requirement, change it to `"flarum/gdpr": "*"`. +#### wikimedia/less.php (updated from 4.x to 5.x) + +Flarum 2.0 upgrades the LESS compiler to less.php 5.x. Most extensions will not need to make any changes to their PHP code, as the breaking changes were handled internally by Flarum core. However, there is one LESS language behaviour change that may affect your stylesheets — see [LESS Preprocessing](#less-preprocessing) below. + #### Carbon 3 ##### Breaking @@ -339,6 +343,21 @@ Checkout the [database documentation](./database) for more details. } ``` +* Math expressions inside CSS custom properties are no longer evaluated by the LESS compiler (this aligns with Less.js 3.5+ behaviour). If your extension performs arithmetic inside a custom property declaration, it will now be output as a literal string instead of a computed value: + ```less + // before: outputs --spacing: 32px + @base: 16px; + --spacing: @base * 2; + + // after: use a regular LESS variable for the calculation, then assign + @base: 16px; + @spacing: @base * 2; + --spacing: @spacing; + + // or use calc() if the calculation must remain in CSS + --spacing: calc(@base * 2); + ``` + ##### Notable * New high contrast color schemes have been added. * You can register more color schemes through the new frontend `Theme` extender and equivalent CSS code `[data-theme=your-scheme]`.