-
Notifications
You must be signed in to change notification settings - Fork 215
Remove __experimentalDuotone from block.json
#7000
Remove __experimentalDuotone from block.json
#7000
Conversation
ba3d470 to
30e2933
Compare
|
The release ZIP for this PR is accessible via: |
|
Size Change: +26 B (0%) Total Size: 871 kB
ℹ️ View Unchanged
|
The __experimentalDuotone Supports property in the block.json files were preventing the Global Styles from being applied in the Editor. Removing them remedies the issue. This also adds a Schema property to improve development in supported editors. See https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#benefits-using-the-metadata-file.
30e2933 to
e45fe32
Compare
dinhtungdu
left a comment
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.
Follow the testing steps and I can confirm the Global style work. Just want to note that the Global style for the Featured Category block works with trunk if Gutenberg is activated, so I have to test without Gutenberg.
Note: the text color settings for this block are driven by inline styles that are added based on the Overlay and Color setting defaults. I imagine we want to keep those defaults in place so. To adjust this in the Editor, edit/remove those default settings on the block directly.
I'm wondering if we can use inherit for text so we don't need to use the inline style?
We're removing duotone entirely. Is that expected? If not, we can conditionally add duotone support in the index.tsx file to keep the duotone for beta users (sites with WP Core beta or Gutenberg plugin activated).
@dinhtungdu I think setting it to That seems to be the reason the inline style was implemented here to begin with - to ensure the white text over the overlay, as some theme styles (i.e., Storefront) were potentially interfering. Those defaults are taking precedence over the styles from the Site Editor - if we removed the defaults (either in the settings or on the block in the admin) the site Editor styles would be applied. There’s a bit of a tradeoff here - we either ensure that the active theme doesn’t override the default block styles or we have closer to the behavior we’d expect in the Site Editor. I would maybe lean towards reverting/removing the inline style and leaving it up to the theme to make sure it’s not overriding the blocks. In the case of Storefront, this only occurs in the editor but renders properly on the frontend. We could also add a style in the editor stylesheet for these blocks to slightly increase specificity there ( In either case, I would expect the settings on the block to override the settings coming from the Site Editor or any defaults, which is what happens. |
@dinhtungdu yes, that was the idea. I do think some additional discussion is needed here before concluding/merging, however. I noted this on the corresponding issue but I should have reflected more clearly here as well.
Great point! If I’m understanding properly, however, I’m seeing the opposite. I get the following:
Mini Cart:
Filter Blocks:
So that all being said, I still lean towards removing duotone entirely. These are the only blocks currently using the feature and, since duotone is experimental and not present in WC Core, removing it won’t have an impact on anything that’s been released and it will resolve the issue with the WC Blocks feature plugin. This brings us back to the original Issue reported by @gigitux. With the latest version of Gutenberg active, the problem still seems to be present. We may want to reopen this. As noted in my findings here, it does not seem to be related to the block class name. Adjusting the target classname via I’d love to hear your thoughts on the above! Cc @Aljullu |
|
Tested
Also, it's not very clear to me why |
@danielwrobert, as you already mentioned in #6988 (comment), |
dinhtungdu
left a comment
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.
As discussed on the call. I approve this PR for now so we can have the global style working again. Let's address the issue pointed out in this PR and the connected issue in follow-up issues! Thank you so much @danielwrobert for working on this tricky issue!
|
Thanks, @dinhtungdu! As discussed on our chat, the next steps from here are to investigate / report on the following things:
Also see comments on #6988 for additional testing details. |
The __experimentalDuotone Supports property in the block.json files were preventing the Global Styles from being applied in the Editor. Removing them remedies the issue. This also adds a Schema property to improve development in supported editors. See https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#benefits-using-the-metadata-file.




The
__experimentalDuotoneproperty in the block'sSupportsattribute (block.json) was preventing the Global Styles from being applied in the Editor. Removing the property remedies the issue.This also adds a Schema property to improve development in supported editors. See this support doc for additional details.
Fixes #6988
Screenshots
Testing
Note: the text color settings for this block are driven by inline styles that are added based on the Overlay and Color setting defaults. I imagine we want to keep those defaults in place so. To adjust this in the Editor, edit/remove those default settings on the block directly.
WooCommerce Visibility
Changelog