@greensight/gds
Version:
Greensight Design System
12 lines (11 loc) • 689 B
TypeScript
import { type AllowMedia, type Breakpoint, type ValueType } from '../../types/scss/Layout';
export declare const isObject: (item: AllowMedia<ValueType>) => boolean;
/**
* Calculate CSS Object from component props with `AllowMedia` type (user can pass object with breakpoints through prop). CSS property can be calculated based on multiple props.
*/
export declare const useCSSProperty: <T extends AllowMedia<ValueType>>({ value, transform, }: {
/** Component value or array of values. */
value?: T;
/** Transform function. Applies before property value assignment. */
transform?: (value: ValueType) => ValueType;
}) => Partial<Record<Breakpoint, ValueType>> | undefined;