fix: take snippets into account when scoping css selectors #10208
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 an attempt to fix #10143
The CSS scoping logic is enhanced to take render tags into account - if one is found as the child of an element, we assume that the selector might match at runtime when combining the element(s) above the render tag and the element(s) inside the snippet. This doesn't do any advanced static analysis checks, so there can be false positives. I also notices that it's not enough to just check the current element for render tags, we need to do that recursively. I'm not sure I'm going down the right path doing this though, so I'm going to leave this as a draft for now for others that have worked in this code area before to take a look first.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint