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
| Property | Default (Light) | Default (Dark) | Description |
|---|---|---|---|
--lc-color-primary | #6366f1 | #818cf8 | Primary accent color (buttons, links) |
--lc-color-primary-hover | #4f46e5 | #6366f1 | Primary color on hover |
--lc-color-primary-text | #ffffff | #ffffff | Text color on primary backgrounds |
--lc-color-background | #ffffff | #1e1e2e | Widget background |
--lc-color-surface | #f8f9fa | #2a2a3e | Elevated surface background (cards, modals) |
--lc-color-text | #1a1a2e | #e4e4e7 | Primary text color |
--lc-color-text-secondary | #6b7280 | #9ca3af | Secondary/muted text color |
--lc-color-border | #e5e7eb | #374151 | Border color |
--lc-color-error | #ef4444 | #f87171 | Error state color |
--lc-color-success | #22c55e | #4ade80 | Success state color |
--lc-color-warning | #f59e0b | #fbbf24 | Warning state color |
Typography
| Property | Default | Description |
|---|---|---|
--lc-font-family | inherit | Font family. Inherits from your page by default |
--lc-font-size-sm | 0.875rem | Small text (labels, captions) |
--lc-font-size-base | 1rem | Body text |
--lc-font-size-lg | 1.125rem | Large text (headings in widgets) |
--lc-font-size-xl | 1.25rem | Extra large text (modal titles) |
--lc-font-weight-normal | 400 | Normal font weight |
--lc-font-weight-medium | 500 | Medium font weight |
--lc-font-weight-bold | 600 | Bold font weight |
--lc-line-height | 1.5 | Base line height |
Spacing and Layout
| Property | Default | Description |
|---|---|---|
--lc-spacing-xs | 0.25rem | Extra small spacing |
--lc-spacing-sm | 0.5rem | Small spacing |
--lc-spacing-md | 1rem | Medium spacing |
--lc-spacing-lg | 1.5rem | Large spacing |
--lc-spacing-xl | 2rem | Extra large spacing |
--lc-border-radius | 0.5rem | Border radius for buttons, cards, inputs |
--lc-border-radius-lg | 0.75rem | Larger radius for modals and containers |
--lc-shadow | 0 1px 3px rgba(0,0,0,0.1) | Box shadow for elevated elements |
--lc-shadow-lg | 0 10px 25px rgba(0,0,0,0.15) | Larger shadow for modals |
--lc-z-index-bar | 9999 | Z-index for the Recovery Bar |
--lc-z-index-modal | 10000 | Z-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.
| Mode | Behavior |
|---|---|
"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
htmlorbody)
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:
| Viewport | Recovery Bar | Cancel Flow Modal | Cancel Flow Inline |
|---|---|---|---|
| Desktop (> 768px) | Full-width banner, single line | Centered modal, 480px max width | Fills container width |
| Tablet (481-768px) | Full-width banner, may wrap to two lines | Centered modal, 90% viewport width | Fills container width |
| Mobile (< 480px) | Full-width banner, stacked layout | Full-screen modal | Fills 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:
| Class | Element |
|---|---|
.lc-recovery-bar | Recovery Bar container |
.lc-recovery-bar__message | Message text in the Recovery Bar |
.lc-recovery-bar__cta | CTA button in the Recovery Bar |
.lc-recovery-bar__dismiss | Dismiss button in the Recovery Bar |
.lc-cancel-flow | Cancel Flow Widget container |
.lc-cancel-flow__step | Individual step container |
.lc-cancel-flow__title | Step title |
.lc-cancel-flow__body | Step body content |
.lc-cancel-flow__actions | Step action buttons container |
.lc-modal | Modal overlay |
.lc-modal__content | Modal content area |
.lc-button | All LostChurn buttons |
.lc-button--primary | Primary action button |
.lc-button--secondary | Secondary action button |
Next Steps
- Recovery Bar -- configuration and integration for the Recovery Bar
- Cancel Flow Widget -- embed cancellation flows in your app
- Widgets Overview -- all available widgets
Cancel Flow Widget
Embed LostChurn's cancel flow directly in your application to present retention offers and recover at-risk subscribers.
Analytics Dashboard Overview
Navigate the LostChurn analytics dashboard — understand your key metrics at a glance, filter by date range and cohort, export data, and see real-time vs. rolled-up reporting.