Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Add global styles to Product Title block #4919

Closed
Aljullu opened this issue Oct 8, 2021 · 0 comments · Fixed by #5009
Closed

Add global styles to Product Title block #4919

Aljullu opened this issue Oct 8, 2021 · 0 comments · Fixed by #5009
Assignees
Labels
block-type: product elements Issues related to Product Element blocks. focus: global styles Issues that involve styles/css/layout structure. type: enhancement The issue is a request for an enhancement.

Comments

@Aljullu
Copy link
Contributor

Aljullu commented Oct 8, 2021

Currently, the Product Title block allows to change the font size, and color:

However, this is done using a custom implementation and restricted to the feature plugin:

https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/e23b51119dfa5c11e67ab0b3cbd89d49189a8569/assets/js/atomic/blocks/product-elements/title/edit.js#L77-L107

This issue is about removing this implementation and instead replace it with global styles, that's it: using the supports parameter when registering the block. An example of blocks using global styles, are the reviews blocks:

https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/eebc7a627baf73591114365a0a61fb82e7485767/assets/js/blocks/reviews/all-reviews/index.js#L34-L42

That was implemented in this PR, which can be used as a reference: #4323.

One challenge of this issue is that we might need to update the block to use apiVersion: 2.

@Aljullu Aljullu added type: enhancement The issue is a request for an enhancement. focus: global styles Issues that involve styles/css/layout structure. block-type: product elements Issues related to Product Element blocks. labels Oct 8, 2021
@dinhtungdu dinhtungdu self-assigned this Oct 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block-type: product elements Issues related to Product Element blocks. focus: global styles Issues that involve styles/css/layout structure. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants