Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#61633 closed defect (bug) (fixed)

Twenty Twenty-One: alignment of site title and navigation links

Reported by: vijaysinh9094 Owned by: karmatosed
Priority: normal Milestone: 6.7
Component: Bundled Theme Version: 5.6
Severity: minor Keywords: has-patch commit
Cc: Focuses: css

Description

I am experiencing a text alignment issue on my WordPress website, specifically with the title "WordPress-Develop" and the navigation links, when viewed on different screen sizes. The text alignment is not adapting correctly to various devices, resulting in a misaligned display.

affected devices: Tablet

Expected Behavior:

The text should be centered and aligned properly on all screen sizes, ensuring a responsive and visually appealing design.

Current theme: Twenty-twenty one.

Attachments (10)

screenshots.zip (45.0 KB ) - added by vijaysinh9094 2 years ago.
Screenshot 2024-07-11 180116.png (18.7 KB ) - added by vijaysinh9094 2 years ago.
Screenshot 2024-07-11 180156.png (14.6 KB ) - added by vijaysinh9094 2 years ago.
2021-header-before-patch-700.png (62.7 KB ) - added by sabernhardt 2 years ago.
Site Title is higher than primary menu at 700 pixels wide
2021-header-before-patch-1000.png (62.8 KB ) - added by sabernhardt 2 years ago.
Site Title is higher than primary menu at 1000 pixels wide
61633.diff (632 bytes ) - added by sabernhardt 2 years ago.
uses measurement relative to primary menu padding
2021-header-with-patch-700.png (61.6 KB ) - added by sabernhardt 2 years ago.
with patch: Site Title and primary menu at 700 pixels wide
2021-header-with-patch-1000.png (50.5 KB ) - added by sabernhardt 2 years ago.
with patch: Site Title and primary menu at 1000 pixels wide
61633.2.diff (1.2 KB ) - added by vijaysinh9094 2 years ago.
61633.2.2.diff (2.3 KB ) - added by vijaysinh9094 2 years ago.

Download all attachments as: .zip

Change History (18)

#1 @poena
2 years ago

  • Component ThemesBundled Theme
  • Keywords close 2nd-opinion added

Hi @vijaysinh9094 and welcome to WordPress Trac!

I am not sure I understand correctly. Are you asking for the site title to be centered, and the navigation to be centered but on the line below?

The theme design needs to continue to match the original design created by the designer.
For this theme, it means that the site title is centered only if there is no main menu assigned.

  • On tablets, the site title is aligned to the left. If the menu is long enough to wrap to two or more lines, the title is above the menu.
  • On mobile, the site title remains on the left and the menu collapses and uses a menu toggle button.

If the site title and/or menu was changed to be centered, this would change the look of existing live websites, and this change would be unexpected for the site owners.

#2 @sabernhardt
2 years ago

  • Focuses ui removed
  • Keywords has-patch needs-testing added; needs-patch close 2nd-opinion removed
  • Milestone Awaiting ReviewFuture Release
  • Summary Text alignment issue in responsive design on WordPress default theme, affecting title and navigation links. Alignment is not proper on different screen sizes, mostly tablet,.Twenty Twenty-One: alignment of site title and navigation links
  • Version 6.5.55.6

Thanks for the report!

I think this is about the vertical alignment. The Site Title was intended to align with the baseline of the primary navigation menu items. However, the 4-pixel top margin apparently became insufficient before the theme was publicly available.

Technically the parts would not be centered vertically because the branding container can include both the Site Title and Tagline.

@sabernhardt
2 years ago

Site Title is higher than primary menu at 700 pixels wide

@sabernhardt
2 years ago

Site Title is higher than primary menu at 1000 pixels wide

@sabernhardt
2 years ago

uses measurement relative to primary menu padding

@sabernhardt
2 years ago

with patch: Site Title and primary menu at 700 pixels wide

@sabernhardt
2 years ago

with patch: Site Title and primary menu at 1000 pixels wide

#3 @sabernhardt
2 years ago

I subtracted 0.3em (6 pixels with the standard base font size) from the --primary-nav--padding variable.

The two elements should still align if that custom property's value changes, though a change to global spacing and/or typography measurements could make different baselines (which likely happens already with 4 pixels).

#4 @sabernhardt
2 years ago

  • Severity normalminor

CSS patches for Twenty Twenty-One edit the SCSS file(s), and stylesheets are then built from that. Sometimes patches can include the built files, but I chose not to add them.

61633.diff aligns the baseline, as originally intended.

Notes about the other two patches:

  • Setting align-items: center would not work as well with a tagline, which most sites using Twenty Twenty-One should have (WordPress stopped adding a default tagline in December 2022).
  • The Site Title's default font size should not change now.

#5 @karmatosed
2 years ago

  • Owner set to karmatosed
  • Status newassigned

Assigning to myself to test and see about taking from there.

#6 @karmatosed
2 years ago

  • Resolutionfixed
  • Status assignedclosed

In 58726:

Twenty Twenty-One: Fixes alignment of site title and navigation links.

There was a text alignment issue not centering on all screen sizes. This fixes that and centers vertically.

Props vijaysinh9094, poena, sabernhardt.
Fixes #61633.

#7 @karmatosed
2 years ago

  • Keywords commit added; needs-testing removed

#8 @karmatosed
2 years ago

  • Milestone Future Release6.7
Note: See TracTickets for help on using tickets.