@mocanvas/editor · function

getThemeCssVars

declare function getThemeCssVars(colors: TLThemeColors | undefined): CSSProperties

The custom properties for one resolved ramp.

SEMANTICS-ASSUMED: --mocanvas-selection-fg is the fill of a solid selection handle, and is mapped to the theme's background. A handle is a chip of the page punched out of the selection stroke, so it has to match the page it sits on or it reads as a light dot on a dark canvas — which is exactly what the hard-coded #ffffff did before the theme existed.

A colour the ramp does not carry is skipped rather than written as undefined, so the literal fallback in var(--x, …) still applies.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.