-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Navigation block: text color not appearing in the editor #41146
Comments
Adding to 6.0.1 conservatively. Would love to see this addressed for RC4 planned for this Friday but I recognize that that's a tight timeline :) |
This problem seems to be escalating |
Screen.Capture.on.2022-05-20.at.11-56-44.movTested and confirmed. Seems to be another inline style overriding this text color style 🤔 Doesn't happen on Archeo Theme though. I wonder if there's a specific Theme JSON setting that's causing the cascade to be overriden. Certainly the style that's overriding the text color seems to come from Global Styles. Doesn't happen in the Post Editor either. Only the Site Editor which makes me think Global Styles: Screen.Capture.on.2022-05-20.at.12-04-03.mov |
Some more debugging reveals the culprit to be the text color set on a wrapper Group block whose styles are cascading on to every Screen.Capture.on.2022-05-20.at.12-07-43.movYou can see this at
The cascade is how CSS works so this would seem to be legit. However, I'd expect the Nav block CSS to be more specific. The temporary "fix" would be to have a specific style on the Navigation block a or to remove the styles on the wrapping Group. We should look into why the Nav block CSS isn't more specific and/or overiding this. My instinct is that the |
@annezazu @carolinan A few contributors have discussed this and it looks like the problem is due to CSS specificity introduced by the fact that the Nav block has (for historical and legitimate reasons) a custom implementation of the color picking system. We could extend this system to affect a patch but as a few folks have noted would be compounding existing technical debt which will have to be "undone" later. Ideally we would take time to do a wider refactor which would:
I believe this issue "only" affects the Editor and not the front end. How impactful do you feel this bug is? If it's causing real pain and cannot be "managed" then we might need to go for the fix and try to undo the tech debt later. If not then we could take our time and get a solid fix in place which should also protect the block for further regressions as it would then be coupled to the wider system. No decisions have been made at this point and so I'd really appreciate your feedback should you be able to offer it 🙇♂️ |
@getdave thanks for summarizing the discussion and laying out the option. This feels like a very common UX bug to resolve that would impact the basics of using the navigation block (updating the colors of the links). My vote is to have an interim fix for 6.0.x and then figure out a longer term solution for 6.1 that is in line with what you described, which should work well since the Global Styles Engine work will continue to mature. cc @priethor for thoughts too :) |
Thanks @annezazu 👍 Also @draganescu and @scruffian do you have any thoughts about short term vs longer term fix? |
My concern with a short term fix is that it will make the long term fix harder, as we'll have to undo the mess that it will create. |
I'm also concerned about adding a lot of technical debt to fix this. I would evaluate a short-term fix for 6.0.1 but would only proceed if the effort required is not too big and there is confidence the patch doesn't compromise the long-term solution. |
Update: myself and @scruffian took some time to pair on the problem here. This is what we found:
The Bug:
Solution
SummaryWe believe we've come up with a solution which should solve. It will have some compromises in the short term but these would mostly be manifested in the block controls' presentation. PR to follow. |
I'm going to suggest we close this one out as I believe it was fixed in #44578 (cc @jasmussen). However the Navigation block still does not use the standardised color controls from Block Supports. It's a custom implementation. If it's desirable and necessary to do that then we should consider opening a new issue to track that requirement. For a summary of the original bug here and the status of the problem you can watch my video. |
Description
When assigning a text color to the main navigation block using TT2, the color isn't shown properly in the editor but does appear correctly when viewed on the front end of the site. This occurs with 6.0 RC3. cc @ndiego as a heads up, @getdave to perhaps help address, and @scruffian for possibility of this being a TT2 issue.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
text.color.nav.blcok.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: