Skip to content

Navigation overlays: Social Icons block gap is being zeroed out (margin-top: 0;) #76936

Open

Description

@bgardner

Description

When adding the Social Icons block in a Navigation Overlay template part, the blockGap is being zeroed out on the front end. This is likely caused by the following CSS, which is targeting the Navigation UL, and inadvertently also hitting the ul.wp-block-social-links:

.wp-block-navigation ul  {
    margin-bottom: 0;
    margin-left: 0;
    margin-top: 0;
    padding-left: 0;
}

Step-by-step reproduction instructions

  1. Go to Header template part, edit Navigation, create Navigation Overlay part.
  2. Add content to the Navigation Overlay, including Social Icons block.
  3. Save changes. Go to front end, simulate mobile view, trigger responsive menu icon.
  4. View front end Social Icons with zero blockGap being applied.

Screenshots, screen recording, code snippet

Site editor view:

Image

Front end view:

Image

Environment info

WordPress 7.0 RC2, TT5 theme active, Gutenberg not active.

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Mar 31, 2026
  2. adithya-naik commented on Apr 2, 2026

    @adithya-naik
    Contributor

    I am working on this.

  3. adithya-naik commented on Apr 2, 2026

    @adithya-naik
    Contributor
    Image

    But I am not facing the issue

  4. bgardner commented on Apr 2, 2026

    @bgardner
    Author

    @adithya-naik Is that content inside the Navigation Overlay template part?

  5. adithya-naik commented on Apr 2, 2026

    @adithya-naik
    Contributor

    @adithya-naik Is that content inside the Navigation Overlay template part?

    NO @bgardner , Actually Iam unable to reproduce it exactly as yours

  6. adithya-naik commented on Apr 2, 2026

    @adithya-naik
    Contributor

    you said : "Go to Header template part, create Navigation Overlay part."

    But see,Iam unable to find Header and I dont know how to make it Navigation Overlay

    Image
  7. bgardner commented on Apr 2, 2026

    @bgardner
    Author

    @adithya-naik My apologies, I just updated the OP. You need to create a Navigation Overlay through editing the Navigaitom block. There's a setting in the sidebar where this can be created. See screen below:

    Image
  8. dpmehta commented on Apr 7, 2026

    @dpmehta
    Contributor

    @bgardner I am not able to find option which you mentioned that is "OVERLAY TEMPLATE", i have shared screenshot below can you please share more details or what am i missing ?

    Image
  9. karthikeya-io commented on Apr 7, 2026

    @karthikeya-io
    Contributor

    I am not able to find option which you mentioned that is "OVERLAY TEMPLATE",

    To use custom overlays for navigation, you should be on WP 7.0 or have Gutenberg active. Maybe you are on WP 6.9 without Gutenberg. You can create a custom overlay template from the navigation block sidebar settings.

    You can also test the overlays here: Playground

    I can reproduce this issue. It happens due to the following CSS applied to all ul elements inside the navigation:

    .wp-block-navigation {
    position: relative;
    // Normalize list styles.
    ul {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    padding-left: 0;
    }

    Maybe we can fix this by applying margin: 0 to the navigation ul element like this, but it prevents it from applying to inner ul elements. Looking for other opinions on this.

    ul.wp-block-navigation__container {
    		margin-top: 0;
    		margin-bottom: 0;
    		margin-left: 0;
    		padding-left: 0;
    	}
    
  10. bgardner commented on Apr 7, 2026

    @bgardner
    Author

    Any chance you can submit a PR for that @karthikeya-io?

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions