UNPKG

@noema/motif

Version:

A type-safe styling library for React components built on top of [Vanilla Extract](https://vanilla-extract.style/). `@noema/motif` allows you to create styled components with consistent theme-aware props that cleanly separate styling from component logic.

14 lines (13 loc) 595 B
import { CSSProperties, style } from '@vanilla-extract/css'; export type CSSProps = keyof CSSProperties; export interface MotifStyle<P extends CSSProps = CSSProps, SH extends string = string> { baseClassName?: string; refs: Record<P, string>; classNames: Record<P, string>; shorthands?: Record<SH, readonly P[]>; } export declare function motifStyle<P extends readonly CSSProps[], SH extends string = string>(properties: P, options?: { prefix?: string; base?: Parameters<typeof style>[0]; shorthands?: Record<SH, readonly P[number][]>; }): MotifStyle<P[number], SH>;