diff --git a/components/Search.module.scss b/components/Search.module.scss index e6a1bda377..bb005d34e9 100644 --- a/components/Search.module.scss +++ b/components/Search.module.scss @@ -4,16 +4,16 @@ } .searchResultTitle mark { - color: var(--color-auto-blue-5); + color: var(--color-text-link); } .searchResultIntro mark { - border-bottom: 1px solid var(--color-auto-blue-5); + border-bottom: 1px solid currentColor; } .searchResultContent mark { text-decoration: none; - border-bottom: 1px dotted var(--color-auto-gray-5); + border-bottom: 1px dotted currentColor; } .searchResultTitle em { @@ -31,7 +31,7 @@ background: var(--color-bg-primary); box-shadow: 0 1px 15px rgba(0, 0, 0, 0.15); transition: width 0.3s ease-in-out; - padding: 64px 24px 24px; + padding-top: 64px; } .resultsContainerOpen { diff --git a/components/Search.tsx b/components/Search.tsx index 392fb18348..df93b3c40f 100644 --- a/components/Search.tsx +++ b/components/Search.tsx @@ -37,7 +37,7 @@ export function Search({ const [query, setQuery] = useState(router.query.query || '') const [results, setResults] = useState>([]) const [isLoading, setIsLoading] = useState(false) - const [activeHit, setActiveHit] = useState(0) + const [activeHit, setActiveHit] = useState(-1) const inputRef = useRef(null) const { t } = useTranslation('search') const { currentVersion } = useVersion() @@ -164,55 +164,53 @@ export function Search({
{results.length > 0 ? ( -
    - {results.map(({ url, breadcrumbs, heading, title, content }, index) => ( -
  1. -
  2. - ))} +
      + {results.map(({ url, breadcrumbs, heading, title, content }, index) => { + const isActive = index === activeHit + return ( +
    1. setActiveHit(index)} + > +
    2. + ) + })}
    ) : ( isOverlay && ( -
    +
    {isLoading ? {t('loading')}... : {t('no_results')}.}
    ) diff --git a/stylesheets/utilities.scss b/stylesheets/utilities.scss index 902cc219b7..90dea4546a 100644 --- a/stylesheets/utilities.scss +++ b/stylesheets/utilities.scss @@ -18,9 +18,12 @@ min-height: 100vh; } +.outline-none { + outline: none; +} + /* Print utilities ------------------------------------------------------------------------------*/ - @media print { .no-print { display: none; @@ -29,7 +32,6 @@ /* Opacity utilities ------------------------------------------------------------------------------*/ - .opacity-0 { opacity: 0; } @@ -45,7 +47,6 @@ /* Text utilities ------------------------------------------------------------------------------*/ - .underline-dashed { padding-bottom: $spacer-1; background-image: linear-gradient( @@ -58,23 +59,24 @@ background-size: 10px 1px; } +.font-weight-semibold { + font-weight: $font-weight-semibold; +} + /* List utilities ------------------------------------------------------------------------------*/ - .list-style-inside { list-style: inside; } /* Hover utilities ------------------------------------------------------------------------------*/ - .hover\:color-bg-info:hover { background: var(--color-bg-info); } /* Z-Index utilities ------------------------------------------------------------------------------*/ - .-z-1 { z-index: -1; } @@ -87,7 +89,6 @@ /* Gradient utilities ------------------------------------------------------------------------------*/ - .fade-tertiary-left { background: linear-gradient(to right, var(--color-bg-primary), transparent); } @@ -114,12 +115,8 @@ background-color: var(--color-auto-blue-6); } -/* Semibold text +/* Border colors ------------------------------------------------------------------------------*/ -.font-weight-semibold { - font-weight: $font-weight-semibold; -} - -.outline-none { - outline: none; +.color-border-transparent { + border-color: transparent !important; }