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: Text Overlay not working in mobile view #51575

Closed
paaljoachim opened this issue Jun 16, 2023 · 5 comments · Fixed by #51710
Closed

Navigation block: Text Overlay not working in mobile view #51575

paaljoachim opened this issue Jun 16, 2023 · 5 comments · Fixed by #51710
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended

Comments

@paaljoachim
Copy link
Contributor

Description

The header is an orange/yellow color.
Menu items are white.
Submenu & Overlay text is black.

Screenshot 2023-06-16 at 13 11 15

Submenu shows the text as black.

Hamburger menu area still shows the menu items in white.
Screenshot 2023-06-16 at 13 10 30

Step-by-step reproduction instructions

Screenshots, screen recording, code snippet

Environment info

WordPress 6.2.2
Gutenberg plugin 16.0

Please confirm that you have searched existing issues in the repo.

No

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

@carolinan
Copy link
Contributor

I am not able to reproduce this on Gutenberg trunk. I did not test with the published 16.0 version.

Please confirm that you have tested with all plugins deactivated except Gutenberg.
No

Would you be able to deactivate all other plugins so that a plugin conflict can be ruled out?
Did you remove all custom CSS?

@carolinan
Copy link
Contributor

I have to take that back; I see now that the color is working in the Site Editor but not the front.
Resulting CSS output on front, color:inherit is overriding color: var(--wp--preset--color--contrast);

.wp-block-navigation a:where(:not(.wp-element-button)) {
	color: inherit;
	text-decoration: none;
}

a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
}

@MaggieCabrera
Copy link
Contributor

MaggieCabrera commented Jun 20, 2023

I thought this one was related to some recent changes but when I look at the actual CSS this seems like a much older problem and I started uncovering inconsistencies everywhere. I want to fix this but also set some tests or something to avoid regressions in the future. In any case, I'm trying to test all possible cases. Can you help out with what I have right now? Let me know if my assumptions are correct and if I'm missing other cases, please!

To test, paste in the editor the following markup. I'm using TT3 pilgrimage variation because it has a link color defined:


<!-- wp:paragraph -->
<p>We are testing using TT3 with the variation pilgrimage, that has <a href="#">green link colors</a></p>
<!-- /wp:paragraph -->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"clamp(1.5rem, 5vw, 2rem)","bottom":"clamp(1.5rem, 5vw, 2rem)","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}}},"borderColor":"primary","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-border-color has-primary-border-color" style="padding-top:clamp(1.5rem, 5vw, 2rem);padding-right:var(--wp--preset--spacing--30);padding-bottom:clamp(1.5rem, 5vw, 2rem);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p>This is a nav block with no color settings:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>On desktop: </p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>The first and second link should be green unless the theme specifies a color for the nav block links</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>On mobile:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>The first and second link should be green unless the theme specifies a color for the nav block links</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:navigation {"ref":429} /--></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"clamp(1.5rem, 5vw, 2rem)","bottom":"clamp(1.5rem, 5vw, 2rem)","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}},"elements":{"link":{"color":{"text":"var:preset|color|cyan-bluish-gray"}}}},"backgroundColor":"vivid-red","textColor":"vivid-cyan-blue","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-vivid-cyan-blue-color has-vivid-red-background-color has-text-color has-background has-link-color" style="padding-top:clamp(1.5rem, 5vw, 2rem);padding-right:var(--wp--preset--spacing--30);padding-bottom:clamp(1.5rem, 5vw, 2rem);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p>This is a nav block inside a group block that has red background, blue text and <a href="#">link color set to gray</a> but the nav block has no color settings</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>On desktop: </p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>The first and second link should be gray unless the theme specifies a color for the nav block links</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>On mobile:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>The first and second link should be gray unless the theme specifies a color for the nav block links</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:navigation {"ref":429} /--></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"clamp(1.5rem, 5vw, 2rem)","bottom":"clamp(1.5rem, 5vw, 2rem)","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}},"elements":{"link":{"color":{"text":"var:preset|color|cyan-bluish-gray"}}}},"backgroundColor":"vivid-red","textColor":"vivid-cyan-blue","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-vivid-cyan-blue-color has-vivid-red-background-color has-text-color has-background has-link-color" style="padding-top:clamp(1.5rem, 5vw, 2rem);padding-right:var(--wp--preset--spacing--30);padding-bottom:clamp(1.5rem, 5vw, 2rem);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This is a nav block inside a group block that has red background, blue text and <a href="#">link color set to gray</a> but nav block has purple text and yellow background </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>On desktop:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>The first link should be purple and the second link should inherit the same color</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>On mobile:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>The first link should be purple and the second link should inherit the same color</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:navigation {"ref":429,"textColor":"vivid-purple","backgroundColor":"luminous-vivid-amber"} /--></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"clamp(1.5rem, 5vw, 2rem)","bottom":"clamp(1.5rem, 5vw, 2rem)","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}},"elements":{"link":{"color":{"text":"var:preset|color|cyan-bluish-gray"}}}},"backgroundColor":"vivid-red","textColor":"vivid-cyan-blue","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-vivid-cyan-blue-color has-vivid-red-background-color has-text-color has-background has-link-color" style="padding-top:clamp(1.5rem, 5vw, 2rem);padding-right:var(--wp--preset--spacing--30);padding-bottom:clamp(1.5rem, 5vw, 2rem);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p>This is a nav block inside a group block that has red background, blue text and <a href="#">link color set to gray</a> but the nav block has purple text and yellow background and pink text and orange background for the overlay</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>On desktop:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>The first link should be purple and the second link should be pink</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>On mobile:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>The first link should be purple and the second link should be pink</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:navigation {"ref":429,"textColor":"vivid-purple","backgroundColor":"luminous-vivid-amber","overlayBackgroundColor":"luminous-vivid-orange","overlayTextColor":"pale-pink"} /--></div>
<!-- /wp:group -->

Edit: my nav block consists of one link and then a second link inside the submenu of the first one

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Jun 20, 2023

I went to one of my dev sites.
Made a new page and in the code editor pasted in the above code.
Using the default Twenty Twenty Three. (Not sure what the TT3 pilgrimage variation is.)

Stitched together screenshots in the backend.

Code preview

This page:
https://webkonsulenten.com/nav-test/

@MaggieCabrera
Copy link
Contributor

It looks very broken indeed, but my question mostly is: are my assumptions correct? By that I mean the text I wrote on the markup:

This is a nav block inside a group block that has red background, blue text and link color set to gray but the nav block has purple text and yellow background and pink text and orange background for the overlay

On desktop:

The first link should be purple and the second link should be pink

On mobile:

The first link should be purple and the second link should be pink

I'm planning on using these as assertions for tests, to make sure we don't make any more regressions once this is fixed.

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 [Type] Bug An existing feature does not function as intended
Projects
Development

Successfully merging a pull request may close this issue.

3 participants