Skip to content

Inconsistent mobile/desktop breakpoint between NavBar and Search Component at 768px #5213

@ChisakaKanako

Description

@ChisakaKanako

Describe the bug

There is a UI inconsistency regarding the mobile/desktop media query breakpoints at exactly 768px width.
Currently, when the viewport width is exactly 768px:

  • The Navigation Bar switches to the Desktop view (min-width: 768px).
  • However, the Search Component still displays in the Mobile view (it seems to switch to desktop only at min-width: 769px).
    This creates a mismatched UI state at 768px where the header is in desktop mode, but clicking the search behaves like the mobile version.

Reproduction

Navigation Bar Search Component
767px Image Image
768px Image Image
769px Image Image

Expected behavior

The breakpoints should be unified. The Navigation Bar and the Search Component should transition from mobile to desktop at the exact same width.
To fix this, the layout breakpoint should probably be adjusted so that the desktop view starts at min-width: 769px (and mobile ends at max-width: 768px), aligning it with the search component's behavior.

System Info

*

Additional context

For now, I managed to fix this issue temporarily by injecting a custom Vite plugin in .vitepress/config.ts

// .vitepress/config.ts
export default {
  vite: {
    plugins: [
      { 
        name: 'fix-breakpoints', 
        transform: c => c.replace(/min-width: 768/g, 'min-width: 769').replace(/max-width: 767/g, 'max-width: 768') 
      }
    ]
  }
}

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    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