Skip to content

Removes deprecated syntax usage in less files.#40612

Open
hostep wants to merge 2 commits intomagento:2.4-developfrom
hostep:remove-deprecated-less-syntax
Open

Removes deprecated syntax usage in less files.#40612
hostep wants to merge 2 commits intomagento:2.4-developfrom
hostep:remove-deprecated-less-syntax

Conversation

@hostep
Copy link
Copy Markdown
Contributor

@hostep hostep commented Mar 21, 2026

Description (*)

Some syntax in .less files is being deprecated. Magento uses some of them. This PR fixes this.
Here's an overview:

DEPRECATED WARNING: Calling a mixin without parentheses is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/css/source/components/_slider.less on line 52, column 28
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/css/source/components/_file-uploader.less on line 118, column 24
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/css/source/components/_file-uploader.less on line 380, column 24
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/css/source/lib/_buttons.less on line 400, column 22
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/css/source/lib/_buttons.less on line 80, column 23
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/css/source/lib/_pages.less on line 275, column 30
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/css/source/lib/_pages.less on line 293, column 30
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/css/source/lib/_rating.less on line 178, column 19
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/adminhtml/Magento/backend/en_US/Magento_AdminNotification/css/source/_module.less on line 112, column 29
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/lib/_buttons.less on line 400, column 22
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/lib/_buttons.less on line 80, column 23
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/lib/_pages.less on line 275, column 30
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/lib/_pages.less on line 293, column 30
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/lib/_rating.less on line 178, column 19
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/luma/en_US/css/source/lib/_buttons.less on line 400, column 22
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/luma/en_US/css/source/lib/_buttons.less on line 80, column 23
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/luma/en_US/css/source/lib/_pages.less on line 275, column 30
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/luma/en_US/css/source/lib/_pages.less on line 293, column 30
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/luma/en_US/css/source/lib/_rating.less on line 178, column 19
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/luma/en_US/Magento_Checkout/css/source/module/checkout/fields/_file-uploader.less on line 135, column 28
DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in var/view_preprocessed/pub/static/frontend/Magento/luma/en_US/Magento_Checkout/css/source/module/checkout/fields/_file-uploader.less on line 398, column 28

Related Pull Requests

N/A

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

  1. Setup clean Magento
  2. Run these commands to set everything up:
$ rm -Rf package-lock.json node_modules/ var/view_preprocessed/ pub/static/adminhtml/ pub/static/frontend/
$ cp package.json.sample package.json
$ npm install
$ composer require baldwin/magento2-module-less-js-compiler:dev-v1-develop
$ bin/magento setup:upgrade
$ bin/magento setup:static-content:deploy en_US -f
$ cp -r pub/static /tmp/magento-static-files-before-changes
  1. Now upgrade less.js to latest version, as it has no more false positives in deprecated warnings, to do so, apply this change to the package.json file:
     "grunt-template-jasmine-requirejs": "~0.2.3",
     "grunt-text-replace": "~0.4.0",
     "imagemin-svgo": "~9.0.0",
-    "less": "4.2.2",
+    "less": "4.6.4",
     "load-grunt-config": "~4.0.1",
     "morgan": "~1.10.0",
     "node-minify": "~3.6.0",
  1. Run these commands:
$ rm -Rf package-lock.json node_modules/ var/log/system.log var/view_preprocessed/ pub/static/adminhtml/ pub/static/frontend/
$ npm install
$ bin/magento setup:static-content:deploy en_US -f
$ grep 'deprecated' var/log/system.log
  1. Notice that the grep command reveals ~93 deprecated warnings from the less compiler

  2. Apply the changes from this PR

  3. Run these commands:

$ rm -Rf var/log/system.log var/view_preprocessed/ pub/static/adminhtml/ pub/static/frontend/
$ bin/magento setup:static-content:deploy en_US -f
$ cp -r pub/static /tmp/magento-static-files-after-changes
$ grep 'deprecated' var/log/system.log
  1. Verify no deprecated warnings from the grep command anymore

  2. Also verify that no important changes happened in the outputted css files by diffing, only the deployed_version.txt file shows up with a change, but that's expected:

$ diff -ur /tmp/magento-static-files-before-changes/ /tmp/magento-static-files-after-changes/

Questions or comments

Should Adobe Commerce / B2B also be checked for the same? I don't have access to those codebases, so I can't help with those.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link
Copy Markdown

m2-assistant bot commented Mar 21, 2026

Hi @hostep. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@hostep
Copy link
Copy Markdown
Contributor Author

hostep commented Mar 21, 2026

@magento run Static Tests

@hostep
Copy link
Copy Markdown
Contributor Author

hostep commented Mar 21, 2026

@magento run Static Tests

@hostep
Copy link
Copy Markdown
Contributor Author

hostep commented Mar 21, 2026

@magento run all tests

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Mar 24, 2026
@github-project-automation github-project-automation bot moved this to Pending Review in Pull Requests Dashboard Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: pending review

Projects

Status: Pending Review

Development

Successfully merging this pull request may close these issues.

2 participants