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 withdisplay: 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 withdata-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:
[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:
::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-headerorproduct-recommendationover incidental containers. - Scope by scene with
data-scene. Parts likewidget-header,header-menu-close-button, andprompt-buttonmatch 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 setsdata-sceneonly 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.