Experimental support for mixins with interpolated selectors #1624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Experimental support for mixins with interpolated selectors (#1196).
This is no doubt hackish patch (quick and dirty). However since it introduces no breaking changes I hope it can serve as a temporary solution for #1196, #1399.
What is supported: see included tests.
What is not supported: matching for selectors concatenated across nesting boundary (the same way and for the same reason this does not work with regular mixins), i.e.:
Furthermore, this patch does not solve any scope visibilty problems mentioned in #1399.
Undocumented feature:
Though this patch allows a variable to contain whatever complex selector it might be and such selector will be matched correctly, for example:
It would make sense to leave this undocumented and never recommend to use anything like this because such possibility may be not so easy to support in future. So basically, a recommendation is: a variable used in an interpolated selector should not contain anything beyond a single selector element and/or a naked string (e.g.
foo
,~".foo"
or~"#foo"
).