This repository was archived by the owner on Jan 6, 2025. It is now read-only.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
All of the pseudos!
Out of curiosity, why was
!importantneeded here?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.
The
!importantis needed because I discovered that (for whatever reason) a lot of base HTML tags (i.e.a,code, etc.) are styled within astyletag that lives directly within the webview HTML document.As a result, without the
!importantthe styles within thestyletag will have higher specificity than styles defined in the code above and get overridden.I think this is also the reason that I had such a ridiculously challenging time trying to fix these bugs back in November because I didn't catch that these base tags were being styled directly in the HTML document and needed an
!importanttag to be overridden.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.
For the purposes of posterity, here are some reference screenshots to what I'm talking about in case we ever run into this again.
Note how the selector for
a, a codehas higher specificity than the styles defined by thedata-grid-cell. It's only by applying!importantthat we can override these higher priority styles.By clicking the
<style>link in the top-right corner of the styling block in the above image, the DevTools inspector will take us to the spot where these styles are applied and here we can see that it is an inlinestyletag that lives in theheadof the webview iframe.