styleValueTypes

Returns what an environment's spec needs to declare its style attributes: their value types for the compiler.

@internote/canvas-sdkFunction
On this page
import { styleValueTypes } from '@internote/canvas-sdk';

Each style attribute is named by its value type, which the attributes that take it declare as their type — an expr position whose result is a list of looks.

#Signature

(
    specs: Record<string, StyleAttributeSpec>,
): Required<Pick<EnvironmentSpec, "valueTypes">>

#Parameters

specs
Each style attribute, by value type name.

#Example

const STYLES = { 'colour-style': { kind: 'colour' }, 'size-style': { kind: 'size' } };
export const SPEC: EnvironmentSpec = {
    valueTypes: { ...styleValueTypes(STYLES).valueTypes },
    vocabulary: { dot: { attributes: { colour: { type: 'colour-style', default: 'red' } } } },
};

Declared in packages/canvas-sdk/src/refine/style-attributes.ts:131.

Last updated