-
Notifications
You must be signed in to change notification settings - Fork 219
Featured Product: Enable global style #5555
Conversation
…products-block into add/4965-product-title
Featured Category block: Add support for global style
…oocommerce-gutenberg-products-block into add/4965-featured-product
…oocommerce-gutenberg-products-block into add/4965-featured-product
Featured Product block: enable global style
…products-block into add/4965-featured-category
…products-block into add/4965-featured-product
Size Change: +75 B (0%) Total Size: 816 kB
ℹ️ View Unchanged
|
0dd39a3
to
d77e39b
Compare
…products-block into add/4965-featured-category
…oocommerce-gutenberg-products-block into add/4965-featured-product
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 working great and code looks good, I just left some minor comments below. Heads-up that I skipped reviewing all Featured Categories files, I guess after rebasing the PR they will be removed from the diff.
background-size: cover; | ||
background-position: center center; | ||
width: 100%; | ||
margin: 0 0 1.5em 0; | ||
margin: 0 0 0 0; |
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.
Should we use the shorthand here?
margin: 0 0 0 0; | |
margin: 0; |
size={ { | ||
height: '', | ||
width: '', | ||
} } |
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.
How does that work? I seem to be able to change the height of the block, but not the width. Is that the expected behavior?
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 of 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.
In accordance with TS type, we need to specify either height
and width
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.
Now that the font size can't be modified anymore, should we undo this change?
background-size: cover; | ||
background-position: center center; | ||
width: 100%; | ||
margin: 0 0 1.5em 0; | ||
margin: 0 0 0 0; |
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.
Here too:
margin: 0 0 0 0; | |
margin: 0; |
line-height: 1.25; | ||
margin-bottom: 0; | ||
text-align: center; | ||
color: inherit; | ||
font-size: inherit; |
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.
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.
You are right!
This is a bug that affects Featured Category
too :( (already merged in the trunk), but this bug is replicable only when the site has a block theme enabled.
The Global Styles API doesn't support different font-size options, so we can:
- disable the font size option.
- font size option will impact only the description (it doesn't make sense IMHO).
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.
In the end, I followed the same approach that we adopted in #5682: the user can't customize font-size
…products-block into add/4965-featured-product
e8cc16c
to
b4ffeed
Compare
…products-block into add/4965-featured-product
82f8d8f
to
0261501
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.
I left one last comment, but besides that, everything looks good to me, so pre-approving.
…products-block into add/4965-featured-product
Thanks for the review! |
This PR is blocked by #5542
This PR adds support for global style for the
Featured Product 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 Product block
to a post.Reset
button from the different sections.Styles
icon on the right-top corner.Featured Product block
is shown under theBlocks
section. Personalize again the block.Changelog