Warning, /eic.github.io/css/smart-search.css is written in an unsupported language. File is not indexed.
0001 /*
0002 * Smart-search additions. Append this block to css/custom.css (or include as
0003 * a separate stylesheet). All rules are namespaced under .smart-search-* or
0004 * scoped via :has(#siteSearchSubmit), so sites running in the Lunr-fallback
0005 * path are unaffected.
0006 */
0007
0008 /* ---------- arrow submit button inside the search bar -------------------- */
0009
0010 .site-search-input-wrap:has(.site-search-submit) .site-search-input {
0011 padding-right: 3.25rem;
0012 }
0013
0014 .site-search-submit {
0015 position: absolute;
0016 top: 50%;
0017 right: 0.3rem;
0018 transform: translateY(-50%);
0019 display: inline-flex;
0020 align-items: center;
0021 justify-content: center;
0022 width: 2rem;
0023 height: 2rem;
0024 border: 0;
0025 border-radius: 999px;
0026 background-color: #0ea5e9;
0027 color: #ffffff;
0028 cursor: pointer;
0029 transition: background-color 120ms ease;
0030 }
0031
0032 .site-search-submit:hover:not(:disabled) {
0033 background-color: #0284c7;
0034 }
0035
0036 .site-search-submit:hover:not(:disabled) svg {
0037 transform: translateX(2px);
0038 }
0039
0040 .site-search-submit svg {
0041 transition: transform 180ms ease;
0042 }
0043
0044 .site-search-submit:disabled {
0045 opacity: 0.55;
0046 cursor: not-allowed;
0047 }
0048
0049 .site-search-submit[data-loading="true"] svg {
0050 animation: smart-search-spin 1s linear infinite;
0051 }
0052
0053 @keyframes smart-search-spin {
0054 to { transform: rotate(360deg); }
0055 }
0056
0057 /* Raise the panel unambiguously above the navbar and any dropdowns. A hovered
0058 * card elsewhere on the page that creates its own stacking context (via
0059 * transform) stays behind. */
0060 .site-search-nav:has(#siteSearchSubmit) .site-search-panel {
0061 z-index: 1090;
0062 isolation: isolate;
0063 }
0064
0065 /* ---------- centered search bar on extra-large screens ------------------- */
0066
0067 /*
0068 * When smart search is enabled AND the viewport is wide enough that the left
0069 * nav items (brand + dropdowns like Tutorials/Software) and the right cluster
0070 * leave real middle space, float the bar into the visual center of the
0071 * navbar. On anything narrower (including zoomed-in viewports via
0072 * Ctrl+scroll) the bar falls back to the natural right-aligned flow position
0073 * so it never overlaps the menu items.
0074 */
0075 @media (min-width: 1200px) {
0076 .site-search-nav:has(#siteSearchSubmit) {
0077 position: absolute;
0078 left: 50%;
0079 top: 50%;
0080 transform: translate(-50%, -50%);
0081 width: min(30rem, 40vw);
0082 }
0083 }
0084
0085 /* ---------- results panel: wider + centered below input at xl+ ---------- */
0086
0087 @media (min-width: 1200px) {
0088 .site-search-nav:has(#siteSearchSubmit) .site-search-panel {
0089 left: 50%;
0090 right: auto;
0091 transform: translateX(-50%);
0092 width: min(46rem, 92vw);
0093 max-height: min(72vh, 38rem);
0094 border-radius: 1rem;
0095 }
0096 }
0097
0098 /*
0099 * Single scrolling container. The existing site CSS sets `overflow: hidden`
0100 * on .site-search-panel (no max-height) and a separate max-height on
0101 * .site-search-results. Because the panel is position:absolute inside a
0102 * fixed navbar, if we don't cap the panel height, overflow has nowhere to
0103 * scroll to: the last source card literally renders off-viewport and gets
0104 * clipped mid-card. Fix: cap the panel at ~viewport - navbar and let the
0105 * whole thing scroll as one unit.
0106 */
0107 .site-search-nav:has(#siteSearchSubmit) .site-search-panel {
0108 max-height: min(calc(100vh - 5rem), 40rem);
0109 overflow-y: auto;
0110 overflow-x: hidden;
0111 overscroll-behavior: contain;
0112 }
0113
0114 .site-search-nav:has(#siteSearchSubmit) .site-search-results {
0115 max-height: none;
0116 overflow: visible;
0117 }
0118
0119 /* Smooth entry — default (not centered). */
0120 .site-search-nav:has(#siteSearchSubmit) .site-search-panel {
0121 animation: smart-search-panel-in-flow 140ms ease-out;
0122 }
0123
0124 @keyframes smart-search-panel-in-flow {
0125 from { opacity: 0; transform: translateY(-4px); }
0126 to { opacity: 1; transform: translateY(0); }
0127 }
0128
0129 /* When centered (xl+), the panel is also translateX-centered, so its
0130 * entry animation must preserve that X offset. */
0131 @media (min-width: 1200px) {
0132 .site-search-nav:has(#siteSearchSubmit) .site-search-panel {
0133 animation: smart-search-panel-in-centered 160ms ease-out;
0134 }
0135 @keyframes smart-search-panel-in-centered {
0136 from { opacity: 0; transform: translate(-50%, -4px); }
0137 to { opacity: 1; transform: translate(-50%, 0); }
0138 }
0139 }
0140
0141 /* ---------- answer block ------------------------------------------------ */
0142
0143 .site-search-answer {
0144 position: relative;
0145 padding: 1rem 1.1rem 0.9rem 1.25rem;
0146 font-size: 0.95rem;
0147 line-height: 1.6;
0148 color: #1f2937;
0149 background-color: #ffffff;
0150 border-bottom: 1px solid rgba(15, 23, 42, 0.06);
0151 }
0152
0153 /* Left accent stripe. Scoped to the smart-search panel. */
0154 .site-search-nav:has(#siteSearchSubmit) .site-search-answer::before {
0155 content: "";
0156 position: absolute;
0157 top: 0.9rem;
0158 bottom: 0.9rem;
0159 left: 0.5rem;
0160 width: 3px;
0161 background-color: #0ea5e9;
0162 border-radius: 999px;
0163 opacity: 0.9;
0164 }
0165
0166 .site-search-answer p { margin: 0 0 0.6rem; }
0167 .site-search-answer p:last-child { margin-bottom: 0; }
0168 .site-search-answer strong { font-weight: 600; color: #0f172a; }
0169 .site-search-answer em { font-style: italic; }
0170
0171 /* Headings — answers rarely need them, but when the LLM emits one, keep it
0172 * proportional to body text instead of inheriting Bootstrap's massive h1/h2. */
0173 .site-search-answer h1,
0174 .site-search-answer h2,
0175 .site-search-answer h3,
0176 .site-search-answer h4,
0177 .site-search-answer h5,
0178 .site-search-answer h6 {
0179 margin: 0.9rem 0 0.4rem;
0180 font-weight: 600;
0181 line-height: 1.3;
0182 color: #0f172a;
0183 }
0184 .site-search-answer h1 { font-size: 1.05rem; }
0185 .site-search-answer h2 { font-size: 1rem; }
0186 .site-search-answer h3 { font-size: 0.97rem; }
0187 .site-search-answer h4,
0188 .site-search-answer h5,
0189 .site-search-answer h6 { font-size: 0.95rem; color: #334155; }
0190 .site-search-answer h1:first-child,
0191 .site-search-answer h2:first-child,
0192 .site-search-answer h3:first-child { margin-top: 0; }
0193
0194 /* Lists — Bootstrap's reset leaves these unstyled inside the panel. Give
0195 * them tight, readable indent and spacing that matches the body line-height. */
0196 .site-search-answer ul,
0197 .site-search-answer ol {
0198 margin: 0.25rem 0 0.7rem;
0199 padding-left: 1.25rem;
0200 }
0201 .site-search-answer ul { list-style: disc; }
0202 .site-search-answer ol { list-style: decimal; }
0203 .site-search-answer li {
0204 margin: 0.15rem 0;
0205 padding-left: 0.15rem;
0206 }
0207 .site-search-answer li > p { margin: 0 0 0.25rem; }
0208 .site-search-answer li:last-child { margin-bottom: 0; }
0209 .site-search-answer ul ul,
0210 .site-search-answer ol ol,
0211 .site-search-answer ul ol,
0212 .site-search-answer ol ul {
0213 margin: 0.15rem 0 0.15rem;
0214 }
0215
0216 .site-search-answer blockquote {
0217 margin: 0.5rem 0 0.7rem;
0218 padding: 0.1rem 0 0.1rem 0.75rem;
0219 border-left: 3px solid #cbd5e1;
0220 color: #475569;
0221 }
0222 .site-search-answer blockquote p:last-child { margin-bottom: 0; }
0223
0224 .site-search-answer hr {
0225 border: 0;
0226 border-top: 1px solid rgba(15, 23, 42, 0.08);
0227 margin: 0.8rem 0;
0228 }
0229
0230 .site-search-answer table {
0231 border-collapse: collapse;
0232 margin: 0.5rem 0 0.7rem;
0233 font-size: 0.88rem;
0234 width: auto;
0235 }
0236 .site-search-answer th,
0237 .site-search-answer td {
0238 border: 1px solid rgba(15, 23, 42, 0.1);
0239 padding: 0.3rem 0.55rem;
0240 text-align: left;
0241 }
0242 .site-search-answer th {
0243 background-color: #f8fafc;
0244 font-weight: 600;
0245 }
0246
0247 .site-search-answer code {
0248 background-color: #f1f5f9;
0249 color: #0f172a;
0250 padding: 0.1em 0.35em;
0251 border-radius: 0.25rem;
0252 font-size: 0.88em;
0253 font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
0254 border: 1px solid rgba(15, 23, 42, 0.06);
0255 }
0256 .site-search-answer pre {
0257 background-color: #f8fafc;
0258 padding: 0;
0259 border-radius: 0.5rem;
0260 overflow: hidden;
0261 font-size: 0.85em;
0262 margin: 0.7rem 0;
0263 border: 1px solid rgba(15, 23, 42, 0.08);
0264 }
0265
0266 /* ---------- smart-code blocks (fenced code with header + copy) --------- */
0267
0268 .site-search-answer pre.smart-code {
0269 background-color: #f8fafc;
0270 padding: 0;
0271 margin: 0.7rem 0;
0272 }
0273
0274 .smart-code-header {
0275 display: flex;
0276 align-items: center;
0277 justify-content: space-between;
0278 padding: 0.35rem 0.7rem;
0279 background-color: #eef2f7;
0280 border-bottom: 1px solid rgba(15, 23, 42, 0.08);
0281 font-size: 0.7rem;
0282 color: #475569;
0283 font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
0284 }
0285
0286 .smart-code-lang {
0287 text-transform: lowercase;
0288 letter-spacing: 0.02em;
0289 }
0290
0291 .smart-code-copy {
0292 border: 0;
0293 background: transparent;
0294 color: #475569;
0295 font-size: 0.7rem;
0296 font-family: inherit;
0297 cursor: pointer;
0298 padding: 0.15rem 0.45rem;
0299 border-radius: 0.25rem;
0300 transition: background-color 120ms ease, color 120ms ease;
0301 }
0302
0303 .smart-code-copy:hover {
0304 background-color: rgba(15, 23, 42, 0.08);
0305 color: #1f2937;
0306 }
0307
0308 .smart-code-copy[data-state="copied"] {
0309 color: #047857;
0310 }
0311
0312 .smart-code-copy[data-state="error"] {
0313 color: #b91c1c;
0314 }
0315
0316 .site-search-answer pre.smart-code code {
0317 display: block;
0318 padding: 0.7rem 0.9rem;
0319 background: transparent;
0320 font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
0321 font-size: 0.82rem;
0322 line-height: 1.5;
0323 color: #0f172a;
0324 overflow-x: auto;
0325 white-space: pre;
0326 }
0327
0328 .site-search-answer pre.smart-code code::-webkit-scrollbar { height: 6px; }
0329 .site-search-answer pre.smart-code code::-webkit-scrollbar-thumb {
0330 background-color: rgba(15, 23, 42, 0.15);
0331 border-radius: 3px;
0332 }
0333
0334 /* ---------- minimal highlight.js theme (medium tone, no pink) ---------- */
0335 /* Replaces the default GitHub palette (harsh pink keywords #d73a49 and
0336 * purple titles #6f42c1) with mid-weight Tailwind 500/600s. Calm on the
0337 * #f8fafc code background, still readable, no overly dark slabs. */
0338
0339 .site-search-answer .hljs-comment,
0340 .site-search-answer .hljs-quote { color: #94a3b8; font-style: italic; }
0341 .site-search-answer .hljs-keyword,
0342 .site-search-answer .hljs-selector-tag,
0343 .site-search-answer .hljs-subst { color: #2563eb; }
0344 .site-search-answer .hljs-number,
0345 .site-search-answer .hljs-literal,
0346 .site-search-answer .hljs-variable,
0347 .site-search-answer .hljs-template-variable,
0348 .site-search-answer .hljs-tag .hljs-attr { color: #0891b2; }
0349 .site-search-answer .hljs-string,
0350 .site-search-answer .hljs-doctag { color: #16a34a; }
0351 .site-search-answer .hljs-title,
0352 .site-search-answer .hljs-section,
0353 .site-search-answer .hljs-selector-id { color: #475569; font-weight: 600; }
0354 .site-search-answer .hljs-type,
0355 .site-search-answer .hljs-class .hljs-title { color: #64748b; }
0356 .site-search-answer .hljs-tag,
0357 .site-search-answer .hljs-name,
0358 .site-search-answer .hljs-attribute { color: #0d9488; }
0359 .site-search-answer .hljs-regexp,
0360 .site-search-answer .hljs-link { color: #16a34a; }
0361 .site-search-answer .hljs-symbol,
0362 .site-search-answer .hljs-bullet { color: #d97706; }
0363 .site-search-answer .hljs-built_in,
0364 .site-search-answer .hljs-builtin-name { color: #2563eb; }
0365 .site-search-answer .hljs-meta { color: #94a3b8; }
0366 .site-search-answer .hljs-deletion { background-color: #fef2f2; }
0367 .site-search-answer .hljs-addition { background-color: #f0fdf4; }
0368 .site-search-answer .hljs-emphasis { font-style: italic; }
0369 .site-search-answer .hljs-strong { font-weight: 700; }
0370 .site-search-answer a { color: #0284c7; text-decoration: none; }
0371 .site-search-answer a:hover { text-decoration: underline; }
0372
0373 .site-search-answer sup a {
0374 display: inline-block;
0375 padding: 0 0.25rem;
0376 margin: 0 0.05rem;
0377 background-color: #e0f2fe;
0378 color: #075985;
0379 border-radius: 0.25rem;
0380 font-size: 0.7em;
0381 font-weight: 600;
0382 text-decoration: none;
0383 }
0384 .site-search-answer sup a:hover {
0385 background-color: #bae6fd;
0386 text-decoration: none;
0387 }
0388
0389 /* Small hint row above the list when in preview mode. */
0390 .site-search-meta {
0391 display: flex;
0392 flex-wrap: wrap;
0393 gap: 0.35rem;
0394 padding: 0.5rem 1rem 0.55rem;
0395 background-color: #fafafa;
0396 border-bottom: 1px solid rgba(15, 23, 42, 0.05);
0397 font-size: 0.72rem;
0398 color: #6b7280;
0399 }
0400
0401 .smart-search-badge {
0402 display: inline-flex;
0403 align-items: center;
0404 gap: 0.25rem;
0405 padding: 0.1rem 0.45rem;
0406 border-radius: 999px;
0407 background-color: #f1f5f9;
0408 font-variant-numeric: tabular-nums;
0409 }
0410
0411 .smart-search-badge-hint {
0412 background-color: #fef3c7;
0413 color: #92400e;
0414 }
0415
0416 /* ---------- citation cards --------------------------------------------- */
0417
0418 .smart-search-citation {
0419 padding: 0.75rem 1rem !important;
0420 /* Bootstrap's .list-group-item uses rgba(0,0,0,0.125) — a crisp dark
0421 * line between cards. Soften to a barely-there separator. */
0422 border-color: rgba(15, 23, 42, 0.06) !important;
0423 }
0424
0425 /* Remove the outer border on first/last cards so the list visually melts
0426 * into the answer block above and the panel edge below. */
0427 .smart-search-citation:first-child {
0428 border-top: 0 !important;
0429 }
0430 .smart-search-citation:last-child {
0431 border-bottom: 0 !important;
0432 }
0433
0434 .smart-search-citation-row {
0435 display: grid;
0436 grid-template-columns: auto 1fr auto;
0437 gap: 0.75rem;
0438 align-items: start;
0439 }
0440
0441 .smart-search-citation-index {
0442 flex-shrink: 0;
0443 width: 1.6rem;
0444 height: 1.6rem;
0445 background-color: #e0f2fe;
0446 color: #075985;
0447 border-radius: 0.45rem;
0448 font-size: 0.78rem;
0449 font-weight: 700;
0450 display: inline-flex;
0451 align-items: center;
0452 justify-content: center;
0453 font-variant-numeric: tabular-nums;
0454 line-height: 1;
0455 margin-top: 0.1rem;
0456 }
0457
0458 .smart-search-citation-body {
0459 min-width: 0;
0460 }
0461
0462 .smart-search-breadcrumb {
0463 display: flex;
0464 flex-wrap: wrap;
0465 align-items: center;
0466 gap: 0.25rem;
0467 font-size: 0.72rem;
0468 color: #64748b;
0469 text-transform: capitalize;
0470 margin-bottom: 0.1rem;
0471 overflow: hidden;
0472 }
0473
0474 .smart-search-breadcrumb-sep {
0475 color: #cbd5e1;
0476 }
0477
0478 .smart-search-citation-title {
0479 font-weight: 600;
0480 font-size: 0.97rem;
0481 color: #111827;
0482 line-height: 1.3;
0483 margin-bottom: 0.2rem;
0484 overflow: hidden;
0485 text-overflow: ellipsis;
0486 display: -webkit-box;
0487 -webkit-line-clamp: 2;
0488 -webkit-box-orient: vertical;
0489 }
0490
0491 .smart-search-citation-snippet {
0492 font-size: 0.835rem;
0493 line-height: 1.45;
0494 color: #475569;
0495 display: -webkit-box;
0496 -webkit-line-clamp: 2;
0497 -webkit-box-orient: vertical;
0498 overflow: hidden;
0499 }
0500
0501 .smart-search-citation-score {
0502 flex-shrink: 0;
0503 align-self: start;
0504 margin-top: 0.25rem;
0505 font-size: 0.7rem;
0506 font-weight: 600;
0507 color: #94a3b8;
0508 background-color: #f8fafc;
0509 padding: 0.1rem 0.4rem;
0510 border-radius: 999px;
0511 font-variant-numeric: tabular-nums;
0512 }
0513
0514 /* ---------- popular queries (empty-input suggestions) ------------------ */
0515
0516 .smart-search-popular {
0517 display: flex;
0518 flex-wrap: wrap;
0519 gap: 0.45rem;
0520 padding: 0.75rem 1rem 0.95rem;
0521 background-color: #ffffff;
0522 }
0523
0524 .smart-search-popular-chip {
0525 display: inline-flex;
0526 align-items: center;
0527 gap: 0.45rem;
0528 padding: 0.4rem 0.8rem;
0529 border: 1px solid rgba(15, 23, 42, 0.1);
0530 border-radius: 999px;
0531 background-color: #f8fafc;
0532 color: #1f2937;
0533 font-size: 0.85rem;
0534 line-height: 1.2;
0535 text-align: left;
0536 cursor: pointer;
0537 transition: background-color 120ms ease, border-color 120ms ease, transform 80ms ease;
0538 }
0539
0540 .smart-search-popular-chip:hover,
0541 .smart-search-popular-chip:focus {
0542 background-color: #eef2f7;
0543 border-color: rgba(15, 23, 42, 0.18);
0544 outline: 0;
0545 }
0546
0547 .smart-search-popular-chip:active {
0548 transform: translateY(1px);
0549 }
0550
0551 .smart-search-popular-query {
0552 max-width: 22rem;
0553 overflow: hidden;
0554 text-overflow: ellipsis;
0555 white-space: nowrap;
0556 }
0557
0558 .smart-search-popular-count {
0559 display: inline-flex;
0560 align-items: center;
0561 justify-content: center;
0562 min-width: 1.35rem;
0563 padding: 0 0.35rem;
0564 height: 1.25rem;
0565 background-color: #e0f2fe;
0566 color: #075985;
0567 border-radius: 999px;
0568 font-size: 0.7rem;
0569 font-weight: 600;
0570 font-variant-numeric: tabular-nums;
0571 }
0572
0573 /* ---------- hover / focus override (neutral, very light) ---------------- */
0574
0575 /*
0576 * Bootstrap's .list-group-item-action gives source cards a tinted blue-gray
0577 * hover and a 0.25rem focus ring. Override to a near-neutral wash so the
0578 * card highlights without competing with the answer block. Scoped via the
0579 * smart-search specific class so Lunr fallback cards are untouched.
0580 */
0581 .smart-search-citation {
0582 transition: background-color 120ms ease;
0583 }
0584
0585 /*
0586 * Hover / focus / active: keep the card essentially white so the body text
0587 * stays fully readable, and force the text back to its normal color (Bootstrap
0588 * swaps it to a muted #495057 grey on hover, which is what makes the content
0589 * look washed out). !important + a high-specificity selector are used because
0590 * Bootstrap's own .list-group-item-action:hover sits on the same cascade
0591 * level and ships after our stylesheet.
0592 */
0593 .smart-search-citation.list-group-item-action:hover,
0594 .smart-search-citation.list-group-item-action:focus {
0595 background-color: #f3f6fb !important;
0596 color: #1f2937 !important;
0597 box-shadow: inset 3px 0 0 rgba(14, 165, 233, 0.55) !important;
0598 outline: 0 !important;
0599 }
0600
0601 .smart-search-citation.list-group-item-action:active {
0602 background-color: #e8eef7 !important;
0603 color: #1f2937 !important;
0604 box-shadow: inset 3px 0 0 rgba(14, 165, 233, 0.7) !important;
0605 outline: 0 !important;
0606 }
0607
0608 .smart-search-citation.list-group-item-action:hover .smart-search-citation-title,
0609 .smart-search-citation.list-group-item-action:focus .smart-search-citation-title,
0610 .smart-search-citation.list-group-item-action:active .smart-search-citation-title {
0611 color: #111827 !important;
0612 }
0613
0614 .smart-search-citation.list-group-item-action:hover .smart-search-citation-snippet,
0615 .smart-search-citation.list-group-item-action:focus .smart-search-citation-snippet,
0616 .smart-search-citation.list-group-item-action:active .smart-search-citation-snippet {
0617 color: #334155 !important;
0618 }
0619
0620 .smart-search-citation.list-group-item-action:focus-visible {
0621 outline: 2px solid rgba(14, 165, 233, 0.55) !important;
0622 outline-offset: -2px;
0623 }
0624
0625 /* ---------- small-screen adjustments ------------------------------------- */
0626
0627 /*
0628 * On mobile, `.site-search-nav` is a narrow column pinned to the right of the
0629 * navbar (next to the toggler), so an absolutely-positioned panel uses that
0630 * narrow box as its containing block. With width ≈ 100vw and a small negative
0631 * `right`, the panel's left edge would land off-screen. Switch to fixed
0632 * positioning so the panel anchors to the viewport directly and spans full
0633 * width regardless of how narrow the host nav is.
0634 */
0635 @media (max-width: 991.98px) {
0636 .site-search-nav:has(#siteSearchSubmit) .site-search-panel {
0637 position: fixed;
0638 top: 3.75rem;
0639 left: 0.5rem;
0640 right: 0.5rem;
0641 width: auto;
0642 max-height: min(calc(100vh - 4.5rem), 40rem);
0643 }
0644 }
0645
0646 @media (max-width: 575.98px) {
0647 .smart-search-citation-title { font-size: 0.92rem; }
0648 }