Skip to content

Reference import incorrectly outputs @media mixin calls #138

Description

@Tahakk

Bug: Reference imports with mixin calls are incorrectly output

Environment

  • less.js version: 3.13.1
  • less.php version: 5.5.0
  • PHP version: 8.4

Minimal Reproduction
style.less:

.mq-max(@max; @rules) {
	@media only screen and (max-width: (@max - 1)) {
		@rules();
	}
}

@import (reference) 'control.less';

controls.less:

.btn {
	color: red;

	.mq-max(1420px, {
		color: green;
	});
}

.btn {
	color: blue;

	@media only screen and (max-width: 1419px) {
		color: yellow;
	}
}

Expected Output (like less.js)

/* empty, because reference imports do not output anything */

Actual Output (less.php)

@media only screen and (max-width: 1419px) {
	.btn {
		color: green;
	}
}

Additional Notes

  • When a mixin is defined in a reference-imported file it is ignored (correct behavior).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions