-
Notifications
You must be signed in to change notification settings - Fork 219
Featured Category block: add support for global style #5542
Conversation
…products-block into add/4965-product-title
0a96add
to
3dc70d9
Compare
Featured Category block: Add support for global style
5892079
to
1826f91
Compare
98059dc
to
6ea99a2
Compare
Size Change: +895 B (0%) Total Size: 816 kB
ℹ️ View Unchanged
|
6ea99a2
to
201d8ed
Compare
@@ -325,7 +308,10 @@ const FeaturedCategory = ( { | |||
return ( | |||
<ResizableBox | |||
className={ classes } | |||
size={ { height } } | |||
size={ { |
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 that we should not limit the height in the editor.
Now the user can change the font-size
. If the font-size
is high, the block should become bigger otherwise the user can't see the entire text.
201d8ed
to
126e9b5
Compare
…products-block into add/4965-featured-category
126e9b5
to
c2cab62
Compare
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.
@gigitux Overall, the block style and global style are working as expected. But there are some things we can improve:
The background is different between editors (both Blocks and Site Editors) and the front-end. In the Blocks Editor, changing the background Opacity doesn't update the style of the preview block.
When the border-radius is set, there are small curves at four corners of the block. This happens because we set the border-radius for both wrapper and overlay elements.
The preset font sizes in the editors don't match corresponding ones on the front-end. Look like this issue occurs in other blocks, if so we can address it in a separated PR.
…products-block into add/4965-featured-category
78846a5
to
3effda7
Compare
color: { | ||
text: true, | ||
background: true, | ||
}, |
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.
Background and text color are enabled by default so this can be shortened like this:
color: { | |
text: true, | |
background: true, | |
}, | |
color: true, |
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.
This is LGTM now! 🎉 I left some minor comments but pre-approving this PR so you can merge it after addressing those comments.
border-color: transparent; | ||
overflow: hidden; | ||
color: #fff; | ||
background-color: #000; |
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.
Can we order CSS properties alphabetically? It's easier to maintain.
This PR is blocked by #5515This PR adds support for global style for the
Featured Category block
.Now, the user can edit the style for:
What missing:
Duotone
At this stage, the
Duotone
feature is implemented with thefilter
CSS property. The problem is that on this block, the image is implemented likebackground-image
, so we can't use thefilter
property.Padding
At this stage, with the current global style API, the padding is applied to the entire wrapper, so I guess that it doesn't make sense enable it.
#4965
Screenshots
without global style
with global style
Testing
Manual Testing
Check out this branch:
WordPress 5.9
, install and enable theGutenberg
plugin.Twenty Twenty-Two
theme.Featured Category Block
to a post.Reset
button from the different sections.Styles
icon on the right-top corner.Featured Category block
is shown under theBlocks
section. Personalize again the block.Changelog