Skip to content

Theming

Screens take three Theme settings:

Setting Values Notes
colorMode light, dark, system system follows the viewer’s OS setting.
primaryColor Any CSS color, e.g. #1f3d2b Applied only when secondaryColor is also set.
secondaryColor Any CSS color Applied only when primaryColor is also set.

Settings layer like this. Each level overrides the one before it:

  1. Your default. Set it once in the dashboard. It applies to every Session.

  2. Per Session. Pass theme when you create the Session:

    {
    "screens": ["employer-dashboard"],
    "employer": { "externalId": "acct_8812" },
    "theme": { "primaryColor": "#1f3d2b", "secondaryColor": "#f4f1ea" }
    }
  3. Per embed, color mode only. Use the color-mode attribute (colorMode in React) to follow your app’s dark mode as it changes:

    <FriendlyPayroll
    clientSecret={secret}
    screen="employer-dashboard"
    colorMode={theme}
    />

Changing color-mode reloads the Screen.