-
Notifications
You must be signed in to change notification settings - Fork 216
Add global style support to Mini Cart (button) #5100
Changes from 14 commits
088bd91
00dd641
6bbe4ae
4bbb63a
2659c9f
ee7772c
003c632
8fff470
226a04a
cd853d4
27a2584
980bde3
c5fe9f4
c323f21
a6c5b34
04cca3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,19 @@ const settings = { | |
| supports: { | ||
| html: false, | ||
| multiple: false, | ||
| color: { | ||
| /** | ||
| * Because we don't target the wrapper element, we don't need | ||
| * to add color classes and style to the wrapper. | ||
| */ | ||
| __experimentalSkipSerialization: true, | ||
| }, | ||
| /** | ||
| * We need this experimental flag because we don't want to style the | ||
| * wrapper but inner elements. | ||
| */ | ||
| __experimentalSelector: | ||
| '.wc-block-mini-cart__button, .wc-block-mini-cart__badge', | ||
|
Comment on lines
+40
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything seemed to work fine for me when I removed these lines. Why was it needed? 🤔
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you remove this, the global style doesn't work correctly. Without this, Gutenberg will add global style to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the GB team aware that we're using this experimental supports property and why we need to use it? If not, it might be handy to make sure they know somehow so there's awareness of it's usefulness for other projects when it comes time to evaluate graduating it.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nerrad I'm not sure if they know about it or not. I will add comments explaining why we need them. Edit: added comments for
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given the discussion in p1637141712378200-slack-C02FL3X7KR6, I think we can go ahead using those In the future, while we research global styles in a bigger scale for all blocks, we can get a list of all experimental features we need to use and get in contact with Gutenberg devs to know their plans with them. |
||
| }, | ||
| example: { | ||
| attributes: { | ||
|
|
@@ -38,6 +51,10 @@ const settings = { | |
| default: false, | ||
| save: false, | ||
| }, | ||
| transparentButton: { | ||
| type: 'boolean', | ||
| default: true, | ||
| }, | ||
| }, | ||
|
|
||
| edit, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.