• There appears to be a problem when trying to use the new Twenty Twenty Two theme, where the menu items in the header are stuck together with no padding between them at all using Safari 14.0.2 (this occurs when I try to make a new website myself with that theme, as well as on the sample at 2022.wordpress.net). I did discover that in the template parts editor, if I edited the background color of the navigation block to any color at all, replacing the theme default, everything pads out nicely. But then, I’d prefer to use the theme default of transparent – is there a way to specify a custom color that happens to be transparent? I’ve seen screen snapshots that the color picker is supposed to have a transparency slider, but mine doesn’t.

    I’m just learning WordPress, so I’m still new to this, and perhaps I’m missing an obvious fix. I’m running WordPress 5.9 and it’s telling me there are no updates available, for WordPress, plugins, or themes.

    Thanks!

    Dan

Viewing 5 replies - 1 through 5 (of 5 total)
  • You can select “Space between items” in the Header Template controls.
    See this page.

    It’s likely you’re seeing this issue because the flexbox gap property being used to manage spacing in the menu is not supported in Safari before 14.1: see https://webkit.org/blog/11648/new-webkit-features-in-safari-14-1/.

    If possible, try testing in Safari 14.1 or higher to see if the menu spacing appears as expected.

    Thread Starter charrois

    (@charrois)

    You can select “Space between items” in the Header Template controls.
    See this page.

    @andynick That sounds promising, and the web site you linked to does have lots of space between the menu items under my version of Safari. But I’m still a relative beginner to WordPress, and can’t find the header template controls option you are referring to. When I select “Template Parts”, “Header”, and then the “Navigation Block”, I see options to change Justification, Orientation, wrap, color, and typography, but that’s it – no option for “Space between items”. Where would I find that option?

    Thanks!

    Thread Starter charrois

    (@charrois)

    It’s likely you’re seeing this issue because the flexbox gap property being used to manage spacing in the menu is not supported in Safari before 14.1: see https://webkit.org/blog/11648/new-webkit-features-in-safari-14-1/.

    @chthnc I think you’re likely on the right track, Daniel. I found another thread (I should have copied the link when I found it, but can’t find it now) that mentioned something similar. Their suggestion for a workaround was to add:

    .wp-block-navigation .wp-block-navigation-item:not(:first-child) {
        margin-left: var(--wp--style--block-gap, 2em);
    }

    as Additional CSS to work around the problem. I tried, and at least at first glance, it seems to work. But what I’m not sure; does this change the rendering detrimentally for newer browsers which do support flexbox gap properly, or is it there nothing to be lost by using the patch?

    Though I could theoretically upgrade my own copy of Safari, that can’t be my “solution” since I’m writing the page for people who may have that version (or older) of Safari. Safari 14.0.2 is only about a year old, so it is still in active common use by my prospective clients (14.1 and later have been out for less than a year). So as far as finding issues with browsers, I’m actually glad I don’t have the latest and greatest version of Safari installed, otherwise I wouldn’t have found this problem – I figure my web site should be visible to browsers at least a few years old.

    Thanks!

    @charrois

    does this change the rendering detrimentally for newer browsers which do support flexbox gap properly, or is it there nothing to be lost by using the patch?

    Yes, it will almost certainly mean the spacing in browsers that support flexbox gap will be the gap value + the margin value.

    For simplicity, I think the way I’d approach this would be to use the new margin CSS and remove the gap value. This way, all browsers will share the same type of spacing.

    To do this: it looks like Twenty Twenty-Two has the following to set the gap:

    .wp-block-navigation, .wp-block-navigation .wp-block-page-list, .wp-block-navigation__container, .wp-block-navigation__responsive-container-content {
        gap: var(--wp--style--block-gap,2em);
    }

    …so what you could do is add the following CSS to your child theme to override it:

    .wp-block-navigation, .wp-block-navigation .wp-block-page-list, .wp-block-navigation__container, .wp-block-navigation__responsive-container-content {
        gap: 0 !important;
    }

    The use of !important feels valid here because it’s being applied to something you purposefully want to happen.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Default Twenty Twenty Two Theme has no padding between menu items on Safari’ is closed to new replies.