-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Navigation block color controls to Block Supports #42092
base: trunk
Are you sure you want to change the base?
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! |
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
Color
controls.It is also using an implicit CSS rule (
color: inherit
) to propagate the value ofText Color
down onto its Linka
elements. Unfortunately this means that anyLink
rules from Global Styles and/or ancestor blocks which targeta
will 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.text
attribute of the block and thetextColor
attribute provided by block supports.This PR aims to fix that by utilising the standards based Block Supports
color
implementation. 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