Skip to content

Navigation Overlays: Add .wp-block-template-part class by default #75588

Open
Mayank-Tripathi32 wants to merge 1 commit intoWordPress:trunkfrom
Mayank-Tripathi32:add/navigation-overlay-template-part-class
Open

Navigation Overlays: Add .wp-block-template-part class by default #75588
Mayank-Tripathi32 wants to merge 1 commit intoWordPress:trunkfrom
Mayank-Tripathi32:add/navigation-overlay-template-part-class

Conversation

@Mayank-Tripathi32
Copy link
Copy Markdown
Member

Issue #74967

What?

Adds the .wp-block-template-part class to navigation overlay containers.

Why?

Navigation overlays are template parts but were missing the standard .wp-block-template-part class. This class helps:

  • Identify template parts easily for styling purposes
  • Improve CSS specificity when targeting template parts
  • Enable potential performance optimizations for loading styles only when the template part is on the page

How?

Adds the wp-block-template-part class to the overlay container <div> in [WP_Navigation_Block_Renderer::get_responsive_container_markup()]

Testing Instructions

  1. Create a navigation block with a custom overlay template part
  2. View the page source/inspect the overlay container
  3. Verify the container has both wp-block-navigation__overlay-container and wp-block-template-part classes

ScreenShot

image

@github-actions github-actions bot added the [Package] Block library /packages/block-library label Feb 16, 2026
@Mayank-Tripathi32 Mayank-Tripathi32 marked this pull request as ready for review February 16, 2026 22:17
@github-actions
Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Block library.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 16, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@carolinan
Copy link
Copy Markdown
Contributor

I only see the class added to the front, which is different compared to other template parts, is that intentional?

@Mayank-Tripathi32
Copy link
Copy Markdown
Member Author

I only see the class added to the front, which is different compared to other template parts, is that intentional?

We mostly need it for targeting css on frontend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Navigation Overlays [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants