Migrate Navigation block color controls to Block Supports#42092
Migrate Navigation block color controls to Block Supports#42092
Conversation
|
Size Change: +470 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
|
I'm currently a but unsure of how to proceed:
Many questions to answer... |
81c25e8 to
a9c56cb
Compare
abe90d0 to
1654167
Compare
1654167 to
984d7b8
Compare
|
Note that #44578 has recently patched the core problem here but it doesn't solve the fundamental underlying issue that we need to move the block to use block supports for color. |
|
Thanks for tackling this @getdave 👍
This doesn't have to be the case. The block support controls are rendered via SlotFills into their respective panels. You can leverage the Hope this helps a little! |
|
I am commenting here because there has been a new bug ticket opened on the WordPress Trac about colors not being available as global styles for the navigation block. I am hoping that this can be unblocked. |
|
Thanks for following up here. I completely agree it's something that should be followed up on. Unfortunately I won't have the time to look into this in the near future as I have reduced availability over the upcoming months. I'm hopeful someone else will have the bandwidth to take this on. |
|
I'm doing some old PR cleanup. Since there has been no activity in the last three years, I'm going to close this as "stale." |
What?
Migrates Nav block text / link color to Global Styles implementation.
Also allows Nav block link styles to overide those defined on ancestor blocks.
Fixes #41146Part of #44712
TBC.
Why?
The Nav block uses a non-standard, custom implementation of the
Colorcontrols.It is also using an implicit CSS rule (
color: inherit) to propagate the value ofText Colordown onto its Linkaelements. Unfortunately this means that anyLinkrules from Global Styles and/or ancestor blocks which targetawill overwrite the implicit rules defined by the block because the global styles rules are output after the block rules.How?
This PR deprecates the existing bespoke Text Color attributes and migrates any colors defined on those attributes over to the
styles.elements.link.colors.textattribute of the block and thetextColorattribute provided by block supports.This PR aims to fix that by utilising the standards based Block Supports
colorimplementation. This provides:...colors.
It also moves the custom Submenu/Overlay color controls into their own panel. This is suboptimal UX wise but is the simplest option to get the majority of the block over to standards.
Please see #41146 (comment) for full context and explaination on what we're trying to achieve here.
Testing Instructions
Screenshots or screencast