Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide error when mixin results in [object Object] value #4305

Open
matthew-dean opened this issue Jan 2, 2025 Discussed in #4304 · 1 comment
Open

Provide error when mixin results in [object Object] value #4305

matthew-dean opened this issue Jan 2, 2025 Discussed in #4304 · 1 comment

Comments

@matthew-dean
Copy link
Member

Discussed in #4304

Originally posted by uncenter December 31, 2024
I have a mixin called rgbify, as seen below:

#rgbify(@color) {
  @rgb: red(@color), green(@color), blue(@color);
}

It can be used as color: #rgbify(#fff)[];, and note the [] to capture the return value(s). Without the [] (just #rgbify(#fff)), Less outputs [object Object] as the value for wherever the mixin is used. I most definitely did not mean to have the value be [object Object], and I'm hoping Less could error when it encounters a value like that - otherwise i have no good way of knowing I missed it if I'm not looking carefully/specifically for that mistake.

image

@matthew-dean
Copy link
Member Author

If I recall, there was supposed to be an evaluation error if evaluating a ruleset as value, so this may be an implementation bug or regression.

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

No branches or pull requests

1 participant