UNPKG

@hsuna/postcss-media-query-transform

Version:

PostCSS plugin designed to automatically adjust pixel values within specified media queries. It scales the numeric values of designated units according to predefined ratios, ensuring consistent and responsive design across various devices and screen sizes

22 lines (18 loc) 741 B
import { PluginCreator, Input } from 'postcss'; interface MediaQueryScale { query: string; scale: number | ((input: Input) => number); } interface UserDefinedOptions { mediaQuery?: MediaQueryScale | MediaQueryScale[]; unitPrecision?: number; selectorBlackList?: (string | RegExp)[]; propList?: (string | RegExp)[]; transformUnit?: "px" | "rpx" | "rem"; insert?: "before" | "after"; exclude?: (string | RegExp)[] | ((filePath: string) => boolean); disabled?: boolean; } type PostcssMediaQueryTransform = PluginCreator<UserDefinedOptions>; declare const plugin: PostcssMediaQueryTransform; export { type MediaQueryScale, type PostcssMediaQueryTransform, type UserDefinedOptions, plugin as default };