Skip to content
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: Added Colour support #66419

Open
wants to merge 11 commits into
base: trunk
Choose a base branch
from
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ Display entries from any RSS or Atom feed. ([Source](https://github.com/WordPres

- **Name:** core/rss
- **Category:** widgets
- **Supports:** align, interactivity (clientNavigation), ~~html~~
- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** blockLayout, columns, displayAuthor, displayDate, displayExcerpt, excerptLength, feedURL, itemsToShow

## Search
Expand Down
20 changes: 20 additions & 0 deletions packages/block-library/src/rss/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@
"html": false,
"interactivity": {
"clientNavigation": true
},
"color": {
"background": true,
"text": true,
"gradients": true,
"link": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontFamily": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the __experimental prefixes now that #63401 has merged 👍🏻

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__experimental prefixes removed in recent commit.

"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
"__experimentalTextTransform": true,
"__experimentalLetterSpacing": true,
"__experimentalTextDecoration": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not a big deal, but the underline control in text decoration won't affect .wp-block-rss__item-title > a elements as they're being directly controlled by this rule:

a:where(:not(.wp-element-button)) {
    text-decoration: underline;
}

I'm not sure whether users will expect text decoration to affect all text within the RSS block 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be some options here to apply text decoration more effectively.

Individual block support features, e.g. text-decoration, can have their serialization of styles and classes skipped. They can then be manually applied to the appropriate inner elements. For the Global Styles side of that equation, the Block Selectors API allows custom selectors for individual features so they target the same inner elements.

For an example of skipping serialization of onlytextDecoration, see the Navigation block.

Note: The navigation block skipped that serialization before the Selector's API was implemented so I'm not sure if it covers Global Styles or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aaronrobertshaw for the reference and suggestion.

Tried to follow the same way as in the Navigation block. Bu as you mentioned, it doesn't covers Global Styles. We need to tweak more on this.

I have added all the changes in recent commit.

More suggestions are welcome for this scenario.

"__experimentalDefaultControls": {
"fontSize": true,
"textDecoration": true
}
}
},
"editorStyle": "wp-block-rss-editor",
Expand Down
Loading