Skip to content

Navbar/Navs now have a focus ring #37778

@julien-deramond

Description

@julien-deramond

Prerequisites

Describe the issue

#33125 introduced a new helper to handle focus rings.

Since then, we can observe a blue outline while focusing the navbar with the mouse and with the keyboard.

2023-01-01 23 29 15

2023-01-01 23 30 05

2023-01-01 23 30 16

First of all, the outline shouldn't be displayed when the focus is given via the mouse; it should remains given by the keyboard. FWIW we removed this kind of behavior from the buttons not a long time ago.

Secondly, IMO the outline doesn't have enough contrast on our docs navbar, plus the rendering (still IMO) too much differs from the focus displayed on the navbar brand logo and from the skip links.

The possibly corresponding code:

bootstrap/scss/_nav.scss

Lines 41 to 44 in 1b39d12

&:focus {
outline: 0;
box-shadow: $nav-link-focus-box-shadow;
}

Reduced test cases

Reduced tests cases:

What operating system(s) are you seeing the problem on?

Windows, macOS, Android, iOS, Linux

What browser(s) are you seeing the problem on?

Chrome, Safari, Firefox, Microsoft Edge, Opera

What version of Bootstrap are you using?

main branch

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions