Make WordPress Core

Opened 4 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#61633 closed defect (bug) (fixed)

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

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

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 4 weeks ago.
Screenshot 2024-07-11 180116.png (18.7 KB) - added by vijaysinh9094 4 weeks ago.
Screenshot 2024-07-11 180156.png (14.6 KB) - added by vijaysinh9094 4 weeks ago.
2021-header-before-patch-700.png (62.7 KB) - added by sabernhardt 3 weeks ago.
Site Title is higher than primary menu at 700 pixels wide
2021-header-before-patch-1000.png (62.8 KB) - added by sabernhardt 3 weeks ago.
Site Title is higher than primary menu at 1000 pixels wide
61633.diff (632 bytes) - added by sabernhardt 3 weeks ago.
uses measurement relative to primary menu padding
2021-header-with-patch-700.png (61.6 KB) - added by sabernhardt 3 weeks ago.
with patch: Site Title and primary menu at 700 pixels wide
2021-header-with-patch-1000.png (50.5 KB) - added by sabernhardt 3 weeks ago.
with patch: Site Title and primary menu at 1000 pixels wide
61633.2.diff (1.2 KB) - added by vijaysinh9094 3 weeks ago.
61633.2.2.diff (2.3 KB) - added by vijaysinh9094 3 weeks ago.

Download all attachments as: .zip

Change History (18)

#1 @poena
3 weeks ago

  • Component changed from Themes to Bundled 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
3 weeks ago

  • Focuses ui removed
  • Keywords has-patch needs-testing added; needs-patch close 2nd-opinion removed
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from 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,. to Twenty Twenty-One: alignment of site title and navigation links
  • Version changed from 6.5.5 to 5.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
3 weeks ago

Site Title is higher than primary menu at 700 pixels wide

@sabernhardt
3 weeks ago

Site Title is higher than primary menu at 1000 pixels wide

@sabernhardt
3 weeks ago

uses measurement relative to primary menu padding

@sabernhardt
3 weeks ago

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

@sabernhardt
3 weeks ago

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

#3 @sabernhardt
3 weeks 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
3 weeks ago

  • Severity changed from normal to minor

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
3 weeks ago

  • Owner set to karmatosed
  • Status changed from new to assigned

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

#6 @karmatosed
3 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

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
3 weeks ago

  • Keywords commit added; needs-testing removed

#8 @karmatosed
3 weeks ago

  • Milestone changed from Future Release to 6.7
Note: See TracTickets for help on using tickets.