Skip to content

Commit 0e178ab

Browse files
imorlandclaude
andauthored
docs: document wikimedia/less.php 4.x to 5.x upgrade (#504)
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 <noreply@anthropic.com>
1 parent 8c93f7b commit 0e178ab

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

docs/extend/update-2_0.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ In `composer.json`:
180180
* If you have a `php` requirement, make sure it is not below `^8.2`.
181181
* If you have `blomstra/gdpr` as a requirement, change it to `"flarum/gdpr": "*"`.
182182

183+
#### wikimedia/less.php (updated from 4.x to 5.x)
184+
185+
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.
186+
183187
#### Carbon 3
184188

185189
##### <span class="breaking">Breaking</span>
@@ -339,6 +343,21 @@ Checkout the [database documentation](./database) for more details.
339343
}
340344
```
341345

346+
* 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:
347+
```less
348+
// before: outputs --spacing: 32px
349+
@base: 16px;
350+
--spacing: @base * 2;
351+
352+
// after: use a regular LESS variable for the calculation, then assign
353+
@base: 16px;
354+
@spacing: @base * 2;
355+
--spacing: @spacing;
356+
357+
// or use calc() if the calculation must remain in CSS
358+
--spacing: calc(@base * 2);
359+
```
360+
342361
##### <span class="notable">Notable</span>
343362
* New high contrast color schemes have been added.
344363
* You can register more color schemes through the new frontend `Theme` extender and equivalent CSS code `[data-theme=your-scheme]`.

0 commit comments

Comments
 (0)