Mavna

Theming

Light, dark or the reader's system setting, and every colour, font and radius as a CSS custom property.

The widget is styled entirely by CSS custom properties declared on its root element, .mv-root. You change how it looks by setting those properties, through the config or through your own CSS.

Light, dark and system

appearance takes "system", "light" or "dark". The default, "system", follows the reader's operating system setting. "light" and "dark" override that setting in both directions. The widget writes an explicit choice to a data-mv-theme attribute on its root.

Through the config

theme sets properties as inline styles on the root, which take precedence over any stylesheet:

<MavnaWidget
  config={{
    integrator: "your-product",
    theme: {
      tokens: { "--mv-surface": "#101014", "--mv-ink": "#f4f4f5" },
      font: "inherit",
      radius: "12px",
    },
  }}
/>

tokens takes any of the properties listed below. font, fontMono, radius and radiusLg set --mv-font, --mv-font-mono, --mv-radius and --mv-radius-lg.

Through CSS

The widget declares its properties on .mv-root, so a .mv-root rule in your stylesheet ties with it on specificity and the order your bundler emits the stylesheets decides which wins. Doubling the class wins outright:

.mv-root.mv-root {
  --mv-surface: #101014;
  --mv-ink: #f4f4f5;
}

Setting the properties on an ancestor element has no effect, because the widget declares them on its own root.

To change the dark theme as well, set your properties in a rule for .mv-root[data-mv-theme="dark"] too.

The signal colour

--mv-signal and the properties derived from it are the widget's only colour. The widget uses it for problems: error notes, an address that is not valid, the warning before sending the same transfer again, and the button that finishes a delayed delivery.

Every property

Read from the widget's stylesheet, packages/widget/src/widget.css, when this site is built. The values are shown as declared; you can set any value CSS accepts.

TokenLightDark
--mv-groundoklch(0.985 0 0)oklch(0.145 0 0)
--mv-surfaceoklch(1 0 0)oklch(0.205 0 0)
--mv-surface-2oklch(0.97 0 0)oklch(0.245 0 0)
--mv-surface-3oklch(0.94 0 0)oklch(0.275 0 0)
--mv-surface-4oklch(0.9 0 0)oklch(0.32 0 0)
--mv-inkoklch(0.205 0 0)oklch(0.985 0 0)
--mv-whiteoklch(0.205 0 0)oklch(0.985 0 0)
--mv-lineoklch(0.205 0 0)oklch(0.985 0 0)
--mv-on-lightoklch(0.985 0 0)oklch(0.145 0 0)
--mv-ink-strongoklch(0.28 0 0)oklch(0.9 0 0)
--mv-cta-hoveroklch(0.32 0 0)oklch(0.88 0 0)
--mv-ink-2oklch(0.36 0 0)oklch(0.8 0 0)
--mv-ink-3oklch(0.42 0 0)oklch(0.75 0 0)
--mv-knoboklch(0.3 0 0)oklch(0.8 0 0)
--mv-mutedoklch(0.46 0 0)oklch(0.72 0 0)
--mv-muted-boklch(0.48 0 0)oklch(0.7 0 0)
--mv-muted-2oklch(0.49 0 0)oklch(0.685 0 0)
--mv-faintoklch(0.5 0 0)oklch(0.67 0 0)
--mv-faint-2oklch(0.51 0 0)oklch(0.66 0 0)
--mv-faintestoklch(0.52 0 0)oklch(0.65 0 0)
--mv-rule-hairoklch(0 0 0 / 0.07)oklch(1 0 0 / 0.08)
--mv-ruleoklch(0 0 0 / 0.1)oklch(1 0 0 / 0.12)
--mv-rule-2oklch(0 0 0 / 0.12)oklch(1 0 0 / 0.16)
--mv-rule-strongoklch(0 0 0 / 0.18)oklch(1 0 0 / 0.24)
--mv-rule-hoveroklch(0 0 0 / 0.18)oklch(1 0 0 / 0.24)
--mv-rule-maxoklch(0 0 0 / 0.24)oklch(1 0 0 / 0.34)
--mv-focusoklch(0 0 0 / 0.2)oklch(1 0 0 / 0.18)
--mv-fill-dimoklch(0 0 0 / 0.14)oklch(1 0 0 / 0.22)
--mv-track-neutraloklch(0 0 0 / 0.16)oklch(1 0 0 / 0.3)
--mv-signaloklch(0.55 0.2 25)oklch(0.74 0.16 22)
--mv-signal-strongoklch(0.55 0.22 25)oklch(0.7 0.19 22)
--mv-signal-linecolor-mix(in oklab, var(--mv-signal-strong) 60%, transparent)same
--mv-signal-outlinecolor-mix(in oklab, var(--mv-signal-strong) 50%, transparent)same
--mv-signal-tintcolor-mix(in oklab, var(--mv-signal-strong) 16%, transparent)same
--mv-scrimoklch(0 0 0 / 0.35)oklch(0 0 0 / 0.7)
--mv-14pxsame
--mv-28pxsame
--mv-312pxsame
--mv-416pxsame
--mv-524pxsame
--mv-632pxsame
--mv-748pxsame
--mv-fontui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji"same
--mv-font-monoui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospacesame
--mv-radius5.2pxsame
--mv-radius-lg7.2pxsame
--mv-easecubic-bezier(0.2, 0, 0, 1)same
--mv-swellcubic-bezier(0.4, 0, 0.6, 1)same
--mv-fast140mssame
--mv-slow420mssame
--mv-hull14pxsame

Class names and the structure of the widget's HTML are not part of its interface. They start with mv- so they cannot collide with yours, and they can change in any release.

On this page