Exclude SVG elements from CSS reset#1252
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the CSS reset logic to exclude SVG elements and their descendants from the all: revert rule. Feedback indicates that the change lacks accompanying tests as required by the repository style guide. Additionally, it is suggested to simplify the CSS selector using a comma-separated list and to consider the potential inconsistency regarding HTML content nested within SVG foreignObject elements, which would also be excluded from the reset.
e8963c4 to
adbdd54
Compare
|
@ditman does this look safe? Do you think it has much chance of breaking things once imported into the google monorepo especially? |
|
Yeah, this looks good to me. The current implementation of the reset is very hardcore, and is probably breaking in the same way internally (it's just that nobody has hit this corner case yet). I'll bring it up to the internal users' chat to see if anybody has any concerns. |
|
@selamw1 can we apply this to other versions of the renderers, is this needed on lit v0.9 or any other renderer? We could land them all at the same time! |
@ditman yes, I checked and both versions(React v0.8 & v0.9) share the exact same |
|
Thanks for checking! One last thing, do you mind updating the CHANGELOG.md of the React renderer in the "Unreleased" section listing with a small sentence about this fix (it can be the commit message, or the title of the PR) and a link to the PR (similar to this), so we can compute the next version number when we release this package next? Thanks!! |
sure, |
|
I've rebased this branch with |
9c5faf6 to
5f4dfe7
Compare
5f4dfe7 to
bf9e1d0
Compare
|
I made several commits to pass the formatting changes, and all checks are now passing successfully. |
ditman
left a comment
There was a problem hiding this comment.
Thanks for fixing this and adding a test!
Fixes #1175
The CSS reset rule
all: revertinv0_8broke SVG rendering by overriding presentational attributes (e.g.,fill,stroke).Solution
Excluded SVG elements and their descendants from the reset:
:where(.a2ui-surface) :where(*:not(svg):not(svg *))Pre-launch Checklist