feat(search): make styling more configurable, align more with the theme (#2233)

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
pull/2239/head
Anthony Fu 2 years ago committed by GitHub
parent 185213c6ba
commit b2077c7025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -536,7 +536,8 @@ useEventListener('popstate', (event) => {
.backdrop {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.5);
background: var(--vp-backdrop-bg-color);
transition: opacity 0.5s;
}
.shell {
@ -546,7 +547,7 @@ useEventListener('popstate', (event) => {
display: flex;
flex-direction: column;
gap: 16px;
background: var(--vp-c-bg);
background: var(--vp-local-search-bg);
width: min(100vw - 60px, 900px);
height: min-content;
max-height: min(100vh - 128px, 900px);
@ -564,7 +565,7 @@ useEventListener('popstate', (event) => {
}
.search-bar {
border: 1px solid rgba(128, 128, 128, 0.2);
border: 1px solid var(--vp-c-divider);
border-radius: 4px;
display: flex;
align-items: center;
@ -675,7 +676,7 @@ useEventListener('popstate', (event) => {
border-radius: 4px;
transition: none;
line-height: 1rem;
border: solid 2px rgba(128, 128, 128, 0.05);
border: solid 2px var(--vp-local-search-result-border);
}
.result > div {
@ -720,7 +721,8 @@ useEventListener('popstate', (event) => {
}
.result.selected {
border-color: var(--vp-c-brand);
--vp-local-search-result-bg: var(--vp-local-search-result-selected-bg);
border-color: var(--vp-local-search-result-selected-border);
}
.excerpt-wrapper {
@ -748,10 +750,10 @@ useEventListener('popstate', (event) => {
.titles :deep(mark),
.excerpt :deep(mark) {
background-color: var(--vp-c-highlight-bg);
color: var(--vp-c-highlight-text);
background-color: var(--vp-local-search-highlight-bg);
color: var(--vp-local-search-highlight-text);
border-radius: 2px;
padding: 0 4px;
padding: 0 2px;
}
.excerpt :deep(.vp-code-group) .tabs {
@ -768,7 +770,7 @@ useEventListener('popstate', (event) => {
left: 0;
width: 100%;
height: 8px;
background: linear-gradient(transparent, var(--vp-c-bg));
background: linear-gradient(transparent, var(--vp-local-search-result-bg));
z-index: 1000;
}
@ -778,7 +780,7 @@ useEventListener('popstate', (event) => {
left: 0;
width: 100%;
height: 8px;
background: linear-gradient(var(--vp-c-bg), transparent);
background: linear-gradient(var(--vp-local-search-result-bg), transparent);
z-index: 1000;
}

@ -97,9 +97,6 @@
--vp-c-mute-lighter: #ffffff;
--vp-c-mute-dark: #e3e3e5;
--vp-c-mute-darker: #d7d7d9;
--vp-c-highlight-bg: var(--vp-c-green-lighter);
--vp-c-highlight-text: var(--vp-c-black);
}
.dark {
@ -414,3 +411,16 @@
--vp-carbon-ads-hover-text-color: var(--vp-c-brand);
--vp-carbon-ads-hover-poweredby-color: var(--vp-c-text-1);
}
/**
* Component: Local Search
* -------------------------------------------------------------------------- */
:root {
--vp-local-search-bg: var(--vp-c-bg);
--vp-local-search-result-bg: var(--vp-c-bg);
--vp-local-search-result-border: var(--vp-c-divider);
--vp-local-search-result-selected-bg: var(--vp-c-bg);
--vp-local-search-result-selected-border: var(--vp-c-brand);
--vp-local-search-highlight-bg: var(--vp-c-green-lighter);
--vp-local-search-highlight-text: var(--vp-c-black);
}

Loading…
Cancel
Save