Skip to content

Customisation

Every colour, radius and dimension is a CSS custom property, and every visual element can be replaced with a render fragment. Nothing needs a selector override.

Live
Ready

Theme

Overlay

The Overlay fragment receives the scanner itself, so a custom overlay can read the status, the open camera and the current zoom without extra plumbing.

Generated CSS

--bit-bbscanner-accent:#4fa3f4;
--bit-bbscanner-reticle-color:#4fa3f4;
--bit-bbscanner-radius:0.75rem;
--bit-bbscanner-reticle-thickness:3px;
--bit-bbscanner-reticle-length:14%;
--bit-bbscanner-overlay:rgba(6,8,12,0.55)

Every custom property

PropertyDefaultControls
--bit-bbscanner-radius0.75remCorner radius of the viewport
--bit-bbscanner-bg#0b0d12Backdrop behind the video
--bit-bbscanner-fg#f5f7faText colour
--bit-bbscanner-muted#9aa4b2Secondary text and idle indicator
--bit-bbscanner-accent#4f8cffActive controls and starting state
--bit-bbscanner-danger#ff5f57Faulted state
--bit-bbscanner-success#35c77cScanning state and result highlight
--bit-bbscanner-overlayrgba(6,8,12,0.55)Dimming outside the scan region
--bit-bbscanner-reticle-color#ffffffReticle corners
--bit-bbscanner-reticle-thickness3pxReticle stroke width
--bit-bbscanner-reticle-length14%Reticle corner arm length
--bit-bbscanner-reticle-radius0.5remReticle corner rounding
--bit-bbscanner-control-bgrgba(18,22,30,0.72)Control background
--bit-bbscanner-control-fg#f5f7faControl text
--bit-bbscanner-control-hover-bgrgba(40,48,62,0.9)Control hover background
--bit-bbscanner-focus-ring0 0 0 3px …Keyboard focus indicator
--bit-bbscanner-fontsystem-ui, …Font stack
--bit-bbscanner-gap0.5remSpacing inside the control bars
--bit-bbscanner-transition160ms easeTransition timing

This site tints the accent, the focus ring, the radius and the font of its scanners with one rule on .bit-bbscanner, which outranks the zero-specificity defaults wherever it is declared; the style attribute of the scanner above outranks that rule in turn.

Accessibility and direction

The scanner is a labelled region, the controls are real buttons with pressed state, results are announced through a polite live region, and the layout uses logical properties throughout so a right to left document needs no extra work. Animation is suppressed under prefers-reduced-motion, and the reticle and controls switch to system colours under forced-colors.

An unhandled error has occurred. Reload 🗙