-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Support pseudoelements in CSS scoping #25270
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, it might be good to compile a table of the things "we care" about to make sure we didn't forget anything else.
Just saying this because it's hard for me to think of all the possible cases we need to handle without listing them.
src/Razor/Microsoft.AspNetCore.Razor.Tools/test/RewriteCssCommandTest.cs
Show resolved
Hide resolved
It's a good point. The unit tests are meant to be the statement of what cases are relevant, but it's definitely useful to get a secondary confirmation that they are broad enough. To do this I've just compared against the cases supported by Vue, and it turns out we already did cover all of them with one exception (leading pseudoelements) that I've now added in the latest commit. |
Not that anybody should ever want to do this
Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge. |
Approved for RC1 pending CI completion. |
Fixes #25268
Without this, the new test cases
HandlesPseudoElements
andHandlesSingleColonPseudoElements
(added in this PR) would fail.Note that the new test case
HandlesPseudoClasses
(also added in this PR) would pass even without the implementation change, but it's good to have more test cases explicitly about pseudoclasses to make sure the pseudoelement support doesn't trip them up.Ask-mode template
Description
The new CSS scoping feature, first shipped in 5.0-preview8, contains a bug whereby a particular kind of CSS rule doesn't get scoped properly.
Customer Impact
This was reported by a customer: https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-5-preview-8/#comment-2540
The impact is that CSS pseudoelements don't work with CSS scoping, so the application UI doesn't render with the intended styling.
The only workaround would be for the developer to change their CSS to avoid having this combination of features, which probably means not using scoping.
It's very desirable to include the fix in RC1 because we want to be sure the CSS scoping feature is totally robust by the time it ships. If we don't include the fix, then customers won't get a ship-ready-candidate version of the feature until RC2, and then there will be very little time left for remaining feedback.
Regression?
No, this is a new feature
Risk
In the worst case, this might theoretically introduce some other new bug into the CSS scoping feature. However, test coverage is pretty good, and it doesn't have interactions with other features.