UNPKG

@aesthetic/system

Version:

Web based building blocks for the Aesthetic design system.

34 lines 1.44 kB
import { ColorScheme, ContrastLevel, VariablesMap } from '@aesthetic/types'; import type { Design } from './Design'; import { DeepPartial, MixinType, ThemeOptions, ThemeTokens, Tokens, Utilities, VariableName } from './types'; export declare class Theme<Block extends object> implements Utilities<Block> { name: string; readonly contrast: ContrastLevel; readonly design: Design<Block>; readonly scheme: ColorScheme; readonly tokens: Tokens; private cssVariables?; constructor(options: ThemeOptions, tokens: ThemeTokens, design: Design<Block>); /** * Extend and instantiate a new theme instance with customized tokens. */ extend(tokens: DeepPartial<ThemeTokens>, options?: Partial<ThemeOptions>): Theme<Block>; /** * Return both design and theme tokens as a mapping of CSS variables. */ toVariables(): VariablesMap; /** * Return merged CSS properties from the defined mixin, all template overrides, * and the provided additional CSS properties. */ mixin: (name: MixinType, rule?: Block | undefined) => Block; /** * Return a `rem` unit equivalent for the current spacing type and unit. */ unit: (...multipliers: number[]) => string; /** * Return a CSS variable declaration with the defined name and fallbacks. */ var: (name: VariableName, ...fallbacks: (number | string)[]) => string; } //# sourceMappingURL=Theme.d.ts.map