Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some Pagefind UI issues #2848

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nervous-mugs-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Fixes Pagefind UI issues due to the use of an unknown CSS custom property in the "Load more results" button and checkboxes used displayed by the [filter feature](https://pagefind.app/docs/filtering/).
5 changes: 5 additions & 0 deletions .changeset/thirty-countries-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Fixes Pagefind UI issues when using [custom metadata](https://pagefind.app/docs/metadata/).
19 changes: 17 additions & 2 deletions packages/starlight/components/Search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,20 @@ if (project.trailingSlash === 'never') dataAttributes['data-strip-trailing-slash
}

#starlight__search {
--pagefind-ui-primary: var(--sl-color-accent-light);
--pagefind-ui-primary: var(--sl-color-text);
--pagefind-ui-text: var(--sl-color-gray-2);
--pagefind-ui-font: var(--__sl-font);
--pagefind-ui-background: var(--sl-color-black);
--pagefind-ui-border: var(--sl-color-gray-5);
--pagefind-ui-border-width: 1px;
--pagefind-ui-tag: var(--sl-color-gray-5);
--sl-search-cancel-space: 5rem;
}

:root[data-theme='light'] #starlight__search {
--pagefind-ui-tag: var(--sl-color-gray-6);
}

@media (min-width: 50rem) {
#starlight__search {
--sl-search-cancel-space: 0px;
Expand Down Expand Up @@ -439,7 +444,7 @@ if (project.trailingSlash === 'never') dataAttributes['data-strip-trailing-slash
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E")
0% 0% / 100% no-repeat;
}
#starlight__search .pagefind-ui__result-nested:last-child::before {
#starlight__search .pagefind-ui__result-nested:last-of-type::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='M8 0v12m6 0H8'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='M8 0v12m6 0H8'/%3E%3C/svg%3E");
}
Expand All @@ -466,4 +471,14 @@ if (project.trailingSlash === 'never') dataAttributes['data-strip-trailing-slash
background-color: transparent;
font-weight: 600;
}

#starlight__search .pagefind-ui__filter-value::before {
border-color: var(--sl-color-text-invert);
}

#starlight__search .pagefind-ui__result-tags {
background-color: var(--sl-color-black);
margin-top: 0;
padding: var(--sl-search-result-nested-pad-block) var(--sl-search-result-pad-inline-end);
}
</style>