Skip to content

Theming with CSS

For developers and agencies. This page lists the CSS custom properties the widget reads and the part names you can style. To restyle the widget in one go, start from the example.

LayerWho it suitsWhat it changes
Search → LookStore ownersLogo, four colours, font and the controls
CSS variablesDevelopersEvery tone, the corner radius, the space between cards. See Base colours
Parts and Custom CSSAgenciesAny rule on a named element: borders, layout, sizes, hover states
TemplatesAgenciesYour own HTML for the product card

Styles set by clicking an element on Search → Look use the same parts and come before Custom CSS, so a rule of yours that is as specific wins.

Class names inside the widget are internal and change without notice, except the product card’s, listed under Card classes. Part names are the stable contract: a part keeps its name across releases.

Set the variables in your site’s stylesheet, on the widget’s host element:

ElementWhat it themes
#typemo-hostThe search widget, catalog or docs
#typemo-assistant-hostThe AI Assistant’s chat. It reads the same variables
#typemo-host,
#typemo-assistant-host {
--typemo-brand: #d84315;
}
CaseBehaviour
A colour or font set on Search → LookIt is written on the host element itself, so it wins over your stylesheet. Reset it in the dashboard, or mark your value !important
Selectors aimed inside the widgetThey have no effect: the widget renders in a Shadow DOM. Use parts instead
Setting them in Custom CSSWrite :host instead of #typemo-host: the field’s CSS runs inside the widget, where #typemo-host doesn’t exist
Setting them from JavaScriptThe cssVariables option does it, and then the dashboard’s colours are not applied. See Embed options

The derived tones are mixed from these three, so the accent alone re-tints the whole widget.

VariableWhat it coloursDefaultOn Search → Look
--typemo-brandButtons, focus rings, selected filters#2d5bffAccent
--typemo-text-primaryText; lighter text and borders are mixed from it#0b1020Text
--typemo-modal-bgThe widget’s surface#ffffffBackground
--typemo-saleDiscount badges and sale pricesThe text colour (the badge: neutral grey)Sale

--primary-color is an older name for the accent. It wins over --typemo-brand.

Each tone follows your accent or your text colour. Set one only to override it.

VariableWhat it coloursFollows
--typemo-brand-tintHover backgroundsThe accent
--typemo-brand-deepPressed and active statesThe accent
--typemo-brand-glowFocus ringsThe accent
--typemo-on-brandText and marks on accent fillsThe accent
--typemo-text-secondarySecondary textThe text
--typemo-text-mutedFilter labels, meta linesThe text
--typemo-text-faintPlaceholders, the faintest textThe text
--typemo-border-colorHairlinesThe text
--typemo-border-2Stronger linesThe text
--typemo-border-strongThe strongest linesThe text
--typemo-bg-2Light fillsThe text
--typemo-bg-3Darker fillsThe text

The success and error colours are fixed: they carry meaning, so they never follow your accent.

VariableWhat it setsDefaultOn Search → Look
--typemo-field-bgThe fill of the search box#ededf2Search field
--typemo-overlay-bgThe dim layer behind the widgetrgb(11 16 32 / 42%)
--typemo-fontA font-family list, or inherit for your page’s font. Nothing is downloadedThe system UI fontFont
--typemo-card-radiusCorner radius. Smaller and larger radii are derived from it; 0px squares every corner8px
--typemo-card-gapSpace between product cards in the catalog widget, and around them. At 0px the cards form one sheet split by hairlines0px; 8px with Tiles

The docs widget has a dark theme of its own: it follows the reader’s system setting and a toggle in its footer. Its dark surface is #20201f and its dark text #e8e6e1. A value you set for --typemo-modal-bg or --typemo-text-primary applies in both themes, so leave them unset to keep the dark theme.

To turn it with your site’s own theme switch, send the typemo:docs:theme event when the reader switches. The docs widget and the AI Assistant follow it, and the widget keeps the pick for the next visit:

window.dispatchEvent(new CustomEvent('typemo:docs:theme', { detail: { theme: 'dark' } }));

theme is light, dark or system. system hands the choice back to the reader’s system setting.

The catalog widget has one palette. Swap the text and the surface under the selector your theme switcher already uses:

[data-theme='dark'] #typemo-host {
--typemo-modal-bg: #0a0a0a;
--typemo-text-primary: #fafafa;
--typemo-overlay-bg: rgb(0 0 0 / 70%);
}

A part is a named element of the widget, such as a product card or the search box. Style it in one of three places:

WhereSelectorWhat it can do
Custom CSS under Search → Blocks → For developers[part~='product-card'], [part~='product-card'] imgAny selector, inside the widget. The preview shows it as you type
The customCss embed optionThe same as Custom CSSThe same, from your theme code. It comes after the text from Search → Look, so it wins a tie
Your site’s stylesheet#typemo-host::part(product-card)Style the part itself and its pseudo-classes, such as :hover. Elements inside the part can’t be reached

