export type ISize = "small" | "normal" | "large" | "xl" | "2xl"; /** * Patterns for detection of tailwind classes */ export const Patterns = { /** * **height** styling including variants */ height: /((\S*:){0,2}h-\S*)/gs, /** * **width** styling including variants */ width: /((\S*:){0,2}w-\S*)/gs, /** * **max-width** styling including variants */ maxWidth: /((\S*:){0,2}max-w-\S*)/gs, /** * **min-width** styling including variants */ minWidth: /((\S*:){0,2}min-w-\S*)/gs, /** x-axis padding */ px: /((\S*:){0,2}(-){0,1}px-\S*)/gs, /** y-axis padding */ py: /((\S*:){0,2}(-){0,1}py-\S*)/gs, /** left padding */ pl: /((\S*:){0,2}(-){0,1}pl-\S*)/gs, /** right padding */ pr: /((\S*:){0,2}(-){0,1}pr-\S*)/gs, /** top padding */ pt: /((\S*:){0,2}(-){0,1}pt-\S*)/gs, /** bottom padding */ pb: /((\S*:){0,2}(-){0,1}pb-\S*)/gs, /** * all forms of **padding**, including [x,y,t,b,l,r], all variants, * positive and negative values **/ padding: /((\S*:){0,2}(-){0,1}p[x|y|t|b|l|r]{0,1}-\S*)/gs, /** horizontal padding, which includes `p` and `px` */ horzPadding: /((\S*:){0,2}(-){0,1}p[x]{0,1}-\S*)/gs, /** horizontal padding, which includes `p` and `py` */ vertPadding: /((\S*:){0,2}(-){0,1}p[y]{0,1}-\S*)/gs, /** x-axis padding */ mx: /((\S*:){0,2}(-){0,1}mx-\S*)/gs, /** y-axis padding */ my: /((\S*:){0,2}(-){0,1}my-\S*)/gs, /** left padding */ ml: /((\S*:){0,2}(-){0,1}ml-\S*)/gs, /** right padding */ mr: /((\S*:){0,2}(-){0,1}mr-\S*)/gs, /** top padding */ mt: /((\S*:){0,2}(-){0,1}mt-\S*)/gs, /** bottom padding */ mb: /((\S*:){0,2}(-){0,1}mb-\S*)/gs, /** * all forms of **margin**, including [x,y,t,b,l,r], all variants, * positive and negative values **/ margin: /((\S*:){0,2}(-){0,1}m[x|y|t|b|l|r]{0,1}-\S*)/gs, /** all hover effects, including variants */ hoverEffects: /((\S*:){0,2}hover:\S*)/gs, /** cursor effects, including variants */ cursor: /((\S*:){0,2}cursor-\S*)/gs, /** text color, including variants */ textColor: /((\S*:){0,2}text-(\S*-[0-9]{2,3}|white|black))/gs, textAlignment: /((\S*:){0,2}text-(left|right|center))/gs, /** background color, including variants */ bgColor: /((\S*:){0,2}bg-\S+-[0-9]{2,3})/gs, rounded: /((\S*:){0,2}rounded(-\S*){0,1})/gs, leading: /((\S*:){0,2}leading-\S*)/gs, /** Font **weight** styles including variants */ fontWeight: /((\S*:){0,2}font-[thin|extralight|light|medium|semibold|bold])/gs, /** Font **family** styles including variants */ fontFamily: /((\S*:){0,2}font-[sans|serif|mono])/gs, }; /** * Tailwind class categories which can be targetted when * building default values. */ export type TailwindType = keyof typeof Patterns;