-
Notifications
You must be signed in to change notification settings - Fork 414
Description
Search result highlighting on destination pages (the ?q= parameter feature) uses bare <mark> elements, which inherit Bootstrap's default styling via $mark-bg / --bs-highlight-bg (yellow-100).
Users can already customize this through Bootstrap:
/*-- scss:defaults --*/
$mark-bg: #d1ecf1;or via CSS:
:root {
--bs-highlight-bg: #d1ecf1;
}However, $mark-bg affects all <mark> elements on the page, not just search highlights. It would be useful to have a Quarto-specific SCSS variable like $search-highlight-bg that targets only search result marks, and is documented alongside other SCSS variables at https://quarto.org/docs/output-formats/html-themes.html#sass-variables.
This could be implemented by adding a CSS class to the <mark> elements created in quarto-search.js (line 1138):
const markEl = txt => {
const el = document.createElement("mark");
el.appendChild(document.createTextNode(txt));
return el
}and styling that class with a dedicated SCSS variable that falls back to $mark-bg.
Context: quarto-dev/quarto-web#1927 (review discussion)