Skip to content

Making navbar width consistent with the main layout on large displays #7562

@jetxr

Description

@jetxr

Have you read the Contributing Guidelines on issues?

Description

  • On large displays, the navbar's width isn't matched to the main content, footer, and it expands to the edges of the screen making it easy to miss the navbar's contents. (demonstrating the issue on docusaurus.io below in screenshot)

  • However, if max-width and justify-content are applied, it makes the navbar more consistent with the rest of the design.

  • I've added the following to my custom.css, and it seems to be working

.navbar {
	justify-content: center;
}

.navbar__inner {
	max-width: var(--ifm-container-width-xl);
}
  • Should this be Docusaurus' default behavior?

Issue

docusaurus(iMac) - Issue


Suggested Change

docusaurus(iMac) - Suggestion

Has this been requested on Canny?

No response

Motivation

  • On large displays, with main body having a max width, it's looks a bit out of place to have the menu items at the edges, and not have the navbar as the same width as the rest of the content.

  • When the nabar is the same max width as the content area, you don't need to scan the entire width of the screen. The entire page stays a vertical scannable area. For ex. https://developer.apple.com/documentation/Xcode/Xcode-Cloud

API design

No response

Have you tried building it?

No response

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    better engineeringNot a bug or feature requestdomain: themeRelated to the default theme componentsstatus: accepting prThis issue has been accepted, and we are looking for community contributors to implement this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions