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

Product Price: Improve Global Styles API integration #5672

Closed
gigitux opened this issue Jan 28, 2022 · 1 comment · Fixed by #5950
Closed

Product Price: Improve Global Styles API integration #5672

gigitux opened this issue Jan 28, 2022 · 1 comment · Fixed by #5950
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

@gigitux
Copy link
Contributor

gigitux commented Jan 28, 2022

The Product Price block, with the Global Styles API, should support:

  • font-style
  • font-size
  • font-weight
  • specific text color for sale price -> it impossible to implement with the current Global Styles API
  • specific text color for regular price -> it impossible to implement with the current Global Styles API
@gigitux gigitux 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 Jan 28, 2022
@tomasztunik tomasztunik self-assigned this Feb 17, 2022
@tomasztunik
Copy link
Contributor

It is not possible now to introduce Global Styles for multi-state or multi-property/element complex blocks. If we introduce Global Styles in Product Price component we'll make it less customisable than it was before so from user's perspective this is going to be a regression.

  • Any custom changes to sale, baseline and standard price would need to happen via CSS.

Great discussion regarding this including follow up links one can find there can be found here WordPress/gutenberg#33255

Possible alternative to explore is to break down Product Price block into 3 separate blocks that would render each value as individual block. Issue with this is if we used this in Products listings, Product item views etc.

We could introduce variants (maybe?!) of the Product Price block by style (small, medium, big) or by function (list, item, cart)? and for each context use matching variant. Issue with this approach is it introduces a lot of granularity and adds a lot of noise by adding blocks that make sense only in the context of their host feature block.

Questions I have are.

  1. Do we want to introduce Global Styles at the cost of existing features and customisability?
  2. Do we want to introduce block granularity to get around Global Style limitations?

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