LostChurn Docs
Widgets

Widget Customization

Theme LostChurn widgets with CSS custom properties, color schemes, font inheritance, and responsive design.

All LostChurn widgets are designed to blend seamlessly into your application. They inherit your fonts by default and expose CSS custom properties for fine-grained control over colors, spacing, borders, and more.

CSS Custom Properties

Override any of the following CSS custom properties to theme LostChurn widgets. Set them on the :root selector or scope them to a container element.

Colors

PropertyDefault (Light)Default (Dark)Description
--lc-color-primary#6366f1#818cf8Primary accent color (buttons, links)
--lc-color-primary-hover#4f46e5#6366f1Primary color on hover
--lc-color-primary-text#ffffff#ffffffText color on primary backgrounds
--lc-color-background#ffffff#1e1e2eWidget background
--lc-color-surface#f8f9fa#2a2a3eElevated surface background (cards, modals)
--lc-color-text#1a1a2e#e4e4e7Primary text color
--lc-color-text-secondary#6b7280#9ca3afSecondary/muted text color
--lc-color-border#e5e7eb#374151Border color
--lc-color-error#ef4444#f87171Error state color
--lc-color-success#22c55e#4ade80Success state color
--lc-color-warning#f59e0b#fbbf24Warning state color

Typography

PropertyDefaultDescription
--lc-font-familyinheritFont family. Inherits from your page by default
--lc-font-size-sm0.875remSmall text (labels, captions)
--lc-font-size-base1remBody text
--lc-font-size-lg1.125remLarge text (headings in widgets)
--lc-font-size-xl1.25remExtra large text (modal titles)
--lc-font-weight-normal400Normal font weight
--lc-font-weight-medium500Medium font weight
--lc-font-weight-bold600Bold font weight
--lc-line-height1.5Base line height

Spacing and Layout

PropertyDefaultDescription
--lc-spacing-xs0.25remExtra small spacing
--lc-spacing-sm0.5remSmall spacing
--lc-spacing-md1remMedium spacing
--lc-spacing-lg1.5remLarge spacing
--lc-spacing-xl2remExtra large spacing
--lc-border-radius0.5remBorder radius for buttons, cards, inputs
--lc-border-radius-lg0.75remLarger radius for modals and containers
--lc-shadow0 1px 3px rgba(0,0,0,0.1)Box shadow for elevated elements
--lc-shadow-lg0 10px 25px rgba(0,0,0,0.15)Larger shadow for modals
--lc-z-index-bar9999Z-index for the Recovery Bar
--lc-z-index-modal10000Z-index for modal overlays

Examples

Match Your Brand Colors

:root {
  --lc-color-primary: #0070f3;
  --lc-color-primary-hover: #0060df;
  --lc-color-primary-text: #ffffff;
  --lc-border-radius: 0.375rem;
}

Use Your Application Font

Widgets inherit your font by default. If you need to explicitly set a different font:

:root {
  --lc-font-family: "Inter", sans-serif;
}

Rounded Style

:root {
  --lc-border-radius: 9999px;
  --lc-border-radius-lg: 1.5rem;
}

Minimal / Flat Style

:root {
  --lc-shadow: none;
  --lc-shadow-lg: none;
  --lc-border-radius: 0;
  --lc-color-border: transparent;
}

Color Schemes

Widgets support three color scheme modes via the theme prop.

ModeBehavior
"light"Always uses light mode colors
"dark"Always uses dark mode colors
"auto"Follows the user's prefers-color-scheme system setting

Using Auto Theme

When theme="auto" (the default), widgets respond to the user's operating system dark mode setting. You can also override the auto behavior by targeting the dark scheme in CSS:

@media (prefers-color-scheme: dark) {
  :root {
    --lc-color-primary: #818cf8;
    --lc-color-background: #0f0f1a;
    --lc-color-surface: #1a1a2e;
    --lc-color-text: #f4f4f5;
  }
}

Matching Your App's Theme Toggle

If your application has its own dark mode toggle (not relying on the system setting), apply a CSS class to scope the widget theme:

.dark-mode {
  --lc-color-primary: #818cf8;
  --lc-color-background: #0f0f1a;
  --lc-color-surface: #1a1a2e;
  --lc-color-text: #f4f4f5;
  --lc-color-text-secondary: #9ca3af;
  --lc-color-border: #374151;
}

Font Inheritance

By default, --lc-font-family is set to inherit, which means widgets will use whatever font is set on the parent element. This works automatically with:

  • System font stacks
  • Google Fonts loaded via <link> tags
  • Self-hosted fonts loaded via @font-face
  • CSS frameworks like Tailwind CSS (which sets the font on html or body)

If your widget is rendered inside an iframe (e.g., the hosted payment update modal), font inheritance does not apply. In that case, LostChurn uses a system font stack. To override the iframe font, contact support.

Responsive Behavior

Widgets are responsive by default and adapt to the viewport width:

ViewportRecovery BarCancel Flow ModalCancel Flow Inline
Desktop (> 768px)Full-width banner, single lineCentered modal, 480px max widthFills container width
Tablet (481-768px)Full-width banner, may wrap to two linesCentered modal, 90% viewport widthFills container width
Mobile (< 480px)Full-width banner, stacked layoutFull-screen modalFills container width

Customizing Breakpoints

If you need to adjust widget layout at specific breakpoints, target the widget's CSS class:

@media (max-width: 640px) {
  .lc-recovery-bar {
    --lc-spacing-md: 0.75rem;
    --lc-font-size-base: 0.875rem;
  }
}

Widget CSS classes are prefixed with lc- to avoid conflicts with your existing styles. All widget styles use low specificity so your overrides take precedence.

CSS Class Reference

Use these classes to target specific widget elements for additional styling:

ClassElement
.lc-recovery-barRecovery Bar container
.lc-recovery-bar__messageMessage text in the Recovery Bar
.lc-recovery-bar__ctaCTA button in the Recovery Bar
.lc-recovery-bar__dismissDismiss button in the Recovery Bar
.lc-cancel-flowCancel Flow Widget container
.lc-cancel-flow__stepIndividual step container
.lc-cancel-flow__titleStep title
.lc-cancel-flow__bodyStep body content
.lc-cancel-flow__actionsStep action buttons container
.lc-modalModal overlay
.lc-modal__contentModal content area
.lc-buttonAll LostChurn buttons
.lc-button--primaryPrimary action button
.lc-button--secondarySecondary action button

Next Steps

On this page