⌘K

Search Overlay

The search overlay is rendered by the CMS core (css/search.css) and is always present regardless of whether the search icon is visible in your navigation. Its visual appearance is controlled entirely through CSS custom properties that your theme defines in :root.


How it works

css/search.css is loaded before your theme's style.css via synaptikCSS.php. It uses CSS custom properties for every color and shape value — none are hardcoded. Your theme's :root declarations always win due to load order.

If a variable is missing from your theme, the overlay will render without that property (likely invisible or broken). All variables listed below are required.


Required CSS custom properties

Define these in the :root block of your theme's css/style.css:

:root {
  /* ── Search Overlay ─────────────────────────────── */
  --search-overlay-bg:        #1a1a18;        /* Full-screen overlay background + backdrop */
  --search-card-bg:           #2a2a25;        /* Result card background + input background */
  --search-card-bg-hover:     #111009;        /* Result card background on hover */
  --search-accent:            #3ea34e;        /* Input border, checkbox fill, clear button, scrollbar icon */
  --search-accent-dark:       #2d8a3d;        /* Close button background, scrollbar thumb, clear button hover */
  --search-accent-light:      #52c463;        /* Input border on focus, result title links */
  --search-text:              rgba(255,255,255,.85); /* Excerpt text, filter labels, count */
  --search-section-heading:   rgba(255,255,255,.35); /* "Articles" / "Projects" section headings */
  --search-radius:            4px;            /* Border radius for close button and UI elements */
}

Variable reference

VariableUsed onNotes
--search-overlay-bgOverlay background, backdrop-filter containerShould be semi-transparent or dark to create contrast with the page
--search-card-bgResult card background, input field backgroundShould contrast against --search-overlay-bg
--search-card-bg-hoverResult card background on :hoverTypically darker than --search-card-bg
--search-accentInput border, checkbox checked state, clear button background, nav iconYour theme's primary accent color
--search-accent-darkClose button background, scrollbar thumb, clear button :hoverDarker variant of --search-accent
--search-accent-lightInput border on :focus, result title link colorLighter variant of --search-accent
--search-textExcerpt text, filter checkbox labels, results countShould be readable against --search-card-bg
--search-section-heading"Articles", "Projects", "Pages" section headingsUsually muted — visually subordinate to result titles
--search-radiusClose button, UI controlsSet to match your theme's global border radius style

Light theme example

:root {
  --search-overlay-bg:        rgba(245, 243, 238, 0.97);
  --search-card-bg:           #eeeae0;
  --search-card-bg-hover:     #ffffff;
  --search-accent:            #e05522;
  --search-accent-dark:       #b83e15;
  --search-accent-light:      #ff7043;
  --search-text:              #1a1814;
  --search-section-heading:   #6b6660;
  --search-radius:            6px;
}

Dark theme example

:root {
  --search-overlay-bg:        #18181c;
  --search-card-bg:           #1a1a1f;
  --search-card-bg-hover:     #0c0c0e;
  --search-accent:            #8aff5e;
  --search-accent-dark:       #6ee048;
  --search-accent-light:      #a0ff7a;
  --search-text:              #e8e8ec;
  --search-section-heading:   #9090a0;
  --search-radius:            3px;
}

Referencing theme tokens

Rather than hardcoding colors, point the search variables at your existing theme tokens:

:root {
  /* ... your theme tokens ... */
  --color-primary:  #ff9e00;
  --color-primary-dark:  #f08700;
  --color-primary-light: #ffb84c;
  --bg-darker: #2e294e;

  /* Search — mapped to theme tokens */
  --search-overlay-bg:      var(--bg-darker);
  --search-card-bg:         rgba(255, 255, 255, 0.07);
  --search-card-bg-hover:   rgba(255, 255, 255, 0.03);
  --search-accent:          var(--color-primary);
  --search-accent-dark:     var(--color-primary-dark);
  --search-accent-light:    var(--color-primary-light);
  --search-text:            rgba(255, 255, 255, 0.85);
  --search-section-heading: rgba(255, 255, 255, 0.35);
  --search-radius:          var(--border-radius-sm);
}

Result type badge colors

The article, page, and project type badges use hardcoded colors in search.css and are not currently themeable via CSS custom properties:

TypeDefault color
Article#489e64 (green)
Page#e6972f (amber)
Project#3f82c5 (blue)

To override these in your theme, add rules with higher specificity:

.result-type.article { background-color: var(--color-primary); }
.result-type.page    { background-color: var(--color-secondary); }
.result-type.project { background-color: var(--color-accent); }

Highlight color

Matched search terms are highlighted with a hardcoded yellow (#fcf04c) on a dark text. This is intentionally fixed for readability and is not part of the theme palette.


Notes

  • --search-border-radius-sm (old name) and --search-secondary (unused) appeared in earlier theme templates — both are obsolete and should be removed from your theme.
  • The search overlay uses z-index: 1000. If your theme's navigation uses backdrop-filter, call render_adminbar() as the first child of <body> to avoid stacking context conflicts — the same pattern applies here.