Skip to content
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: Colors selections display differently between editor and frontend #25889

Closed
aaronrobertshaw opened this issue Oct 7, 2020 · 5 comments
Labels
[Block] Navigation Affects the Navigation Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended

Comments

@aaronrobertshaw
Copy link
Contributor

aaronrobertshaw commented Oct 7, 2020

Describe the bug
Color selections for the navigation block using named CSS color classes, appear different between the editor and frontend.

When the color palette differs between the editor and frontend, or when the theme doesn't provide a color palette at all, the color the user selects is not reflected on the frontend.

Further discussion, background, and an ad-hoc approach to forcing this consistency ( 8b84c42 ) was originally included in #25691.

To reproduce
This is an issue across multiple themes ( TwentyTwenty, Maywood etc ) however is best observed in a theme that doesn't provide a full colour palette to the editor such as Varia.

  1. Start with Varia theme active
  2. Create a post and add a navigation block to it
  3. Select different color combinations for the navigation block and notice some do not display correctly in the editor.
  4. Save the post and view on the frontend and see a completely different set of colors displayed.
  5. Switch themes and repeat steps 2-4. There will still be inconsistent behaviour.

Expected behavior
The color I select in the editor to be the one shown on the frontend.

Screenshots

Varia TwentyTwenty Maywood
NavigationBlockColors-Varia-Bug NavigationBlockColors-TwentyTwenty-Bug NavigationBlockColors-Maywood-Bug

Editor version (please complete the following information):

  • WordPress version: 5.5.1
  • Gutenberg plugin 9.1

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Browsers: Chrome, Safari, Firefox
  • Versions: Latest
@talldan talldan added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended labels Oct 9, 2020
@tellthemachines
Copy link
Contributor

Hi @aaronrobertshaw, I can only reproduce this bug in the Navigation block. Have you found it in any other blocks?

@tellthemachines tellthemachines added the [Block] Navigation Affects the Navigation Block label Nov 4, 2020
@aaronrobertshaw
Copy link
Contributor Author

Thanks for taking the time to look at this one @tellthemachines

I'd previously seen it in another dynamic block, social links, when using the colors hook in a separate PR. I've rebased that one though and cannot replicate the issue there now. I'll take a closer look at the navigation block and see if I can spot something specific causing this problem, then update this issue accordingly.

@aaronrobertshaw
Copy link
Contributor Author

It looks like recent improvements to block supports has fixed up a few of these issues. I currently have a PR (#25691) that will address the navigation block. If it is accepted I think it will close this issue.

@aaronrobertshaw aaronrobertshaw changed the title Colors: Selections display differently between editor and frontend Navigation Block: Colors selections display differently between editor and frontend Nov 6, 2020
@tellthemachines
Copy link
Contributor

Is this still an issue? I notice the attached PR was closed, so can we close this one as well?

@aaronrobertshaw
Copy link
Contributor Author

Yes, my mistake. Closing this now. Thanks 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants