@mocanvas/editor · interface

TLTheme

interface TLTheme

A complete theme: both ramps and the metrics that go with them.

Everything except TLTheme.id is what getDisplayValues reads, so overriding a single field (one colour, one stroke width) is enough to restyle every shape that resolves through it.


Properties · 8

arrowLabelFontSize?: Record<DefaultSizeStyle$1, number>

The same again for an arrow's label, which steps up more gently still.

colors: {

The two ramps. Which one is live is the colour *mode*, not the theme.

fonts: TLThemeFonts

CSS font stacks per font style.

fontSize: Record<DefaultSizeStyle$1, number>

Rendered font size, in page units, per size style, for a text shape.

id: TLThemeId

The key this theme is registered under.

labelFontSize?: Record<DefaultSizeStyle$1, number>

The same for a label — text inside a geo shape or on a note. Optional: a theme that omits it gets the default scale, so a theme written before labels had one of their own keeps working.

lineHeight: number

Line height as a multiple of the font size.

strokeWidth: Record<DefaultSizeStyle$1, number>

Stroke width, in page units, per size style.

Mentioned here

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.