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.
Three layers
Section titled “Three layers”| Layer | Who it suits | What it changes |
|---|---|---|
| Search → Look | Store owners | Logo, four colours, font and the controls |
| CSS variables | Developers | Every tone, the corner radius, the space between cards. See Base colours |
| Parts and Custom CSS | Agencies | Any rule on a named element: borders, layout, sizes, hover states |
| Templates | Agencies | Your 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.
Where to set them
Section titled “Where to set them”Set the variables in your site’s stylesheet, on the widget’s host element:
| Element | What it themes |
|---|---|
#typemo-host | The search widget, catalog or docs |
#typemo-assistant-host | The AI Assistant’s chat. It reads the same variables |
#typemo-host,#typemo-assistant-host { --typemo-brand: #d84315;}| Case | Behaviour |
|---|---|
| A colour or font set on Search → Look | It 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 widget | They have no effect: the widget renders in a Shadow DOM. Use parts instead |
| Setting them in Custom CSS | Write :host instead of #typemo-host: the field’s CSS runs inside the widget, where #typemo-host doesn’t exist |
| Setting them from JavaScript | The cssVariables option does it, and then the dashboard’s colours are not applied. See Embed options |
Base colours
Section titled “Base colours”The derived tones are mixed from these three, so the accent alone re-tints the whole widget.
| Variable | What it colours | Default | On Search → Look |
|---|---|---|---|
--typemo-brand | Buttons, focus rings, selected filters | #2d5bff | Accent |
--typemo-text-primary | Text; lighter text and borders are mixed from it | #0b1020 | Text |
--typemo-modal-bg | The widget’s surface | #ffffff | Background |
--typemo-sale | Discount badges and sale prices | The text colour (the badge: neutral grey) | Sale |
--primary-color is an older name for the accent. It wins over --typemo-brand.
Derived tones
Section titled “Derived tones”Each tone follows your accent or your text colour. Set one only to override it.
| Variable | What it colours | Follows |
|---|---|---|
--typemo-brand-tint | Hover backgrounds | The accent |
--typemo-brand-deep | Pressed and active states | The accent |
--typemo-brand-glow | Focus rings | The accent |
--typemo-on-brand | Text and marks on accent fills | The accent |
--typemo-text-secondary | Secondary text | The text |
--typemo-text-muted | Filter labels, meta lines | The text |
--typemo-text-faint | Placeholders, the faintest text | The text |
--typemo-border-color | Hairlines | The text |
--typemo-border-2 | Stronger lines | The text |
--typemo-border-strong | The strongest lines | The text |
--typemo-bg-2 | Light fills | The text |
--typemo-bg-3 | Darker fills | The text |
The success and error colours are fixed: they carry meaning, so they never follow your accent.
Surface, type and shape
Section titled “Surface, type and shape”| Variable | What it sets | Default | On Search → Look |
|---|---|---|---|
--typemo-field-bg | The fill of the search box | #ededf2 | Search field |
--typemo-overlay-bg | The dim layer behind the widget | rgb(11 16 32 / 42%) | |
--typemo-font | A font-family list, or inherit for your page’s font. Nothing is downloaded | The system UI font | Font |
--typemo-card-radius | Corner radius. Smaller and larger radii are derived from it; 0px squares every corner | 8px | |
--typemo-card-gap | Space between product cards in the catalog widget, and around them. At 0px the cards form one sheet split by hairlines | 0px; 8px with Tiles |
Dark mode
Section titled “Dark mode”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:
| Where | Selector | What it can do |
|---|---|---|
| Custom CSS under Search → Blocks → For developers | [part~='product-card'], [part~='product-card'] img | Any selector, inside the widget. The preview shows it as you type |
The customCss embed option | The same as Custom CSS | The 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 |
An example
Section titled “An example”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 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;}| Case | Behaviour |
|---|---|
#typemo-host in Custom CSS | It matches nothing: the field’s CSS runs inside the widget. Write :host |
| A colour or font set on Search → Look | It wins over the same variable under :host. Reset it on Search → Look, or mark your value !important |
| A rule doesn’t apply | The widget’s own rule is more specific. Add a selector, such as [part~='modal'] [part~='product-card'], or !important |
| Custom CSS length | Up to 20,000 characters |
| What the CSS loads | It is applied as written: an @import or url() loads from wherever it points |
| A web font | Write 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 chat | Custom CSS applies there too. From your stylesheet, use #typemo-assistant-host::part(chat-sheet) |
| Emptying the field | The widget returns to its default look |
Catalog widget
Section titled “Catalog widget”Overlay, search and tabs
Section titled “Overlay, search and tabs”| Part | Element |
|---|---|
modal-overlay | The dim layer behind the search |
modal | The search window, over the page or under your search field |
modal-shell | The panel inside the window |
modal-header | The bar with the logo, the search box and the close button |
search-box | The search box’s frame: its fill, border and corners |
search-input | The search box |
suggestion | A search under the box: yours or a popular one |
tabs | The row of collection tabs |
tab, tab-active | A tab; the selected tab carries both |
modal-content | Everything under the bar |
starter-screen | What the widget shows before a search |
powered-by | The “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;}Filters
Section titled “Filters”| Part | Element |
|---|---|
facet-sidebar | The filters column |
facet | One filter |
facet-title | A filter’s heading |
facet-value | A filter value: a checkbox row, a chip or a colour swatch |
facet-row | A Category tiles block |
facet-row-value | A 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;}Results
Section titled “Results”| Part | Element |
|---|---|
results-grid | The grid of results |
banner | A banner among the results |
product-card | A result: a tile in the grid and in the start screen’s row |
product-image | The photo of a result |
product-badge | The discount badge |
variant-badge | The count of further variants |
out-of-stock-badge | The out-of-stock label |
similar-button | The Similar button on the photo |
product-title | The product name |
product-price | The price |
add-to-cart-button | The cart button |
empty | The message when a search finds nothing |
/* A square black discount badge */[part~='product-badge'] { background: #111; border-radius: 0;}Docs widget
Section titled “Docs widget”| Part | Element |
|---|---|
modal-overlay | The dim layer behind the search |
modal | The search panel |
search-input | The search box |
tabs | The row of collection tabs |
tab, tab-active | A tab; the selected tab carries both |
results-title | The heading over a group of results, and over the questions for the AI |
row, row-active | A result or a question for the AI; the highlighted one carries both |
row-title | A result’s title |
row-category | The 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;}AI Assistant’s chat
Section titled “AI Assistant’s chat”| Part | Element |
|---|---|
chat-sheet | The chat panel |
ai-answer | The 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;}Fixed bars and the chat
Section titled “Fixed bars and the chat”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.