Skip to main content
The <ribaunt-widget> uses Shadow DOM for style encapsulation, which means external stylesheets cannot accidentally bleed into the widget’s internals. You can still customize its entire appearance by setting CSS custom properties (variables) on the ribaunt-widget host element — Shadow DOM inherits these from the outside, so your overrides flow through cleanly.

Quick start

The following four variables are enough for a minimal dark theme:
ribaunt-widget {
  --ribaunt-background: #1e1e1e;
  --ribaunt-border-color: #444;
  --ribaunt-color: #f0f0f0;
  --ribaunt-spinner-color: #f0f0f0;
}

CSS variables reference

VariableDefaultDescription
--ribaunt-background#fdfdfdWidget container background
--ribaunt-border-color#dddddd8fWidget border color
--ribaunt-border-radius14pxWidget border radius
--ribaunt-color#212121Text color
--ribaunt-widget-width230pxWidget width
--ribaunt-widget-height58pxWidget height
--ribaunt-widget-padding14pxWidget inner padding
--ribaunt-gap15pxGap between checkbox and text
--ribaunt-checkbox-size25pxCheckbox width and height
--ribaunt-checkbox-background#fafafa91Checkbox background color
--ribaunt-checkbox-border1px solid #aaaaaad1Checkbox border
--ribaunt-checkbox-border-radius6pxCheckbox border radius
--ribaunt-checkbox-margin2pxCheckbox top/bottom margin
--ribaunt-spinner-color#000Active spinner segment color
--ribaunt-spinner-background-color#eeeInactive spinner track color
--ribaunt-spinner-thickness5pxSpinner ring thickness
--ribaunt-checkmarkBuilt-in green checkmarkSuccess checkmark SVG URL
--ribaunt-error-crossBuilt-in red warning iconError cross icon SVG URL
--ribaunt-logo-color#666Color of the Ribaunt logo
--ribaunt-fontsystem sans-serifFont stack

Dark mode

Ribaunt does not enforce an automatic dark mode. Instead, you bind it yourself — either via a media query that responds to the OS preference, or via a CSS class that your application controls.

Using a media query

@media (prefers-color-scheme: dark) {
  ribaunt-widget {
    --ribaunt-background: #2d2d2d;
    --ribaunt-border-color: #555;
    --ribaunt-color: #ffffff;
    --ribaunt-checkbox-background: #444;
    --ribaunt-spinner-color: #ffffff;
    --ribaunt-spinner-background-color: #333;
    --ribaunt-logo-color: #cccccc;
  }
}

Using a CSS class

If your app has its own dark-mode toggle that adds a class to a parent element (such as <html class="dark">), you can scope the overrides to that class:
.dark ribaunt-widget {
  --ribaunt-background: #111;
  --ribaunt-color: #eee;
}

Custom dimensions

You can resize the widget to fit your form layout by overriding the dimension variables. The example below creates a .large variant:
ribaunt-widget.large {
  --ribaunt-widget-width: 300px;
  --ribaunt-widget-height: 72px;
  --ribaunt-checkbox-size: 32px;
}
Standard CSS properties like margin, box-shadow, and display work directly on the ribaunt-widget host element since it’s an inline-block custom element. You do not need a wrapper <div> just to apply spacing or shadows.