Skip to main content
Use custom CSS for changes beyond the dashboard’s appearance settings. The stylesheet runs on your storefront page and reaches widget internals through exported CSS parts. Read the theme token reference and the parts reference for the surface you want to change. Theme tokens · Activator parts · Chat shell parts · Message and content parts · Overlay parts

Cascade

Normal page declarations on an exported part take precedence over the widget’s own normal styles, including inline styles. Variables set on a Remark host override its token defaults. Other stylesheets on your page still compete by specificity and order. With !important, shadow-tree declarations take precedence over important page declarations.

Host layout

Remark elements start with display: inline and reset inherited properties. Set display: block before applying block margins or a maximum inline size to the element itself. The dashboard preview lays out the element as a flex item, so check placement on your storefront too.

State

Scope scene-specific rules with data-scene and light- or dark-specific rules with data-color-scheme. The widget sets these attributes to report its state. Changing them from the page does not change the widget’s state.

Dashboard preview

The dashboard preview removes positioning properties from host selectors and outer layout parts to keep the widget inside the preview frame. Verify placement on your storefront, and check each scene and color scheme affected by your CSS. Check that the CSS block is complete before saving: an unfinished rule can be accepted even when the browser does not apply all of it.

Fonts

The dashboard Font Family field sets --remark-fonts-sans; setting the variable on the host element has the same effect. The semantic tokens --remark-fonts-heading, --remark-fonts-content, --remark-fonts-interface, and --remark-fonts-display default to the sans stack and can be set independently. Heading text styles use semibold (600), so check a font’s available weights before choosing it. The dashboard preview auto-loads popular Google Fonts. Load the chosen font on the storefront as well, using its provider’s stylesheet or a document-level @font-face rule. The family name must match the widget setting or CSS variable.

Targeting Parts in Your CSS

Every selector must include a Remark custom element or [data-remark]. Use [data-remark] for shared rules, including overlay hosts. Descendant selectors after ::part() do not reach internal children; target an exported part instead. Use ::part() on a Remark element. [data-remark] styles a part wherever it appears, which suits brand-wide rules. Name a specific element, such as remark-chat-widget for the floating chat or remark-qa-activator for the embedded chat (inline activator), to style only that surface:
Live view and the review summary drawer open in a full-page layer attached to the end of the page rather than inside the element that launched them. Style their parts with [data-remark], such as [data-remark]::part(drawer), since an element name like remark-reviews doesn’t reach them. A common use case for the embedded chat is adding spacing above or below the widget to separate it from surrounding page content:
You can use nested media queries to apply different styles at different viewport sizes:
In this example, the embedded chat uses the default base font size (16 px) on smaller screens and bumps it up on larger viewports. CSS nesting works inside an element selector, as in the example above, but not inside a ::part() rule. A rule nested in a ::part() block never matches, while the outer rule still applies, so the mistake is easy to miss. Attach pseudo-classes and pseudo-elements to the part directly:
Some parts are only present in specific UI states. For example, more-options-menu and layout-menu are only rendered while those dropdowns are open, and skeleton parts are only present while the widget is loading.

Full Example

This example shows custom CSS that adjusts sizing tokens and styles individual parts. Colors and font family would typically be set through the dashboard rather than in CSS.

Best Practices

  • Use widget settings first. The dashboard handles colors, typography, spacing, and border radius with built-in dark mode support. Reach for custom CSS only when you need to style a specific element differently.
  • Reference token variables in ::part() rules. When writing custom CSS, use the --remark-colors-* tokens rather than hardcoded color values so your overrides adapt to light and dark mode.
  • Style semantic parts, not layout wrappers. Prefer parts like widget-header or product-recommendation over incidental containers.
  • Scope by scene with data-scene. Parts like widget-header, header-menu-close-button, and prompt-button match all scenes. Add a scene to the element selector (e.g., remark-chat-widget[data-scene='chat']::part(widget-header)) to style a specific context. Keep base styling in unscoped rules, because the element sets data-scene only after the widget loads.
  • Account for stateful parts. Menu, loading, and prompt parts may only render in specific states. Test your overrides in those states.
  • Check responsive layouts. Header menus, product cards, activators, and input affordances can shift across screen sizes.

Beyond CSS

For designs that go further than settings and custom CSS can reach — a fully custom activator built into your product grid, redesigned widget surfaces, or a bespoke theme — Remark supports brand-specific widget extensions built and maintained by our team. If you have a design in mind, contact your Remark representative to discuss what’s possible.