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

Add global styles to all WC Blocks #4965

Closed
17 of 18 tasks
Aljullu opened this issue Oct 19, 2021 · 5 comments · Fixed by #5477, #5515, #5516 or #5521
Closed
17 of 18 tasks

Add global styles to all WC Blocks #4965

Aljullu opened this issue Oct 19, 2021 · 5 comments · Fixed by #5477, #5515, #5516 or #5521
Labels
focus: FSE Work related to prepare WooCommerce for FSE. 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 19, 2021

We would like to add global styles to all WC Blocks.

Below, there is a list of which styles we would like each block to have enabled:

Product element blocks

Some of them are experimental, so you might need Gutenberg installed to get them working.

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

@Aljullu Aljullu added type: enhancement The issue is a request for an enhancement. type: good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. focus: global styles Issues that involve styles/css/layout structure. focus: FSE Work related to prepare WooCommerce for FSE. labels Oct 19, 2021
gigitux added a commit that referenced this issue Nov 12, 2021
Add global style for product categories list block
gigitux added a commit that referenced this issue Nov 12, 2021
Add global style for product categories list block
gigitux added a commit that referenced this issue Nov 16, 2021
Add global style for product categories list block
gigitux added a commit that referenced this issue Nov 16, 2021
Add global style for product categories list block
gigitux added a commit that referenced this issue Nov 16, 2021
Add global style for product categories list block
@Aljullu Aljullu removed the type: good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. label Nov 17, 2021
@Aljullu
Copy link
Contributor Author

Aljullu commented Nov 17, 2021

Heads-up that I'm removing the good first issue label given that we found that adding global styles to some of the blocks was more complex than anticipated. We are planning to work on this issue in the future, but as part of a bigger project to properly document all challenges we face with current Gutenberg APIs and the way WC blocks work.

gigitux added a commit that referenced this issue Nov 30, 2021
* Add global style for product categories list block #4965

Add global style for product categories list block

* add support for link color

* add feature flag

* fix code style and PHP warning

* update doc comment

* remove empty space

* refactor StyleAttributesUtils (#5277)

Co-authored-by: Tung Du <[email protected]>
jonny-bull pushed a commit to jonny-bull/woocommerce-gutenberg-products-block that referenced this issue Dec 14, 2021
* Add global style for product categories list block woocommerce#4965

Add global style for product categories list block

* add support for link color

* add feature flag

* fix code style and PHP warning

* update doc comment

* remove empty space

* refactor StyleAttributesUtils (woocommerce#5277)

Co-authored-by: Tung Du <[email protected]>
jonny-bull pushed a commit to jonny-bull/woocommerce-gutenberg-products-block that referenced this issue Dec 16, 2021
* Add global style for product categories list block woocommerce#4965

Add global style for product categories list block

* add support for link color

* add feature flag

* fix code style and PHP warning

* update doc comment

* remove empty space

* refactor StyleAttributesUtils (woocommerce#5277)

Co-authored-by: Tung Du <[email protected]>
gigitux added a commit that referenced this issue Jan 3, 2022
Mini Cart Block: the color of the badge reflects the global style #4965
gigitux added a commit that referenced this issue Jan 4, 2022
Enable global style for category list block
@gigitux
Copy link
Contributor

gigitux commented Jan 5, 2022

I'm editing the issue description. The Product Title block has the global style enabled for the background, so we should enable the global style for the text color too.

@gigitux
Copy link
Contributor

gigitux commented Jan 5, 2022

The Product Price block has a more granular level of customization for font style and text color that we can't reach with global style API. For now, we will not migrate the Product Price block to global style.

gigitux added a commit that referenced this issue Jan 5, 2022
Rating Product block: add support for global style
gigitux added a commit that referenced this issue Jan 11, 2022
Mini Cart block: re-enable background support #4965
gigitux added a commit that referenced this issue Jan 12, 2022
Featured Product block: enable global style
gigitux added a commit that referenced this issue Jan 12, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* fix global style title color (#5548)

Co-authored-by: Tung Du <[email protected]>
@Aljullu Aljullu reopened this Jan 12, 2022
gigitux added a commit that referenced this issue Jan 12, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* Summary Product block: add support for global style #4965

Summary Product block: add support for global style

* add color global style under feature flag

* fix import after merge

* fix typo
gigitux added a commit that referenced this issue Jan 12, 2022
Attribute Filter block: enable global style #4965
gigitux added a commit that referenced this issue Jan 13, 2022
Price Filter block: enable global style #4965
gigitux added a commit that referenced this issue Jan 13, 2022
Product Image block: enable global style #4965
gigitux added a commit that referenced this issue Jan 13, 2022
Product Image block: enable global style #4965
gigitux added a commit that referenced this issue Jan 14, 2022
Sale Product block: enable global style #4965
gigitux added a commit that referenced this issue Jan 17, 2022
Price Filter block: enable global style #4965
gigitux added a commit that referenced this issue Jan 17, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* Stock indicator block: add support for global style #4965

Stock indicator block: add support for global style

* fix import after merge
gigitux added a commit that referenced this issue Jan 26, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style #4965

Featured Category block: Add support for global style

* fix border color

* fix opacity

* fix border radius

* fix order rules css
gigitux added a commit that referenced this issue Feb 1, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style #4965

Featured Category block: Add support for global style

* fix border color

* Featured Product block: enable global style #4965

Featured Product block: enable global style

* fix border color

* fix eslint error

* fix opacity

* fix border radius

* fix opacity

* disable font-size support

* restore height for featured product and featured category
gigitux added a commit that referenced this issue Feb 2, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style #4965

Featured Category block: Add support for global style

* fix border color

* Attribute Filter block: enable global style #4965

Attribute Filter block: enable global style #4965

* fix eslint error

* fix test

* add comments about !important
gigitux added a commit that referenced this issue Feb 14, 2022
* Product title: add support global style #4965

* add specific type

* Enable global style for category list block #4965

Enable global style for category list block

* fix import after merge

* add save function

* add feature flag
gigitux added a commit that referenced this issue Feb 14, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style #4965

Featured Category block: Add support for global style

* fix border color

* Sale Product block: enable global style #4965

Sale Product block: enable global style #4965

* add comment
gigitux added a commit that referenced this issue Feb 14, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* move hooks in a specific folder

* Tag List block: add support for global style #4965

Tag List Block: add support for global style

* add feature flag
gigitux added a commit that referenced this issue Feb 14, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style #4965

Featured Category block: Add support for global style

* fix border color

* Product Image block: enable global style #4965

Product Image block: enable global style #4965

* fix test
gigitux added a commit that referenced this issue Feb 15, 2022
* Product title: add support global style #4965

* add specific type

* add custom save function

* Rating Product block: add support for global style #4965

Rating Product block: add support for global style

* add feature flag

* fix import after merge

* fix global style css generation

* restore css for classic product rating html element

* don't apply the global style to PHP blocks

* remove registration
@gigitux
Copy link
Contributor

gigitux commented Mar 11, 2022

The Product Price block has a more granular level of customization for font style and text color that we can't reach with global style API. For now, we will not migrate the Product Price block to global style.

At the end, we decided to convert the Product Price block

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: FSE Work related to prepare WooCommerce for FSE. focus: global styles Issues that involve styles/css/layout structure. type: enhancement The issue is a request for an enhancement.
Projects
None yet
3 participants