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;
}
TokenAlso restyles
--sdjs-brand-primarySearch header fill, footer fill, launcher fill, active tab fill, detail back button, trait icons, launcher hover, tab hover
--sdjs-brand-accentHow It Tastes bar fill, flavor and pairing tile fill
--sdjs-brand-on-primaryLauncher 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 tokenDefaultUsed for
--sdjs-brand-primary#2b3149Brand fill. See the follow list above
--sdjs-brand-accent#2b3149Taste-bar fill and trait-tile mix
--sdjs-brand-on-primary#fffText and icons on primary
--sdjs-brand-surface#fffPane, cards, inactive tabs, Search button
--sdjs-brand-surface-text#17132cBody 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 tokenDefaultUsed for
--sdjs-brand-nav-background-colorprimarySearch pane header
--sdjs-brand-nav-button-colortransparentSearch header icon buttons
--sdjs-brand-nav-button-content-color#fffSearch header icon color
--sdjs-brand-nav-header-font--sdjs-fontSearch header title font
--sdjs-brand-nav-header-font-size18pxSearch header title size
--sdjs-brand-nav-header-font-color#fffSearch header title color
--sdjs-brand-secondary-header-font--sdjs-fontDetail header and hero title font
--sdjs-brand-secondary-header-font-size16pxDetail header title size. Hero titles use --sdjs-hero-title-size
--sdjs-brand-secondary-header-font-colorsurface textDetail header and hero title color
--sdjs-brand-secondary-sub-header-font--sdjs-fontHero meta font
--sdjs-brand-secondary-sub-header-font-size14pxHero meta size
--sdjs-brand-secondary-sub-header-font-color#979c9eHero meta color
--sdjs-brand-body-header-font--sdjs-fontSection and card titles
--sdjs-brand-body-header-font-size18pxSection and card title size
--sdjs-brand-body-header-font-colorsurface textSection and card title color. Also the product-link border and spinner
--sdjs-brand-body-font--sdjs-fontBody copy and the search field
--sdjs-brand-body-font-size16pxBody and search-field size
--sdjs-brand-body-font-colorsurface textBody and search-field color
--sdjs-brand-body-sub-font--sdjs-fontSecondary copy and footer type
--sdjs-brand-body-sub-font-size14pxSecondary copy size
--sdjs-brand-body-sub-font-color#979c9eSecondary copy, search placeholder, search icon
--sdjs-brand-cta-active-background-colorprimaryLauncher fill, through --sdjs-brand-btn-bg
--sdjs-brand-cta-header-font--sdjs-fontLauncher, Search button, and product link font
--sdjs-brand-cta-header-font-size14pxLauncher and product link size
--sdjs-brand-cta-header-font-coloron-primaryLauncher text, through --sdjs-brand-btn-color
--sdjs-brand-fact-box-background-coloraccent at 15%Flavor and pairing tiles
--sdjs-brand-fact-box-key-colorsurface textFast Facts labels
--sdjs-brand-footer-background-colorprimaryPane footer
--sdjs-brand-footer-content-color#fffPane 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 tokenDefaultUsed for
--sdjs-brand-tab-bgsurfaceInactive segmented tab
--sdjs-brand-tab-colorsurface textInactive segmented tab label
--sdjs-brand-tab-hover-bgprimary at 15%Segmented tab hover
--sdjs-brand-tab-hover-colorsurface textSegmented tab hover label
--sdjs-brand-tab-active-bgprimaryActive segmented tab
--sdjs-brand-tab-active-coloron-primaryActive segmented tab label
--sdjs-brand-btn-bgprimaryLauncher fill
--sdjs-brand-btn-coloron-primaryLauncher text
--sdjs-brand-btn-hover-bgprimary at 85% whiteLauncher hover fill
--sdjs-brand-btn-hover-coloron-primaryLauncher hover text
--sdjs-brand-product-trait-icon-fillprimaryFlavor and pairing icons
--sdjs-brand-product-scale-fillaccentHow It Tastes bar fill
--sdjs-brand-product-scale-bg#fffHow 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-bgtransparentProduct hero fill
--sdjs-brand-product-avail-instock-bgtransparentIn-stock badge fill
--sdjs-brand-product-avail-instock-color#1a9663In-stock badge text
--sdjs-brand-product-avail-instock-border#1a9663In-stock badge border
--sdjs-brand-product-avail-outofstock-bgtransparentOut-of-stock badge fill
--sdjs-brand-product-avail-outofstock-color#945d5dOut-of-stock badge text
--sdjs-brand-product-avail-outofstock-border#945d5dOut-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).

VariableDefaultUsed for
--sdjs-fontui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serifPane type, and any brand font token still pointing here
--sdjs-pane-widthmin(40vw, 520px)Desktop pane width
--sdjs-pane-min-width320pxDesktop pane minimum
--sdjs-space16pxPane padding
--sdjs-gap10pxGaps inside the pane, cards, and product details
--sdjs-title-size18px.sdjs__section-title
--sdjs-hero-title-size22pxHero title size
--sdjs-color-textsurface textCard names, section titles, and inherited pane text
--sdjs-color-muted#979c9eCard meta and mixed borders
--sdjs-color-surfacesurfacePane shell, search field, cards
--sdjs-color-canvas#fffSearch pane body
--sdjs-color-muted-surface#f3f5faProduct and recipe pane body
--sdjs-color-line#e2e3e4Empty image fallback
--sdjs-color-error#9d1c1cError status
--sdjs-overlaytext at 45%Backdrop
--sdjs-shadow0 0 32px text at 18%Pane shadow
--sdjs-bordermuted at 35%Header divider
--sdjs-border-strongmuted at 45%Empty-state card border
--sdjs-z100000Overlay stacking. The launcher sits one below this
--sdjs-launcher-inset20pxOffset 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.

ClassRole
.sdjs__launcherInjected 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__backdropFull-screen overlay and click-to-close layer
.sdjs__pane / .sdjs__pane--right / .sdjs__pane--leftSide pane. Placement follows the placement option (right or left)
.sdjs__pane-header--searchSearch header. Uses the --sdjs-brand-nav-* tokens
.sdjs__pane-header--detailProduct and recipe header over the hero. Title uses the secondary-header font tokens
.sdjs__icon-btn / .sdjs__text-btnBack, close, and Search actions
.sdjs__search-label / .sdjs__search-inputSearch field. The input uses the body font tokens
.tabs--segmentedSearch result tabs and product tabs (Food Pairings / Similar / Taste Facts)
.card__product / .card__recipeGrid and hero cards
.card__availablity--instock / --outofstockAvailability badge
.btn__view-productProduct landing-page link
.product-detailsTaste 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;
}

Did this page help you?