UNPKG

@illlia/css-merge

Version:

css-merge is a tiny package to compose css classes on the 'last class wins' basis

20 lines (19 loc) 730 B
export type CompressedConfig = Record<ClassName, CompressedStyles>; /** [...([PropertyKeys, Value, Order, Important?][])] */ export type CompressedStyles = (PropertyKeys | Value | Order | Important)[]; export type PropMetadata = { v: Value; o: Order; i?: Important; }; type ClassName = string; /** Property keys split by special char */ type PropertyKeys = string; type Order = number; type Value = number; type Important = 1; type Falsy = null | undefined | 0 | "" | false; export type CssMergeFn = ReturnType<typeof createCssMerge>; export declare const SPECIAL_SPLIT_CHART = ","; export declare const createCssMerge: (compressedConfig: CompressedConfig) => (...allClasses: (string | Falsy)[]) => string; export {};