This repository has been archived by the owner on May 14, 2021. It is now read-only.
feat(selector-guessing): improve guess at selector #281
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.
This is a bit of a selfish PR, but I was thinking we could be just a bit smarter about guessing whether an interpolation is a selector or not. I don't think that
&
and>
aren valid tokens in CSS for anything other than as part of a selector, so we could use those to reduce the need for sc tags. This helps in cases like the following (very common in our code base, don't know how common in others):SomeChild
would not be identified as a selector since it is part of a list of selectors. Commas are valid CSS tokens in lots of scenarios, so looking for that is not really an option, but&
and>
are only valid as part of a selector (I don't think 🤔 ), so it would at least cover those. Thoughts? Am I way off base here?