This CSS gives the catalog widget a store’s own look: its green, a serif font, framed square cards and names in capitals. Paste it under Search → Blocks → For developers → Custom CSS and watch the preview.

The catalog widget with its default look, searching lamp
The default look
/* The store's colours and font. In Custom CSS the widget's root is :host */
:host {
--typemo-brand: #1f4d3a;
--typemo-field-bg: #f4f1ea;
--typemo-font: Georgia, "Times New Roman", serif;
--typemo-card-radius: 0px;
--typemo-card-gap: 16px;
}
/* Cards: a hairline frame, names in capitals, a bold price */
[part~='product-card'] {
border: 1px solid #e7e2d9;
}
[part~='product-title'] {
font-size: 12px;
letter-spacing: 0.06em;
text-transform: uppercase;
}
[part~='product-price'] {
font-size: 16px;
font-weight: 700;
}
/* The cart button in the store's green */
[part~='add-to-cart-button'] {
background: var(--typemo-brand);
color: #fff;
}
/* Filter headings in small capitals */
[part~='facet-title'] {
font-size: 11px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
CaseBehaviour
#typemo-host in Custom CSSIt matches nothing: the field’s CSS runs inside the widget. Write :host
A colour or font set on Search → LookIt wins over the same variable under :host. Reset it on Search → Look, or mark your value !important
A rule doesn’t applyThe widget’s own rule is more specific. Add a selector, such as [part~='modal'] [part~='product-card'], or !important
Custom CSS lengthUp to 20,000 characters
What the CSS loadsIt is applied as written: an @import or url() loads from wherever it points
A web fontWrite its @font-face rules in Custom CSS: the widget declares them on your page, since browsers ignore them inside the widget
The AI Assistant’s chatCustom CSS applies there too. From your stylesheet, use #typemo-assistant-host::part(chat-sheet)
Emptying the fieldThe widget returns to its default look
PartElement
modal-overlayThe dim layer behind the search
modalThe search window, over the page or under your search field
modal-shellThe panel inside the window
modal-headerThe bar with the logo, the search box and the close button
search-boxThe search box’s frame: its fill, border and corners
search-inputThe search box
suggestionA search under the box: yours or a popular one
tabsThe row of collection tabs
tab, tab-activeA tab; the selected tab carries both
modal-contentEverything under the bar
starter-screenWhat the widget shows before a search
powered-byThe “Powered by Typemo” footer
/* A darker dim layer, a heavier line under the selected tab */
[part~='modal-overlay'] {
background: rgb(0 0 0 / 60%);
}
[part~='tab-active'] {
border-bottom-width: 3px;
font-weight: 700;
}
PartElement
facet-sidebarThe filters column
facetOne filter
facet-titleA filter’s heading
facet-valueA filter value: a checkbox row, a chip or a colour swatch
facet-rowA Category tiles block
facet-row-valueA value in that row: a picture tile or a chip; with facet-row-value-active while it is picked
/* A tinted filters column */
[part~='facet-sidebar'] {
background: #faf8f4;
}
PartElement
results-gridThe grid of results
bannerA banner among the results
product-cardA result: a tile in the grid and in the start screen’s row
product-imageThe photo of a result
product-badgeThe discount badge
variant-badgeThe count of further variants
out-of-stock-badgeThe out-of-stock label
similar-buttonThe Similar button on the photo
product-titleThe product name
product-priceThe price
add-to-cart-buttonThe cart button
emptyThe message when a search finds nothing
/* A square black discount badge */
[part~='product-badge'] {
background: #111;
border-radius: 0;
}
PartElement
modal-overlayThe dim layer behind the search
modalThe search panel
search-inputThe search box
tabsThe row of collection tabs
tab, tab-activeA tab; the selected tab carries both
results-titleThe heading over a group of results, and over the questions for the AI
row, row-activeA result or a question for the AI; the highlighted one carries both
row-titleA result’s title
row-categoryThe line under the title: the page’s path, or the matching text
/* Group headings in capitals, the highlighted result underlined */
[part~='results-title'] {
letter-spacing: 0.06em;
text-transform: uppercase;
}
[part~='row-active'] [part~='row-title'] {
text-decoration: underline;
}
[part~='row-category'] {
font-style: italic;
}
PartElement
chat-sheetThe chat panel
ai-answerThe text of an answer

The same rule in Custom CSS, then from your site’s stylesheet:

[part~='chat-sheet'] {
border-left: 4px solid #1f4d3a;
}
#typemo-assistant-host::part(chat-sheet) {
border-left: 4px solid #1f4d3a;
}

On screens 1024 px and wider, the AI Assistant’s chat docks to the right and pushes the page aside with a right margin on <html>. A bar with position: fixed, such as a sticky site header, ignores that margin and ends up under the chat. While the chat is open, its width is in --tm-chat-push on <html>, so narrow the bar by that much:

.site-header {
max-width: calc(100% - var(--tm-chat-push, 0px));
}

Next: Match the widget to your brand for the dashboard form, or Embed options for the script attributes.