motyl
Version:
Helper functions for creating responsive CSS-in-JS styles without runtime
16 lines (15 loc) • 1.1 kB
TypeScript
import { BaseBreakpoints } from "./breakpoints/utils";
export { default as matchMedia } from "./helpers/matchMedia";
export { default as useBreakpoint } from "./helpers/useBreakpoint";
export { createStyleTools };
declare function createStyleTools<B extends string>(breakpoints: BaseBreakpoints<B>): {
responsive: (prop: keyof import("csstype").PropertiesHyphen<0 | (string & {}), string & {}>, values: Partial<Record<B, string>>) => import("./interfaces").Styles;
breakpoints: {
up: (bp: B, orientation?: ("portrait" | "landscape") | undefined) => string;
down: (bp: B, orientation?: ("portrait" | "landscape") | undefined) => string;
only: (bp: B, orientation?: ("portrait" | "landscape") | undefined) => string;
between: (bp1: B, bp2: B, orientation?: ("portrait" | "landscape") | undefined) => string;
sortValuesByBp: <T>(values: [B, T][]) => [B, T][];
};
fluidStyle: (style: Partial<Record<keyof import("csstype").Properties<0 | (string & {}), string & {}>, Partial<Record<B, string>>>>) => import("./interfaces").Styles;
};