-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Import as reference outputs results of each() functions #3402
Comments
Actually it is expected behavior. |
Okay splitting would probably work. Just realized that I probably can't use the classes I generate using I guess I should do something like this:
So that way I could use the variables and the generated classes.. I think. Gonna cost me a lot of refactoring and probably a more complicated gulp task to pre-process it all though :P |
Personally I'd say never use CSS classes as mixins (except very very rare very very special cases)... Whatever they say. It's just structured beauty vs. unstructured mess). Either way, what is the point of using such generated classes as mixins? What your really need is just:
(That's another common mistake: "trying to encode mixin parameters into its name"). |
Sorry for taking my time to respond. The reason I generate these "class mixins" instead of using functions is that I was planning to be able to use these in html, too:
Another use-case would be a grid system that is generated using each() so one wouldn't have to write every col-x-y rule by hand.
It could be useful to import this grid by reference and use it in css..? Maybe I'm not thinking this through ;)
Anyway, I've refactored everything so I import variables (as less) and classes (as css) separately so it all works fine. |
When I use a reference import that includes a each() function, the result of that each() will be outputted in the css.
Example:
Will output:
This seems to be undesired behaviour. The documentation states:
http://lesscss.org/features/#import-atrules-feature-reference
The text was updated successfully, but these errors were encountered: