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.
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
RSS: Border & Spacing support #66411
base: trunk
Are you sure you want to change the base?
RSS: Border & Spacing support #66411
Changes from 5 commits
4b56a4a
11696c1
327b61d
bb7cb65
3d05431
209099d
e8c3e09
4c41f45
de5a348
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Theme.json and user global styles are being overwritten on the frontend by the RSS block's styles:
gutenberg/packages/block-library/src/rss/style.scss
Lines 2 to 3 in 11696c1
It's there to remove the default list padding.
Here's the PR that introduced it: #33294
Reducing specificity might work:
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 clarity, I believe the suggestion here is to extract the padding to a new style with the reduced specificity, as shown above, rather than change the selector of the entire block of styles.
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.
Exactly, thanks for translating my fly-by comment 👍🏻 😄
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.
Extracted the padding to a new style in the recent commit.
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.
Unfortunately, the original padding style wasn't removed so the problem still exists on the frontend.
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.
Same here, a comment might help future contributors to know what this does.
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.
I believe these styles are to prevent the double-up of block support styles within the editor when server-side rendering, hence the nested
.wp-block-rss
classes.Given they are editor-only styles, they shouldn't be added to the styles sent to the frontend, instead
editor.scss
might be a better home for them.These styles are missing the padding reset and the border reset might be too simplistic when Global Styles are taken into account. The tag cloud block went through these same edge cases so it's a good example to follow for the style resets.
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.
My memory failed me during my review but finally kicked into gear. There's a slightly cleaner way to wrangle resetting all the various block support styles when skipping block supports in the server-side rendering. It should also be more forward compatible for future block supports.
It was first proposed for the Tag Cloud block that runs into similar issues.
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.
Moved the nested style in editor.scss as per the discussion, since it is editor only style.
One scenario, while we adding
all: inherit;
list style get inherited and bullets will display in the editor part.So in that case, just updated the style as follows:
Please share your thought on this @aaronrobertshaw
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.
I think we should still use the
all: inherit;
rule.The issue with the
list-style: none
rule not being applied is just that the main style adding it targets theul
element. When the block is server-side rendered, it's wrapper becomes adiv
.The fix is as simple as moving the existing
list-style: none;
rule to the new style you've added using the straightforward0-1-0
specificity.wp-block-rss
selector. Along with that move, we can also clean up the unneeded&.is-grid
style's rule for list style as well.The
reset.scss
styles are scoped with:where(.editor-styles-wrapper)
nowadays so the block doesn't need the bumped specificity. Once this PR is updated though we'll need to double check a non-iframed editor and ensure everything still works as expected.The benefit of the
all: inherit
rule is that it is more robust in the face of changes than arbitrarily adding all possible resets. As the list of CSS properties that need to be reset grows, it also means more CSS. Theall: inherit;
approach keeps that to a minimum.