Internals

How OmniScript styling actually works

Once you understand the four moving parts (runtime, theme, load order, and token cascade), almost every styling surprise becomes predictable.

Two runtimes, one set of class names (mostly)

OmniStudio currently ships in two forms, and the DOM tells you which one you have:

Managed packageStandard runtime (platform-native)
FlexCard tagsc-flex-cardruntime_omnistudio-flexcard
OmniScript tagsc-omniscript-omniscript, c-omniscript-stepruntime_omnistudio-omniscript, runtime_omnistudio_omniscript-omniscript-step
Shared classesomniscript-article, omniscript-step__body, cf-vlocity-state, slds-card, vlocity-input, slds-progress__marker
Button classesOn the button element itselfOn a wrapper element, with the real button.vlocity-btn inside (style both)

Salesforce is moving orgs to the standard runtime, where designers and components are built into the platform rather than installed as a package. The familiar class names mostly survive, but screens get reorganized between releases, so verify field locations in your org rather than trusting screenshots in old blog posts.

Two themes, two stylesheet fields

Every LWC OmniScript runs in either the Lightning (SLDS) theme or the Newport theme. The generated component tag embeds the theme name, and a via-slds class on generated cards confirms SLDS. The theme decides which Setup field your stylesheet goes in:

  • Lightning theme: Custom Lightning Stylesheet File Name
  • Newport theme: Custom Newport Stylesheet File Name

Both fields expect a static resource name only. No .css extension, no link tag, no quotes, no path. The resource must be one plain CSS file. Newport is its own CSS framework (originally from Vlocity) and is mostly used for OmniOut and off-platform deployments; inside Experience Cloud, Lightning is the common choice.

CSS load order and who wins

On a portal page, styles arrive in roughly this order, and later or more specific wins:

  1. SLDS base styles and the site's branding set (the colors you picked in Experience Builder's Theme panel).
  2. Site-level custom CSS: the Theme CSS editor or Head Markup.
  3. Component bundle CSS, including the OmniScript stylesheet static resource, which loads with the component wherever it renders.
  4. Inline styles written by the FlexCard and OmniScript designers onto individual elements: icon fills, label colors, per-element backgrounds.

Inline styles beat every stylesheet except declarations marked !important. If a color will not change no matter what you write, inspect the element: if the value sits in a style attribute, change it in the designer or override it narrowly with !important. This is CSS precedence, not a platform bug.

The design token cascade

The Lightning Design System Design Tokens field in OmniScript Setup takes raw declarations, one per line, like --lwc-spacingMedium: 16px;. Three prefix families coexist in the one field, and each runtime reads only its own:

PrefixRead byExample
--lwc-Aura Experience Cloud sites and Lightning pages (SLDS 1 design tokens, camelCased)--lwc-colorBrand: #235789;
--dxp-g-LWR Experience Cloud sites (branding hooks)--dxp-g-brand: #235789;
--slds-g-SLDS 2 themes, where global styling hooks replace design tokens--slds-g-color-accent-1: #235789;

Token name conversion for the --lwc- family: take the SLDS token, remove dashes, camelCase it, replace the dollar sign with --lwc-. So $spacing-xx-small becomes --lwc-spacingXxSmall. You can see this cascade live on real portals: active navigation links carry var(--lwc-colorTextActionLabelActive, var(--dxp-g-brand-1)), exactly this fallback chain.

There is a fourth, finer level: component styling hooks like --slds-c-icon-color-background, scoped to a single component type. Useful for surgical changes once the global hooks are in place.

Safari does not support these design tokens, per Salesforce's documentation. Always pair tokens with the OmniScript stylesheet so Safari users still get your brand.

Shadow DOM: why LWR is different

Aura sites use synthetic shadow DOM, so CSS from Head Markup or the Theme editor can reach inside components. LWR sites use native shadow DOM: site-level CSS stops at the component boundary and never reaches OmniScript internals. On LWR, style the script through the things that travel with it (the OmniScript stylesheet and design tokens) and keep site CSS for the page shell.

Two more boundaries no CSS crosses: embedded dashboards render in an iframe (a separate document), and the Builder canvas adds its own chrome around your preview.

Selector stability: what to trust

Trust levelSelectorsWhy
Stable slds-*, omniscript-*, omni-*, vlocity-*, cf-*, comm-*, dxp-*, siteforce*, forceCommunity* Public design system and runtime contracts; survived the managed package to standard runtime move
Useful handles [data-omni-key="FieldName"], [data-style-id], [data-test-id] Set from your own element names in the designers, so they change only when you rename things
Never use lwc-* attributes, data-aura-rendered-by, generated ids like input4-45, forcegenerated-* tag names Generated per build, per render, or per card version; they will break silently