Page MenuHomePhabricator

[mixins-important] Support "!important" for mixins that have nested parameters.
Closed, ResolvedPublic

Details

Event Timeline

Krinkle triaged this task as Medium priority.Jan 5 2024, 9:53 PM

The !important flag on mixin call prevented proper evaluation of variables inside nested mixins. See #2394

 .size(@aaa: auto) {
	.set-width(@aaa) {
	  width: @aaa;
	}
	.set-width(@aaa);
  }
  .when-calling-nested-issue-2394 {
	.size() !important;
  }
  .when-calling-nested-with-param-issue-2394 {
	.size(10px) !important;
  }

The above returns an error:

PHP Fatal error:  Uncaught Less_Exception_Compiler: variable @aaa is undefined in file ..test.less in test.less on line 4, column 11
2|   .size(@aaa: auto) {
3| 	.set-width(@aaa) {
4| 	  width: @aaa;
5| 	}
6| 	.set-width(@aaa);
7|   }

Change 991880 had a related patch set uploaded (by Hokwelum; author: Hokwelum):

[mediawiki/libs/less.php@master] Support !important in nested mixins

https://gerrit.wikimedia.org/r/991880

Change 991880 merged by jenkins-bot:

[mediawiki/libs/less.php@master] Support !important in nested mixins

https://gerrit.wikimedia.org/r/991880