Skip to content

Documentation / @finchart/core / index / StyleVar

Interface: StyleVar<T> ​

Defined in: packages/core/src/render/style-spec.ts:12

How one CSS variable becomes a settled value. The key is the value — name, fallback, and parsing method are bundled into one object, and that object lives next to the series that uses it.

The parsing method isn't spelled out separately — fallback's type decides it.

Type Parameters ​

T ​

T extends number | string

Properties ​

css ​

readonly css: string

Defined in: packages/core/src/render/style-spec.ts:20

The custom property to read. The convention is a single --chart-*.

A leaf must always have this — a default with no variable isn't a leaf, it's a code constant. Only what takes part in the three-tier override > variable > fallback belongs in the spec.


fallback ​

readonly fallback: T

Defined in: packages/core/src/render/style-spec.ts:22

Used when there's neither a variable nor an override.


range? ​

readonly optional range?: T extends number ? readonly [number, number] : never

Defined in: packages/core/src/render/style-spec.ts:28

Numbers only. Demotes a value from CSS into this range — CSS is plainly outside. So that --chart-candle-body-ratio: 3 doesn't make the body three times the slot.