From 1f048b279dbe0b22b57c25b05cd3b9bac56c4578 Mon Sep 17 00:00:00 2001 From: benazeer Date: Thu, 24 Oct 2024 19:11:18 +0530 Subject: [PATCH 01/10] Adding color support to RSS block --- packages/block-library/src/rss/block.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/block-library/src/rss/block.json b/packages/block-library/src/rss/block.json index 36d70e7b7ccb98..844104b7d8113d 100644 --- a/packages/block-library/src/rss/block.json +++ b/packages/block-library/src/rss/block.json @@ -46,6 +46,12 @@ "html": false, "interactivity": { "clientNavigation": true + }, + "color": { + "background": true, + "text": true, + "gradients": true, + "link": true } }, "editorStyle": "wp-block-rss-editor", From 9fd577f0636e5b6b35df63a922eb642792fb8a59 Mon Sep 17 00:00:00 2001 From: benazeer Date: Thu, 24 Oct 2024 22:33:54 +0530 Subject: [PATCH 02/10] Doc Build --- docs/reference-guides/core-blocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index dd49d156857249..b5d4d59cd6bbdf 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -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), ~~html~~ - **Attributes:** blockLayout, columns, displayAuthor, displayDate, displayExcerpt, excerptLength, feedURL, itemsToShow ## Search From a4db05a06ce8075fed893f39773ceaca63d499f2 Mon Sep 17 00:00:00 2001 From: benazeer Date: Fri, 25 Oct 2024 13:41:32 +0530 Subject: [PATCH 03/10] Added Typography support for RSS block --- packages/block-library/src/rss/block.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/block-library/src/rss/block.json b/packages/block-library/src/rss/block.json index 844104b7d8113d..37425f2e5518bc 100644 --- a/packages/block-library/src/rss/block.json +++ b/packages/block-library/src/rss/block.json @@ -52,6 +52,20 @@ "text": true, "gradients": true, "link": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalLetterSpacing": true, + "__experimentalTextDecoration": true, + "__experimentalDefaultControls": { + "fontSize": true, + "textDecoration": true + } } }, "editorStyle": "wp-block-rss-editor", From ae02c0cebc41ee6a5ec3f394cdd089ea9ca8b9ee Mon Sep 17 00:00:00 2001 From: benazeer Date: Fri, 25 Oct 2024 13:52:38 +0530 Subject: [PATCH 04/10] Doc Build --- docs/reference-guides/core-blocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index b5d4d59cd6bbdf..f5946c9af8718e 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -801,7 +801,7 @@ Display entries from any RSS or Atom feed. ([Source](https://github.com/WordPres - **Name:** core/rss - **Category:** widgets -- **Supports:** align, color (background, gradients, link, text), 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 From a96896c1401f4c6d5db2b24e8697bf2d19ea8d59 Mon Sep 17 00:00:00 2001 From: benazeer-ben Date: Tue, 12 Nov 2024 15:47:54 +0530 Subject: [PATCH 05/10] Removed __experimental typography prefix and doc build --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/rss/block.json | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index f5946c9af8718e..281c84b271ca18 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -801,7 +801,7 @@ Display entries from any RSS or Atom feed. ([Source](https://github.com/WordPres - **Name:** core/rss - **Category:** widgets -- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), typography (fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textDecoration, textTransform), ~~html~~ - **Attributes:** blockLayout, columns, displayAuthor, displayDate, displayExcerpt, excerptLength, feedURL, itemsToShow ## Search diff --git a/packages/block-library/src/rss/block.json b/packages/block-library/src/rss/block.json index 37425f2e5518bc..7ff7d19f37ae5a 100644 --- a/packages/block-library/src/rss/block.json +++ b/packages/block-library/src/rss/block.json @@ -56,12 +56,12 @@ "typography": { "fontSize": true, "lineHeight": true, - "__experimentalFontFamily": true, - "__experimentalFontWeight": true, - "__experimentalFontStyle": true, - "__experimentalTextTransform": true, - "__experimentalLetterSpacing": true, - "__experimentalTextDecoration": true, + "fontFamily": true, + "fontWeight": true, + "fontStyle": true, + "textTransform": true, + "letterSpacing": true, + "textDecoration": true, "__experimentalDefaultControls": { "fontSize": true, "textDecoration": true From b60ed55e8416bfe81543fab6790336cf70a8d3c6 Mon Sep 17 00:00:00 2001 From: benazeer-ben Date: Thu, 14 Nov 2024 00:35:33 +0530 Subject: [PATCH 06/10] Feedback changes --- packages/block-library/src/rss/block.json | 1 + packages/block-library/src/rss/edit.js | 6 ++++ packages/block-library/src/rss/index.php | 4 +++ packages/block-library/src/rss/style.scss | 35 +++++++++++++++++++++++ 4 files changed, 46 insertions(+) diff --git a/packages/block-library/src/rss/block.json b/packages/block-library/src/rss/block.json index 7ff7d19f37ae5a..9aa6626697ae0f 100644 --- a/packages/block-library/src/rss/block.json +++ b/packages/block-library/src/rss/block.json @@ -62,6 +62,7 @@ "textTransform": true, "letterSpacing": true, "textDecoration": true, + "__experimentalSkipSerialization": [ "textDecoration" ], "__experimentalDefaultControls": { "fontSize": true, "textDecoration": true diff --git a/packages/block-library/src/rss/edit.js b/packages/block-library/src/rss/edit.js index b67cb4f9193df1..eb2d8bec87d5b6 100644 --- a/packages/block-library/src/rss/edit.js +++ b/packages/block-library/src/rss/edit.js @@ -58,6 +58,7 @@ export default function RSSEdit( { attributes, setAttributes } ) { const blockProps = useBlockProps(); + const textDecoration = attributes.style?.typography?.textDecoration; const label = __( 'RSS URL' ); if ( isEditing ) { @@ -190,6 +191,11 @@ export default function RSSEdit( { attributes, setAttributes } ) { diff --git a/packages/block-library/src/rss/index.php b/packages/block-library/src/rss/index.php index 32885863402d5e..fc069e36ac1da8 100644 --- a/packages/block-library/src/rss/index.php +++ b/packages/block-library/src/rss/index.php @@ -101,6 +101,10 @@ function render_block_core_rss( $attributes ) { if ( $attributes['displayExcerpt'] ) { $classnames[] = 'has-excerpts'; } + // Manually add block support text decoration as CSS class. + $text_decoration = $attributes['style']['typography']['textDecoration'] ?? null; + $text_decoration_class = sprintf( 'has-text-decoration-%s', $text_decoration ); + $classnames[] = $text_decoration ? $text_decoration_class : ''; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); diff --git a/packages/block-library/src/rss/style.scss b/packages/block-library/src/rss/style.scss index f7360ec76f85ac..39520650e53794 100644 --- a/packages/block-library/src/rss/style.scss +++ b/packages/block-library/src/rss/style.scss @@ -27,6 +27,41 @@ ul.wp-block-rss { // The ul is needed for specificity to override the reset styl } } + // The following rules provide class based application of user selected text + // decoration via block supports. + &.has-text-decoration-underline li.wp-block-rss__item a { + text-decoration: underline; + + &:focus, + &:active { + text-decoration: underline; + } + } + + &.has-text-decoration-line-through li.wp-block-rss__item a { + text-decoration: line-through; + + &:focus, + &:active { + text-decoration: line-through; + } + } + + &.has-text-decoration-none li.wp-block-rss__item a { + text-decoration: none; + + &:focus, + &:active { + text-decoration: none; + } + } + + & :where(a), + & :where(a:focus), + & :where(a:active) { + text-decoration: none; + } + @include break-small { @for $i from 2 through 6 { &.columns-#{ $i } li { From eb813f7361a014d2d9da98752789da3a36de89d1 Mon Sep 17 00:00:00 2001 From: Benazeer Hassan <66269472+benazeer-ben@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:49:45 +0530 Subject: [PATCH 07/10] Update packages/block-library/src/rss/index.php Co-authored-by: Ramon --- packages/block-library/src/rss/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/rss/index.php b/packages/block-library/src/rss/index.php index fc069e36ac1da8..38bfb969db9528 100644 --- a/packages/block-library/src/rss/index.php +++ b/packages/block-library/src/rss/index.php @@ -104,7 +104,7 @@ function render_block_core_rss( $attributes ) { // Manually add block support text decoration as CSS class. $text_decoration = $attributes['style']['typography']['textDecoration'] ?? null; $text_decoration_class = sprintf( 'has-text-decoration-%s', $text_decoration ); - $classnames[] = $text_decoration ? $text_decoration_class : ''; + $classnames[] = $text_decoration ? $text_decoration_class : ''; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); From db65c192b347095d8c6de57d13170ca433570f5f Mon Sep 17 00:00:00 2001 From: benazeer-ben Date: Thu, 14 Nov 2024 12:37:09 +0530 Subject: [PATCH 08/10] Moving typogrpahy support changes from this PR --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/rss/block.json | 15 ---------- packages/block-library/src/rss/edit.js | 6 ---- packages/block-library/src/rss/index.php | 4 --- packages/block-library/src/rss/style.scss | 36 ----------------------- 5 files changed, 1 insertion(+), 62 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 281c84b271ca18..b5d4d59cd6bbdf 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -801,7 +801,7 @@ Display entries from any RSS or Atom feed. ([Source](https://github.com/WordPres - **Name:** core/rss - **Category:** widgets -- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), typography (fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textDecoration, textTransform), ~~html~~ +- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), ~~html~~ - **Attributes:** blockLayout, columns, displayAuthor, displayDate, displayExcerpt, excerptLength, feedURL, itemsToShow ## Search diff --git a/packages/block-library/src/rss/block.json b/packages/block-library/src/rss/block.json index 9aa6626697ae0f..844104b7d8113d 100644 --- a/packages/block-library/src/rss/block.json +++ b/packages/block-library/src/rss/block.json @@ -52,21 +52,6 @@ "text": true, "gradients": true, "link": true - }, - "typography": { - "fontSize": true, - "lineHeight": true, - "fontFamily": true, - "fontWeight": true, - "fontStyle": true, - "textTransform": true, - "letterSpacing": true, - "textDecoration": true, - "__experimentalSkipSerialization": [ "textDecoration" ], - "__experimentalDefaultControls": { - "fontSize": true, - "textDecoration": true - } } }, "editorStyle": "wp-block-rss-editor", diff --git a/packages/block-library/src/rss/edit.js b/packages/block-library/src/rss/edit.js index eb2d8bec87d5b6..b67cb4f9193df1 100644 --- a/packages/block-library/src/rss/edit.js +++ b/packages/block-library/src/rss/edit.js @@ -58,7 +58,6 @@ export default function RSSEdit( { attributes, setAttributes } ) { const blockProps = useBlockProps(); - const textDecoration = attributes.style?.typography?.textDecoration; const label = __( 'RSS URL' ); if ( isEditing ) { @@ -191,11 +190,6 @@ export default function RSSEdit( { attributes, setAttributes } ) { diff --git a/packages/block-library/src/rss/index.php b/packages/block-library/src/rss/index.php index 38bfb969db9528..32885863402d5e 100644 --- a/packages/block-library/src/rss/index.php +++ b/packages/block-library/src/rss/index.php @@ -101,10 +101,6 @@ function render_block_core_rss( $attributes ) { if ( $attributes['displayExcerpt'] ) { $classnames[] = 'has-excerpts'; } - // Manually add block support text decoration as CSS class. - $text_decoration = $attributes['style']['typography']['textDecoration'] ?? null; - $text_decoration_class = sprintf( 'has-text-decoration-%s', $text_decoration ); - $classnames[] = $text_decoration ? $text_decoration_class : ''; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); diff --git a/packages/block-library/src/rss/style.scss b/packages/block-library/src/rss/style.scss index 39520650e53794..f6ae731393dfdc 100644 --- a/packages/block-library/src/rss/style.scss +++ b/packages/block-library/src/rss/style.scss @@ -26,42 +26,6 @@ ul.wp-block-rss { // The ul is needed for specificity to override the reset styl width: 100%; } } - - // The following rules provide class based application of user selected text - // decoration via block supports. - &.has-text-decoration-underline li.wp-block-rss__item a { - text-decoration: underline; - - &:focus, - &:active { - text-decoration: underline; - } - } - - &.has-text-decoration-line-through li.wp-block-rss__item a { - text-decoration: line-through; - - &:focus, - &:active { - text-decoration: line-through; - } - } - - &.has-text-decoration-none li.wp-block-rss__item a { - text-decoration: none; - - &:focus, - &:active { - text-decoration: none; - } - } - - & :where(a), - & :where(a:focus), - & :where(a:active) { - text-decoration: none; - } - @include break-small { @for $i from 2 through 6 { &.columns-#{ $i } li { From bbe96dcaa1f772c7cfc1f02f904ef0a8ea9da567 Mon Sep 17 00:00:00 2001 From: benazeer-ben Date: Thu, 14 Nov 2024 13:20:19 +0530 Subject: [PATCH 09/10] Spacing changes --- packages/block-library/src/rss/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/src/rss/style.scss b/packages/block-library/src/rss/style.scss index f6ae731393dfdc..f943f1a57a2226 100644 --- a/packages/block-library/src/rss/style.scss +++ b/packages/block-library/src/rss/style.scss @@ -26,6 +26,7 @@ ul.wp-block-rss { // The ul is needed for specificity to override the reset styl width: 100%; } } + @include break-small { @for $i from 2 through 6 { &.columns-#{ $i } li { From 3b2b9ea25e647a164ee34cc2a31952c9e2ae59dd Mon Sep 17 00:00:00 2001 From: benazeer-ben Date: Thu, 14 Nov 2024 13:22:20 +0530 Subject: [PATCH 10/10] Spacing changes --- packages/block-library/src/rss/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/rss/style.scss b/packages/block-library/src/rss/style.scss index f943f1a57a2226..f7360ec76f85ac 100644 --- a/packages/block-library/src/rss/style.scss +++ b/packages/block-library/src/rss/style.scss @@ -26,7 +26,7 @@ ul.wp-block-rss { // The ul is needed for specificity to override the reset styl width: 100%; } } - + @include break-small { @for $i from 2 through 6 { &.columns-#{ $i } li {