Skip to content

Conversation

puckowski
Copy link
Contributor

What:

Fixes issue #4339

This Less:

@spacing-top: 4px;
@spacing-bottom: 4px;
@border-width: 4px;
@border-color: #444;

.divider-bottom(
    @spacing-top: @spacing-top,
  @spacing-bottom: @spacing-bottom,
  @border-width: @border-width,
  @border-color: @border-color
) {
  margin-top: @spacing-top;
  margin-bottom: @spacing-bottom;
  border-bottom: @border-width solid @border-color;
}

div {
  .divider-bottom(
  @spacing-top,
  @spacing-bottom,
  @border-width,
  @border-color
);
}

div {
  .divider-bottom ( @spacing-top,
@spacing-bottom,
  @border-width,
  @border-color
);
}

div {
  .divider-bottom (@spacing-top,
@spacing-bottom,
  @border-width,
  @border-color
);
}

div {
  .divider-bottom(@spacing-top,
@spacing-bottom,
  @border-width,
  @border-color
);
}

yields the following deprecation notices:

less.js:11431 DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in http://172.25.80.1:8000/test.less on line 27, column 19:
27   .divider-bottom ( @spacing-top,

warn @ less.js:11431Understand this warning
less.js:11431 DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in http://172.25.80.1:8000/test.less on line 35, column 19:
35   .divider-bottom (@spacing-top,

which should resolve false positive deprecation notices for syntax like:

.divider-bottom(
  @spacing-top,
  @spacing-bottom,
  @border-width,
  @border-color
);

Why:

Many users have reported the false positive behavior and wish to not see the notice or have to rewrite their valid Less.

Checklist:

  • Documentation
  • Added/updated unit tests
  • Code complete

* Fix issue less#4339 by limiting the whitespace check for the deprecation
  notice to not produce false positives.
* Correct deprecation notice for issue less#4339.
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 30, 2025
@hostep
Copy link

hostep commented Sep 16, 2025

What needs to happen to release this fix in a new stable version? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants