Search & Discover Styling
Styling
Layout CSS lives under .sdjs__. Brand colors are --sdjs-brand-* tokens on :root. Set overrides on the host page after the plugin stylesheet. Tokens on :root restyle the launcher and the pane without editing the compiled CSS.
<link rel="stylesheet" href="preferabli.searchdiscover.style.css" />
<style>
:root {
--sdjs-brand-primary: #323e48;
--sdjs-brand-accent: #b6af9c;
--sdjs-brand-on-primary: #fff;
}
</style>Quick brand override
These three cover a host brand. Everything in the next list follows them until you set that token yourself.
:root {
--sdjs-brand-primary: #323e48;
--sdjs-brand-accent: #b6af9c;
--sdjs-brand-on-primary: #fff;
}| Token | Also restyles |
|---|---|
--sdjs-brand-primary | Search header fill, footer fill, launcher fill, active tab fill, detail back button, trait icons, launcher hover, tab hover |
--sdjs-brand-accent | How It Tastes bar fill, flavor and pairing tile fill |
--sdjs-brand-on-primary | Launcher text, active tab label, detail back-button icon |
Search header text, search header icons, and footer text stay #fff. On a light primary, set these as well:
:root {
--sdjs-brand-nav-header-font-color: #323e48;
--sdjs-brand-nav-button-content-color: #323e48;
--sdjs-brand-footer-content-color: #323e48;
}Set a derived token only when that one surface should leave the palette:
:root {
--sdjs-brand-tab-active-bg: #8e7d49;
--sdjs-brand-fact-box-background-color: rgba(182, 175, 156, 0.15);
--sdjs-brand-product-trait-icon-fill: #323e48;
--sdjs-brand-product-scale-fill: #b6af9c;
}Flavor and pairing tiles read --sdjs-brand-fact-box-background-color. That token follows accent mixed 15% with transparent.
Brand tokens
Core palette
| Brand token | Default | Used for |
|---|---|---|
--sdjs-brand-primary | #2b3149 | Brand fill. See the follow list above |
--sdjs-brand-accent | #2b3149 | Taste-bar fill and trait-tile mix |
--sdjs-brand-on-primary | #fff | Text and icons on primary |
--sdjs-brand-surface | #fff | Pane, cards, inactive tabs, Search button |
--sdjs-brand-surface-text | #17132c | Body text, inactive tab label, Search button label. Also --sdjs-color-text |
--sdjs-brand-primary-light-10 is primary mixed 85% with white, and the launcher hover follows it. --sdjs-brand-primary-alpha-15 is primary mixed 15% with transparent, and the tab hover follows it. --sdjs-brand-accent-alpha-15 is accent mixed 15% with transparent, and the trait tiles follow it. Set the mix token to change that formula, or set the surface token (--sdjs-brand-btn-hover-bg, --sdjs-brand-tab-hover-bg, --sdjs-brand-fact-box-background-color) to replace the result.
Header, body, CTA, footer
Font tokens default to --sdjs-font.
| Brand token | Default | Used for |
|---|---|---|
--sdjs-brand-nav-background-color | primary | Search pane header |
--sdjs-brand-nav-button-color | transparent | Search header icon buttons |
--sdjs-brand-nav-button-content-color | #fff | Search header icon color |
--sdjs-brand-nav-header-font | --sdjs-font | Search header title font |
--sdjs-brand-nav-header-font-size | 18px | Search header title size |
--sdjs-brand-nav-header-font-color | #fff | Search header title color |
--sdjs-brand-secondary-header-font | --sdjs-font | Detail header and hero title font |
--sdjs-brand-secondary-header-font-size | 16px | Detail header title size. Hero titles use --sdjs-hero-title-size |
--sdjs-brand-secondary-header-font-color | surface text | Detail header and hero title color |
--sdjs-brand-secondary-sub-header-font | --sdjs-font | Hero meta font |
--sdjs-brand-secondary-sub-header-font-size | 14px | Hero meta size |
--sdjs-brand-secondary-sub-header-font-color | #979c9e | Hero meta color |
--sdjs-brand-body-header-font | --sdjs-font | Section and card titles |
--sdjs-brand-body-header-font-size | 18px | Section and card title size |
--sdjs-brand-body-header-font-color | surface text | Section and card title color. Also the product-link border and spinner |
--sdjs-brand-body-font | --sdjs-font | Body copy and the search field |
--sdjs-brand-body-font-size | 16px | Body and search-field size |
--sdjs-brand-body-font-color | surface text | Body and search-field color |
--sdjs-brand-body-sub-font | --sdjs-font | Secondary copy and footer type |
--sdjs-brand-body-sub-font-size | 14px | Secondary copy size |
--sdjs-brand-body-sub-font-color | #979c9e | Secondary copy, search placeholder, search icon |
--sdjs-brand-cta-active-background-color | primary | Launcher fill, through --sdjs-brand-btn-bg |
--sdjs-brand-cta-header-font | --sdjs-font | Launcher, Search button, and product link font |
--sdjs-brand-cta-header-font-size | 14px | Launcher and product link size |
--sdjs-brand-cta-header-font-color | on-primary | Launcher text, through --sdjs-brand-btn-color |
--sdjs-brand-fact-box-background-color | accent at 15% | Flavor and pairing tiles |
--sdjs-brand-fact-box-key-color | surface text | Fast Facts labels |
--sdjs-brand-footer-background-color | primary | Pane footer |
--sdjs-brand-footer-content-color | #fff | Pane footer text |
Tabs, buttons, product details
Search results and product tabs both use .tabs--segmented. Tab label size is 14.4px in the stylesheet.
| Brand token | Default | Used for |
|---|---|---|
--sdjs-brand-tab-bg | surface | Inactive segmented tab |
--sdjs-brand-tab-color | surface text | Inactive segmented tab label |
--sdjs-brand-tab-hover-bg | primary at 15% | Segmented tab hover |
--sdjs-brand-tab-hover-color | surface text | Segmented tab hover label |
--sdjs-brand-tab-active-bg | primary | Active segmented tab |
--sdjs-brand-tab-active-color | on-primary | Active segmented tab label |
--sdjs-brand-btn-bg | primary | Launcher fill |
--sdjs-brand-btn-color | on-primary | Launcher text |
--sdjs-brand-btn-hover-bg | primary at 85% white | Launcher hover fill |
--sdjs-brand-btn-hover-color | on-primary | Launcher hover text |
--sdjs-brand-product-trait-icon-fill | primary | Flavor and pairing icons |
--sdjs-brand-product-scale-fill | accent | How It Tastes bar fill |
--sdjs-brand-product-scale-bg | #fff | How It Tastes bar track |
--sdjs-brand-product-card-content-bg | #e2e3e4 at 20% | Recipe card fill. Product grid cards follow this unless --sdjs-brand-product-card-pane-grid-content-bg is set |
--sdjs-brand-product-card-pane-hero-content-bg | transparent | Product hero fill |
--sdjs-brand-product-avail-instock-bg | transparent | In-stock badge fill |
--sdjs-brand-product-avail-instock-color | #1a9663 | In-stock badge text |
--sdjs-brand-product-avail-instock-border | #1a9663 | In-stock badge border |
--sdjs-brand-product-avail-outofstock-bg | transparent | Out-of-stock badge fill |
--sdjs-brand-product-avail-outofstock-color | #945d5d | Out-of-stock badge text |
--sdjs-brand-product-avail-outofstock-border | #945d5d | Out-of-stock badge border |
Layout tokens
--sdjs-* tokens control pane chrome. Color aliases follow the brand palette (--sdjs-color-text follows --sdjs-brand-surface-text, --sdjs-color-surface follows --sdjs-brand-surface).
| Variable | Default | Used for |
|---|---|---|
--sdjs-font | ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif | Pane type, and any brand font token still pointing here |
--sdjs-pane-width | min(40vw, 520px) | Desktop pane width |
--sdjs-pane-min-width | 320px | Desktop pane minimum |
--sdjs-space | 16px | Pane padding |
--sdjs-gap | 10px | Gaps inside the pane, cards, and product details |
--sdjs-title-size | 18px | .sdjs__section-title |
--sdjs-hero-title-size | 22px | Hero title size |
--sdjs-color-text | surface text | Card names, section titles, and inherited pane text |
--sdjs-color-muted | #979c9e | Card meta and mixed borders |
--sdjs-color-surface | surface | Pane shell, search field, cards |
--sdjs-color-canvas | #fff | Search pane body |
--sdjs-color-muted-surface | #f3f5fa | Product and recipe pane body |
--sdjs-color-line | #e2e3e4 | Empty image fallback |
--sdjs-color-error | #9d1c1c | Error status |
--sdjs-overlay | text at 45% | Backdrop |
--sdjs-shadow | 0 0 32px text at 18% | Pane shadow |
--sdjs-border | muted at 35% | Header divider |
--sdjs-border-strong | muted at 45% | Empty-state card border |
--sdjs-z | 100000 | Overlay stacking. The launcher sits one below this |
--sdjs-launcher-inset | 20px | Offset for positioned CTAs from the edge |
:root {
--sdjs-pane-width: min(36vw, 480px);
--sdjs-font: "Source Sans 3", system-ui, sans-serif;
--sdjs-z: 200000;
}Below 576px (container query on .sdjs__overlay) the pane is 95vw and ignores --sdjs-pane-min-width.
What the classes cover
Plugin chrome uses the sdjs__ prefix. Cards, tabs, and product details use the class names below, scoped under .sdjs__ so they stay inside the plugin.
| Class | Role |
|---|---|
.sdjs__launcher | Injected CTA (uses --sdjs-brand-btn-* and --sdjs-brand-cta-header-*). Position modifiers: --window / --element plus --bottom-left, --bottom-right, --center-left, --center-right |
.sdjs__overlay / .sdjs__backdrop | Full-screen overlay and click-to-close layer |
.sdjs__pane / .sdjs__pane--right / .sdjs__pane--left | Side pane. Placement follows the placement option (right or left) |
.sdjs__pane-header--search | Search header. Uses the --sdjs-brand-nav-* tokens |
.sdjs__pane-header--detail | Product and recipe header over the hero. Title uses the secondary-header font tokens |
.sdjs__icon-btn / .sdjs__text-btn | Back, close, and Search actions |
.sdjs__search-label / .sdjs__search-input | Search field. The input uses the body font tokens |
.tabs--segmented | Search result tabs and product tabs (Food Pairings / Similar / Taste Facts) |
.card__product / .card__recipe | Grid and hero cards |
.card__availablity--instock / --outofstock | Availability badge |
.btn__view-product | Product landing-page link |
.product-details | Taste Facts: Fast Facts, How It Tastes, Flavor Profile, Pairs With |
The launcher lives on the host element. The pane mounts on document.body inside #sdjs__root.
Host-page examples
Restyle the launcher without touching pane tokens:
.sdjs__launcher {
border-radius: 999px;
padding: 0.9rem 1.4rem;
text-transform: uppercase;
letter-spacing: 0.04em;
}Use a tinted search body, a tinted product body, and a wider desktop pane:
:root {
--sdjs-color-canvas: #eef1f4;
--sdjs-color-muted-surface: #e4e9ee;
--sdjs-pane-width: min(44vw, 560px);
}Match availability badges to a host inventory palette:
:root {
--sdjs-brand-product-avail-instock-bg: transparent;
--sdjs-brand-product-avail-instock-color: #0d6b3d;
--sdjs-brand-product-avail-instock-border: #0d6b3d;
--sdjs-brand-product-avail-outofstock-bg: transparent;
--sdjs-brand-product-avail-outofstock-color: #8a2b2b;
--sdjs-brand-product-avail-outofstock-border: #8a2b2b;
}Updated 2 days ago
