-
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
Dynamically generated mixins suddenly can be used as mixins #1837
Comments
Not quite suddenly :) It was in #1624 PR.
Yes. It's all is almost as usual except the #1399 (comment) first example (note that the third example "experiment" was not included in the PR). In summary: mixins are evaluated before variables so "dynamically generated class" is not available as mixin in the scope of its definition (hence it can't re-define itself by redefining an interpolated variable). I'm not sure, maybe we could close #1399 and open a new issue dedicated to further improvements? (#1399 has too many examples to comment: some of them are implemented in #1624, some do not apply at all, some are more about "selector interpolation" rather than using those as mixins and others need more decisions/discussions). |
@seven-phases-max So, the order is somewhat like this: Another question: Dynamic mixin has to be defined before being used. Was that intentional? Following throws compile error:
|
It's even more nuclear. Variables are replaced with their values after mixins of the same scope are expanded/replaced. It's not in #1624 code, it's just how mixin expansion is made in general, e.g.:
No. The #1624 actually does not change any mixin/variable evaluation/scope stuff, it's just expands |
@seven-phases-max Thanks for the answer. I will play with the feature once I will have some free time. I have none right now :( |
E.g. this:
compiles into:
Was this intentional and do we know how variables scoping works? This works now and people seem to be discovering it. I did not dug into how exactly the feature works, is there anyone who knows?
Related to #1399 and #1836 .
The text was updated successfully, but these errors were encountered: