UNPKG

@twind/preset-tailwind

Version:

Tailwind CSS preset for twind

2 lines (1 loc) 17.7 kB
this.twind=this.twind||{},this.twind.presetTailwind_rules=function(t){"use strict";function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o])}return t}).apply(this,arguments)}function a(){return e.apply(this,arguments)}let o=[t.match("\\[([-\\w]+):(.+)]",({1:e,2:a},o)=>({"@layer overrides":{"&":{[e]:t.arbitrary(`[${a}]`,"",o)}}})),t.match("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),t.matchTheme("aspect-","aspectRatio"),t.match("container",(e,{theme:o})=>{let{screens:r=o("screens"),center:i,padding:n}=o("container"),c=a({width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto"},m("xs"));for(let l in r){let h=r[l];"string"==typeof h&&(c[t.mql(h)]={"&":a({maxWidth:h},m(l))})}return c;function m(t){let e=n&&("string"==typeof n?n:n[t]||n.DEFAULT);if(e)return{paddingRight:e,paddingLeft:e}}}),t.matchTheme("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),t.match("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),t.match("box-(border|content)","boxSizing",({1:t})=>t+"-box"),t.match("hidden",{display:"none"}),t.match("table-(auto|fixed)","tableLayout"),t.match(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",t.match("isolate","isolation"),t.match("object-(contain|cover|fill|none|scale-down)","objectFit"),t.matchTheme("object-","objectPosition"),t.match("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",r),t.match("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),t.match("(static|fixed|absolute|relative|sticky)","position"),t.matchTheme("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:"-x"!=t&&e,right:"-y"!=t&&e,bottom:"-x"!=t&&e,left:"-y"!=t&&e})),t.matchTheme("-?(top|bottom|left|right)(?:$|-)","inset"),t.match("(visible|collapse)","visibility"),t.match("invisible",{visibility:"hidden"}),t.matchTheme("-?z-","zIndex"),t.match("flex-((row|col)(-reverse)?)","flexDirection",i),t.match("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),t.matchTheme("(flex-(?:grow|shrink))(?:$|-)"),t.matchTheme("(flex)-"),t.matchTheme("grow(?:$|-)","flexGrow"),t.matchTheme("shrink(?:$|-)","flexShrink"),t.matchTheme("basis-","flexBasis"),t.matchTheme("-?(order)-"),"-?(order)-(\\d+)",t.matchTheme("grid-cols-","gridTemplateColumns"),t.match("grid-cols-(\\d+)","gridTemplateColumns",g),t.matchTheme("col-","gridColumn"),t.match("col-(span)-(\\d+)","gridColumn",w),t.matchTheme("col-start-","gridColumnStart"),t.match("col-start-(auto|\\d+)","gridColumnStart"),t.matchTheme("col-end-","gridColumnEnd"),t.match("col-end-(auto|\\d+)","gridColumnEnd"),t.matchTheme("grid-rows-","gridTemplateRows"),t.match("grid-rows-(\\d+)","gridTemplateRows",g),t.matchTheme("row-","gridRow"),t.match("row-(span)-(\\d+)","gridRow",w),t.matchTheme("row-start-","gridRowStart"),t.match("row-start-(auto|\\d+)","gridRowStart"),t.matchTheme("row-end-","gridRowEnd"),t.match("row-end-(auto|\\d+)","gridRowEnd"),t.match("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>r(i(t))),t.match("grid-flow-(dense)","gridAutoFlow"),t.matchTheme("auto-cols-","gridAutoColumns"),t.matchTheme("auto-rows-","gridAutoRows"),t.matchTheme("gap-x(?:$|-)","gap","columnGap"),t.matchTheme("gap-y(?:$|-)","gap","rowGap"),t.matchTheme("gap(?:$|-)","gap"),"(justify-(?:items|self))-",t.match("justify-","justifyContent",l),t.match("(content|items|self)-",t=>({["align-"+t[1]]:l(t)})),t.match("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),t.matchTheme("p([xytrbl])?(?:$|-)","padding",h("padding")),t.matchTheme("-?m([xytrbl])?(?:$|-)","margin",h("margin")),t.matchTheme("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+({y:"top",x:"left"})[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+({y:"bottom",x:"right"})[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),t.match("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),t.matchTheme("w-","width"),t.matchTheme("min-w-","minWidth"),t.matchTheme("max-w-","maxWidth"),t.matchTheme("h-","height"),t.matchTheme("min-h-","minHeight"),t.matchTheme("max-h-","maxHeight"),t.matchTheme("font-","fontWeight"),t.matchTheme("font-","fontFamily",({_:e})=>"string"==typeof(e=t.asArray(e))[1]?{fontFamily:c(e)}:a({fontFamily:c(e[0])},e[1])),t.match("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),t.match("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),t.match("italic","fontStyle"),t.match("not-italic",{fontStyle:"normal"}),t.match("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:o})=>"normal"==e?{fontVariantNumeric:"normal"}:a({["--tw-"+(o?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)"},u({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"}))),t.matchTheme("tracking-","letterSpacing"),t.matchTheme("leading-","lineHeight"),t.match("list-(inside|outside)","listStylePosition"),t.matchTheme("list-","listStyleType"),t.match("list-","listStyleType"),t.matchTheme("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),t.matchColor("placeholder-",{property:"color",selector:"&::placeholder"}),t.match("text-(left|center|right|justify|start|end)","textAlign"),t.match("text-(ellipsis|clip)","textOverflow"),t.matchTheme("text-opacity-","textOpacity","--tw-text-opacity"),t.matchColor("text-",{property:"color"}),t.matchTheme("text-","fontSize",({_:t})=>"string"==typeof t?{fontSize:t}:a({fontSize:t[0]},"string"==typeof t[1]?{lineHeight:t[1]}:t[1])),t.matchTheme("indent-","textIndent"),t.match("(overline|underline|line-through)","textDecorationLine"),t.match("no-underline",{textDecorationLine:"none"}),t.matchTheme("underline-offset-","textUnderlineOffset"),t.matchColor("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),t.matchTheme("decoration-","textDecorationThickness"),t.match("decoration-","textDecorationStyle"),t.match("(uppercase|lowercase|capitalize)","textTransform"),t.match("normal-case",{textTransform:"none"}),t.match("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),t.match("align-","verticalAlign"),t.match("whitespace-","whiteSpace"),t.match("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),t.match("break-words",{overflowWrap:"break-word"}),t.match("break-all",{wordBreak:"break-all"}),t.match("break-keep",{wordBreak:"keep-all"}),t.matchColor("caret-",{opacityVariable:!1,opacitySection:"opacity"}),t.matchColor("accent-",{opacityVariable:!1,opacitySection:"opacity"}),t.match("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${n(t," ")},var(--tw-gradient-stops))`),t.matchColor("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),t.matchColor("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),t.matchColor("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),t.match("bg-(fixed|local|scroll)","backgroundAttachment"),t.match("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),t.match(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),t.match("bg-blend-","backgroundBlendMode"),t.match("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+("text"==t?"":"-box")),t.matchTheme("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),t.matchColor("bg-",{section:"backgroundColor"}),t.matchTheme("bg-","backgroundImage"),t.matchTheme("bg-","backgroundPosition"),t.match("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",r),t.matchTheme("bg-","backgroundSize"),t.matchTheme("rounded(?:$|-)","borderRadius"),t.matchTheme("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let a={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${n(a[0])}-radius`]:e,[`border-${n(a[1])}-radius`]:e}}),t.match("border-(collapse|separate)","borderCollapse"),t.matchTheme("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),t.match("border-(solid|dashed|dotted|double|none)","borderStyle"),t.matchTheme("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>a({},u({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),{["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),t.matchColor("border-([xytrbl])-",{section:"borderColor"},h("border","Color")),t.matchColor("border-"),t.matchTheme("border-([xytrbl])(?:$|-)","borderWidth",h("border","Width")),t.matchTheme("border(?:$|-)","borderWidth"),t.matchTheme("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),t.match("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),t.match("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),t.matchTheme("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let a={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${n(a[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${n(a[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),t.matchColor("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),t.matchTheme("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),t.matchColor("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),t.matchTheme("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),t.match("ring-inset",{"--tw-ring-inset":"inset"}),t.matchColor("ring-",{property:"--tw-ring-color"}),t.matchTheme("ring(?:$|-)","ringWidth",({_:e},{theme:o})=>a({},u({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":o("ringOffsetWidth","","0px"),"--tw-ring-offset-color":t.toColorValue(o("ringOffsetColor","","#fff")),"--tw-ring-color":t.toColorValue(o("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":o("ringOpacity","","0.5")}}),{"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${e} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),t.matchColor("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),t.matchTheme("shadow(?:$|-)","boxShadow",({_:t})=>a({},u({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),{"--tw-shadow":c(t),"--tw-shadow-colored":c(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),t.matchTheme("(opacity)-"),t.match("mix-blend-","mixBlendMode"),...m(),...m("backdrop-"),t.matchTheme("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:c(t),transitionTimingFunction:"none"==t._?void 0:c(e("transitionTimingFunction","")),transitionDuration:"none"==t._?void 0:c(e("transitionDuration",""))})),t.matchTheme("duration(?:$|-)","transitionDuration","transitionDuration",c),t.matchTheme("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",c),t.matchTheme("delay(?:$|-)","transitionDelay","transitionDelay",c),t.matchTheme("animate(?:$|-)","animation",(t,{theme:e,h:a,e:o})=>{let r=c(t),i=r.split(" "),n=e("keyframes",i[0]);return n?{["@keyframes "+(i[0]=o(a(i[0])))]:n,animation:i.join(" ")}:{animation:r}}),"(transform)-(none)",t.match("transform",d),t.match("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":p("gpu"==t)})),t.matchTheme("scale(-[xy])?-","scale",({1:t,_:e})=>a({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e},d())),t.matchTheme("-?(rotate)-","rotate",s),t.matchTheme("-?(translate-[xy])-","translate",s),t.matchTheme("-?(skew-[xy])-","skew",s),t.match("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",r),"(appearance)-",t.matchTheme("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",t.matchTheme("(cursor)-"),"(cursor)-",t.match("snap-(none)","scroll-snap-type"),t.match("snap-(x|y|both)",({1:t})=>a({},u({"--tw-scroll-snap-strictness":"proximity"}),{"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),t.match("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),t.match("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),t.match("snap-(normal|always)","scroll-snap-stop"),t.match("scroll-(auto|smooth)","scroll-behavior"),t.matchTheme("scroll-p([xytrbl])?(?:$|-)","padding",h("scroll-padding")),t.matchTheme("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",h("scroll-margin")),t.match("touch-(auto|none|manipulation)","touch-action"),t.match("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:o})=>a({},u({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),{[`--tw-${e?"pan-x":o?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),t.match("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),t.match("outline",{outlineStyle:"solid"}),t.match("outline-(dashed|dotted|double)","outlineStyle"),t.matchTheme("-?(outline-offset)-"),t.matchColor("outline-",{opacityVariable:!1,opacitySection:"opacity"}),t.matchTheme("outline-","outlineWidth"),"(pointer-events)-",t.matchTheme("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],t.match("select-(none|text|all|auto)","userSelect"),t.matchColor("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),t.matchColor("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),t.matchTheme("stroke-","strokeWidth"),t.match("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),t.match("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function r(t){return("string"==typeof t?t:t[1]).replace(/-/g," ").trim()}function i(t){return("string"==typeof t?t:t[1]).replace("col","column")}function n(t,e="-"){let a=[];for(let o of t)a.push({t:"top",r:"right",b:"bottom",l:"left"}[o]);return a.join(e)}function c(t){return t&&""+(t._||t)}function l({$$:t}){return(({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"})[t[3]||""]||"")+t}function h(e,o=""){return({1:r,_:i})=>{let c={x:"lr",y:"tb"}[r]||r+r;return c?a({},t.toCSS(e+"-"+n(c[0])+o,i),t.toCSS(e+"-"+n(c[1])+o,i)):t.toCSS(e+o,i)}}function m(e=""){let o=["blur","brightness","contrast","grayscale","hue-rotate","invert",e&&"opacity","saturate","sepia",!e&&"drop-shadow"].filter(Boolean),r={};for(let i of o)r[`--tw-${e}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return r=a({},u(r),{[`${e}filter`]:o.map(t=>`var(--tw-${e}${t})`).join(" ")}),[`(${e}filter)-(none)`,t.match(`${e}filter`,r),...o.map(o=>t.matchTheme(`${"h"==o[0]?"-?":""}(${e}${o})(?:$|-)`,o,({1:e,_:i})=>a({[`--tw-${e}`]:t.asArray(i).map(t=>`${o}(${t})`).join(" ")},r)))]}function s({1:t,_:e}){return a({["--tw-"+t]:e},d())}function d(){return a({},u({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":p()}),{transform:"var(--tw-transform)"})}function p(t){return[t?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function w({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function g({1:t}){return`repeat(${t},minmax(0,1fr))`}function u(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}return o}(twind.core);//# sourceMappingURL=rules.global.js.map