uinix-theme
Version:
Fully configurable framework-agnostic theme system (spec, theme, renderer, themed styles/keyframes/CSS variables) for building UIs. Your theme your rules 🤘.
66 lines (65 loc) • 1.92 kB
TypeScript
export type _FelaRenderer = import('fela').IRenderer;
export type _FelaPlugin = import('fela').TPlugin;
export type _CssTypeProperties = import('csstype').Properties;
export type _FelaEnhancer = (renderer: _FelaRenderer) => _FelaRenderer;
/**
* A valid base CSS value e.g. "4px", 4, "red".
*/
export type CssValue = string | number;
/**
* A valid CSS property e.g. "backgroundColor", "paddingLeft".
*/
export type CssProperty = keyof _CssTypeProperties;
/**
* Map of CSS variables to CSS values.
*/
export type CssVariables = Record<string, CssValue>;
/**
* A theme property.
*/
export type ThemeProperty = string;
/**
* A theme spec relates theme properties with CSS properties.
*/
export type ThemeSpec = Record<ThemeProperty, Array<CssProperty>>;
/**
* Recursive helper type.
*/
export type ThemeRecursive = {
[key: string]: CssValue | ThemeRecursive;
};
/**
* A theme relates theme properties with CSS values (recursive).
*/
export type Theme = Record<ThemeProperty, ThemeRecursive>;
/**
* Style values can be specified as either singleton or array of CSS values.
*/
export type StyleValue = CssValue | Array<CssValue>;
/**
* Mapping of CSS properties to style values.
*/
export type StyleCssProperties = _CssTypeProperties & Record<string, StyleValue>;
/**
* ;
* Recursive helper type.
*/
export type StyleRecursiveAny = {
[key: string]: StyleValue | StyleCssProperties | StyleRecursiveAny | StyleRecursivePseudo;
};
/**
* ;
* Recursive helper type.
*/
export type StyleRecursivePseudo = {
[key: string]: StyleValue | StyleCssProperties | StyleRecursiveAny | StyleRecursivePseudo;
};
/**
* A style object.
*/
export type StyleObject = StyleCssProperties | StyleRecursivePseudo | StyleRecursiveAny;
export type StyleRule<P = unknown> = (props: P) => StyleObject;
/**
* A style can be either a style object or a style rule.
*/
export type Style = StyleObject | StyleRule;