Improve the contrast of the Search Box in GitLab Navbar
Problem to solve
As discussed here, #324134 (comment 572559795)
The current navbar search field fails accessibility checks. Since we do not include a label with this field, this makes it even more important to meet these guidelines for the placeholder text. It has also been observed that users often miss the search field in our navbar (&8275), which improving the contrast could also help with.
Example of insufficient contrast:

Proposal
Update the navbar search field styles to meet accessibility guidelines. See designs below.
Implementation Guide
-
Update the GitLab project to use the theme color variables from GitLab UI. (#336146 (closed)) -
Update the themes to use the 100variant for the navbar links ($search-and-nav-linksvariable)-
Indigo(andLight Indigo) would usetheme-indigo-100,Light Bluewould usetheme-light-blue-100, etc. -
Lighttheme will usegray-500 -
DarkandDark Modethemes will usegray-100
-
-
For all themes (except Light- see design in Figma), use the following styles for the search field:- Default
- box-shadow: inset 0 0 0 1px
100variant of theme color ($search-and-nav-links) at 40% opacity
- box-shadow: inset 0 0 0 1px
- Hover
- box-shadow: inset 0 0 0 1px
100variant of theme color ($search-and-nav-links) at 48% opacity
- box-shadow: inset 0 0 0 1px
- Default
-
For the darker themes (Indigo, Blue, Green, Red, Dark, but not Dark Mode) use the following styles for search field: - Default
- background-color: white 12%
- Hover
- background-color: white 20%
- Default
-
For the lighter themes (Light Indigo, Light Blue, Light Green, Light Red) as well as Dark Mode, use the following styles for the search field: - Default
- background-color: black 12%
- Hover
- background-color: black 20%
- Default
-
All themes share a similar focus state (except Dark ModeandLight, which can be found here):- Focus
- background-color: white 100%
- box-shadow: 0 0 0 1px $navbar-theme-color, 0 0 0 3px $blue-400
- search icon: $gray-500
- placeholder text: $gray-500
- text: $gray-900
- Focus
-
All themes share a similar placeholder text color (except Light- $gray-500 andDark Mode- $gray-300):- Placeholder
-
100variant of theme color at 90% opacity
-
- Placeholder
-
Update the kbdelement (/) inside the search field to have the following styles:- background-color: white 16% (
Lighttheme uses black 16%) - color:
100variant of theme color (Lightuses$gray-500,Dark Modeuses$gray-300) - border-radius: 2px
- padding: 2px 4px
- background-color: white 16% (
Edited by Nick Brandt
