Color Mode
ColorMode switches a flow between light, dark and the operating system's preference, and every part of it follows - nodes, edges, the control bar, the minimap, node toolbars and the attribution - because every colour is a --bit-blow-* CSS custom property. Overriding a few of those properties is a theme of your own, and ReducedMotion stills the animation for readers who ask for less.
Every colour here is a
--bit-blow-* custom property.Press Tab to move between the nodes and edges of the diagram.
Press Enter or Space to select it, Shift with Enter to add it to the selection, the arrow keys to move the selected nodes, Delete to remove them and Escape to clear the selection. Press C to start a connection from it.
Press Enter or Space to select it, Delete to remove it and Escape to clear the selection. Press C to move its end to another node.
bit BlowTry it
- Pick a Theme: Light and Dark fix the flow's colours, System follows your operating system's light or dark setting, and Site theme follows this site's own toggle in the header.
- Click a node to select it and open its toolbar - Duplicate copies the selection, Delete removes the node - and see that the toolbar, the selection ring, the control bar and the minimap all change with the theme.
- Tick Override the accent: the selection ring, selected edges, the line drawn while connecting and the focus rings all turn teal, in either mode.
- Tick Warm palette: the pane, the nodes, the edges, the pattern and the minimap take warmer colours - a lighter set in light mode and a darker set in dark mode.
- Tick Reduce motion: the animated edge from Node 1 keeps its dashes but stops marching.
- Press the lock button at the bottom of the control bar: nodes can no longer be dragged, connected or selected until you press it again.
- Turn on a high-contrast theme in your operating system, or emulate
forced-colors: activein the browser's developer tools: edges, handles and the selection switch to the system's colours, and selection is drawn as an outline.
How it works
ColorModeisBlowColorMode.Light(the default),DarkorSystem. Dark putsbit-blow-darkon the canvas, which copies every--bit-blow-dark-*property over its light twin; system putsbit-blow-system, which does the same whileprefers-color-schemeis dark.- Every colour in the stylesheet - pane, nodes, edges, handles, the control bar, the minimap, toolbars, labels - reads a
--bit-blow-*property on the.bit-blowelement, which is why the whole component changes together. - The accent override sets
--bit-blow-node-selected,--bit-blow-edge-selectedand--bit-blow-connection-stroke, and--bit-blow-dark-accentfor dark mode, on a class passed through the canvas'sClass. - The warm palette overrides
--bit-blow-bg,-node-bg,-node-border,-edge-stroke,-background-patternand-minimap-node, and their--bit-blow-dark-*twins, so it has a dark version too. The rule is wrapped in:where(), keeping it below the colour modes' two-class rules - otherwise a light override would win in dark mode as well. ReducedMotion(defaultBlowReducedMotion.System) follows the operating system's reduce-motion setting; the box setsAlways, andNeveranimates regardless. It also makes viewport transitions jump instead of easing.- Under forced colours the stylesheet maps edge, handle and selection colours onto the system palette (
CanvasText,Highlight,GrayText), since the browser does not recolour SVG strokes or box shadows itself. BlowControlsshows the lock only withShowInteractive, and the lock only reports its state:@bind-Interactivefeeds a field the page passes toNodesDraggable,NodesConnectableandElementsSelectable.BlowNodeToolbarshows over a node while it is selected; its buttons callDuplicateSelectionAsync()andDeleteElementsAsync().