babel-plugin-tailwind-components
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -1,2 +0,2 @@ | ||
var e={"bg-bottom":{backgroundPosition:"bottom"},"bg-center":{backgroundPosition:"center"},"bg-left":{backgroundPosition:"left"},"bg-left-bottom":{backgroundPosition:"left bottom"},"bg-left-top":{backgroundPosition:"left top"},"bg-right":{backgroundPosition:"right"},"bg-right-bottom":{backgroundPosition:"right bottom"},"bg-right-top":{backgroundPosition:"right-top"},"bg-top":{backgroundPosition:"top"},"bg-repeat":{backgroundRepeat:"repeat"},"bg-no-repeat":{backgroundRepeat:"no-repeat"},"bg-repeat-x":{backgroundRepeat:"repeat-x"},"bg-repeat-y":{backgroundRepeat:"repeat-y"},"bg-cover":{backgroundSize:"cover"},"bg-contain":{backgroundSize:"contain"},"bg-fixed":{backgroundAttachment:"fixed"},"bg-local":{backgroundAttachment:"local"},"bg-scroll":{backgroundAttachment:"scroll"},"border-solid":{borderStyle:"solid"},"border-dashed":{borderStyle:"dashed"},"border-dotted":{borderStyle:"dotted"},"border-none":{borderStyle:"none"},block:{display:"block"},"inline-block":{display:"inline-block"},inline:{display:"inline"},table:{display:"table"},"table-row":{display:"table-row"},"table-cell":{display:"table-cell"},hidden:{display:"none"},flex:{display:"flex"},"inline-flex":{display:"inline-flex"},"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"},"flex-no-wrap":{flexWrap:"nowrap"},"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"justify-start":{justifyContent:"flex-start"},"justify-center":{justifyContent:"center"},"justify-end":{justifyContent:"flex-end"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"items-stretch":{alignItems:"flex-stretch"},"items-start":{alignItems:"flex-start"},"items-center":{alignItems:"center"},"items-end":{alignItems:"flex-end"},"items-baseline":{alignItems:"baseline"},"content-start":{alignContent:"flex-start"},"content-center":{alignContent:"center"},"content-end":{alignContent:"flex-end"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-center":{alignSelf:"center"},"self-end":{alignSelf:"flex-end"},"self-stretch":{alignSelf:"stretch"},"flex-initial":{flex:"initial"},"flex-1":{flex:1},"flex-auto":{flex:"auto"},"flex-none":{flex:"none"},"flex-grow":{flexGrow:1},"flex-shrink":{flexShrink:1},"flex-no-grow":{flexGrow:0},"flex-no-shrink":{flexShrink:0},"float-right":{float:"right"},"float-left":{float:"left"},"float-none":{float:"none"},clearfix:{"::after":{content:'""',display:"table",clear:"both"}},"appearance-none":{appearance:"none"},"cursor-auto":{cursor:"auto"},"cursor-pointer":{cursor:"pointer"},"cursor-not-allowed":{cursor:"not-allowed"},"resize-none":{resize:"none"},resize:{resize:"both"},"resize-y":{resize:"vertical"},"resize-x":{resize:"horizontal"},"pointer-events-none":{pointerEvents:"none"},"pointer-events-auto":{pointerEvents:"auto"},"select-none":{userSelect:"none"},"select-text":{userSelect:"text"},"list-reset":{listStyle:"none",padding:0},"overflow-visible":{overflow:"visible"},"overflow-auto":{overflow:"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-x-scroll":{overflowX:"auto"},"overflow-y-scroll":{overflowY:"auto"},"overflow-scroll":{overflow:"scroll"},"scrolling-touch":{webkitOverflowScrolling:"touch"},"scrolling-auto":{webkitOverflowScrolling:"auto"},static:{position:"static"},fixed:{position:"fixed"},absolute:{position:"absolute"},relative:{position:"relative"},"pin-t":{top:0},"pin-r":{right:0},"pin-b":{bottom:0},"pin-l":{left:0},"pin-y":{top:0,bottom:0},"pin-x":{right:0,left:0},pin:{top:0,right:0,bottom:0,left:0},"pin-none":{top:"auto",right:"auto",bottom:"auto",left:"auto"},"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"},italic:{fontStyle:"italic"},roman:{fontStyle:"normal"},uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"},underline:{textDecoration:"underline"},"line-through":{textDecoration:"line-through"},"no-underline":{textDecoration:"none"},antialiased:{webkitFontSmoothing:"antialiased",mozOsxFontSmoothing:"grayscale"},"subpixel-antialiased":{webkitFontSmoothing:"auto",mozOsxFontSmoothing:"auto"},"whitespace-normal":{whiteSpace:"normal"},"whitespace-no-wrap":{whiteSpace:"nowrap"},"whitespace-pre":{whiteSpace:"pre"},"whitespace-pre-line":{whiteSpace:"pre-line"},"whitespace-pre-wrap":{whiteSpace:"pre-wrap"},"break-words":{wordWrap:"break-word"},"break-normal":{wordWrap:"normal"},truncate:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"align-baseline":{verticalAlign:"baseline"},"align-top":{verticalAlign:"top"},"align-middle":{verticalAlign:"middle"},"align-bottom":{verticalAlign:"bottom"},"align-text-top":{verticalAlign:"text-top"},"align-text-bottom":{verticalAlign:"text-bottom"},visible:{visibility:"visible"},invisible:{visibility:"hidden"}},t={bg:{prop:"backgroundColor",config:"backgroundColors"},"border-t":{prop:"borderTopWidth",config:"borderWidths"},"border-b":{prop:"borderBottomWidth",config:"borderWidths"},"border-l":{prop:"borderLeftWidth",config:"borderWidths"},"border-r":{prop:"borderRightWidth",config:"borderWidths"},border:[{prop:"borderColor",config:"borderColors"},{prop:"borderWidth",config:"borderWidths"}],"rounded-t":{prop:"borderTopRadius",config:"borderRadius"},"rounded-r":{prop:"borderRightRadius",config:"borderRadius"},"rounded-b":{prop:"borderBottomRadius",config:"borderRadius"},"rounded-l":{prop:"borderLeftRadius",config:"borderRadius"},"rounded-tl":{prop:"borderTopLeftRadius",config:"borderRadius"},"rounded-tr":{prop:"borderTopRightRadius",config:"borderRadius"},"rounded-br":{prop:"borderBottomRightRadius",config:"borderRadius"},"rounded-bl":{prop:"borderBottomLeftRadius",config:"borderRadius"},rounded:{prop:"borderRadius",config:"borderRadius"},opacity:{prop:"opacity",config:"opacity"},shadow:{prop:"boxShadow",config:"shadows"},w:{prop:"width",config:"width"},"min-w":{prop:"minWidth",config:"minWidth"},"max-w":{prop:"maxWidth",config:"maxWidth"},h:{prop:"height",config:"height"},"min-h":{prop:"minHeight",config:"minHeight"},"max-h":{prop:"maxHeight",config:"maxHeight"},pt:{prop:"paddingTop",config:"padding"},pr:{prop:"paddingRight",config:"padding"},pb:{prop:"paddingBottom",config:"padding"},pl:{prop:"paddingLeft",config:"padding"},px:{prop:["paddingLeft","paddingRight"],config:"padding"},py:{prop:["paddingTop","paddingBottom"],config:"padding"},p:{prop:"padding",config:"padding"},mt:{prop:"marginTop",config:"margin"},mr:{prop:"marginRight",config:"margin"},mb:{prop:"marginBottom",config:"margin"},ml:{prop:"marginLeft",config:"margin"},mx:{prop:["marginLeft","marginRight"],config:"margin"},my:{prop:["marginTop","marginBottom"],config:"margin"},m:{prop:"margin",config:"margin"},"-mt":{prop:"marginTop",config:"negativeMargin",pre:"-"},"-mr":{prop:"marginRight",config:"negativeMargin",pre:"-"},"-mb":{prop:"marginBottom",config:"negativeMargin",pre:"-"},"-ml":{prop:"marginLeft",config:"negativeMargin",pre:"-"},"-mx":{prop:["marginLeft","marginRight"],config:"negativeMargin",pre:"-"},"-my":{prop:["marginTop","marginBottom"],config:"negativeMargin",pre:"-"},"-m":{prop:"margin",config:"negativeMargin",pre:"-"},fill:{prop:"fill",config:"svgFill"},stroke:{prop:"stroke",config:"svgStroke"},font:[{prop:"fontWeight",config:"fontWeights"},{prop:"fontFamily",config:"fonts",preDev:"(",postDev:" || []).map(x => '\"' + x + '\"').join(', ')",format:function(e){return e.map(function(e){return'"'+e+'"'}).join(", ")}}],text:[{prop:"color",config:"textColors"},{prop:"fontSize",config:"textSizes"}],leading:{prop:"lineHeight",config:"leading"},tracking:{prop:"letterSpacing",config:"tracking"},z:{prop:"zIndex",config:"zIndex"}},r=Object.assign||function(e){for(var t=arguments,r=1;r<arguments.length;r++){var o=t[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},o=require("babylon");require("path");function n(n){var l,s,g,c,d,f,u=n.path,b=n.t,m=n.configPath,h=n.outputFormat,x="production"===process.env.NODE_ENV,v=!x,w=h||(u.findParent(function(e){return e.isTaggedTemplateExpression()})?"string":"object"),y=u.node.quasi.quasis[0].value.cooked.match(/[a-z0-9-_:]+/gi)||[];if("production"===process.env.NODE_ENV)d=require(m);else{var k=u.find(function(e){return e.isProgram()});f=k.scope.generateUidIdentifier("tailwind"),k.unshiftContainer("body",b.importDeclaration([b.importDefaultSpecifier(f)],b.stringLiteral(m)))}var S=y.reduce(function(o,n,u){var b,m=n.match(/^([a-z-_]+):/i);if(m&&(n=n.substr(m[0].length),m="hover"===m[1]||"focus"===m[1]?":"+m[1]:x?"@media (min-width: "+d.screens[m[1]]+")":"`@media (min-width: ${"+f.name+'.screens["'+m[1]+'"]})`'),e[n])return p(o,m?((l={})[m]=p(o[m]||{},e[n]),l):e[n]);if(Object.keys(t).some(function(e){if(n.startsWith(e+"-")||n===e)return b=e,!0}),b){var h,y=n.substr(b.length+1);if(""===y&&(y="default"),Array.isArray(t[b])){var k=t[b].map(function(e){var t=a(e,v),r=t.pre,o=t.post;if(!x||void 0!==d[e.config][y]){var n=e.format?e.format:function(e){return e};return x?((s={})[e.prop]=r||o?r+n(d[e.config][y])+o:n(d[e.config][y]),s):"string"===w?"['"+i(e.prop)+"', "+r+f.name+"."+e.config+'["'+y+'"]'+o+"]":"{"+e.prop+":"+r+f.name+"."+e.config+'["'+y+'"]'+o+"}"}});x?h=k.filter(function(e){return void 0!==e})[0]:"string"===w?(k="["+k.join(",")+"].filter(x => typeof x[1] !== 'undefined' && x[1] !== '')[0].join(':')",(h={})["__spread__"+u]=k):(k="["+k.join(",")+'].filter(x => typeof x[Object.keys(x)[0]] !== "undefined" && x[Object.keys(x)[0]] !== "")[0]',(h={})["__spread__"+u]=k)}else{h=Array.isArray(t[b].prop)?t[b].prop:[t[b].prop];var S=a(t[b],v),R=S.pre,j=S.post,W=t[b].format?t[b].format:function(e){return e};h=h.reduce(function(e,o){return r({},e,((g={})[o]=x?R+W(d[t[b].config][y])+j:"$"+R+f.name+"."+t[b].config+'["'+y+'"]'+j,g))},{})}return p(o,m?((c={})[m]=p(o[m]||{},h),c):h)}return o},{}),R=function e(t,r){if(null===t)return r.nullLiteral();switch(typeof t){case"function":var n=o.parse(t.toString(),{allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0});return traverse.removeProperties(n);case"number":return r.numericLiteral(t);case"string":return t.startsWith("$")?o.parseExpression(t.substr(1)):r.stringLiteral(t);case"boolean":return r.booleanLiteral(t);case"undefined":return r.unaryExpression("void",r.numericLiteral(0),!0);default:return Array.isArray(t)?r.arrayExpression(t.map(function(t){return e(t,r)})):r.objectExpression(Object.keys(t).filter(function(e){return void 0!==t[e]}).map(function(n){if(n.startsWith("__spread__"))return r.spreadProperty(o.parseExpression(t[n]));var i=n.startsWith("`"),a=i?o.parseExpression(n):r.stringLiteral(n);return r.objectProperty(a,e(t[n],r),i)}))}}(S,b);if("string"===w){var j="`"+function e(t){return Object.keys(t).reduce(function(r,o){var n=t[o];if(o.startsWith("__spread__"))return r+"${"+n+"};";if("string"==typeof n)return"$"===n[0]&&(n="${"+n.substr(1)+"}"),r+i(o)+":"+n+";";n=e(n);var a=":"===o[0]?"&"+o:o;return a="`"===a[0]?a.substr(1,a.length-2):a,r+i(a)+"{"+n+"};"},"")}(S)+"`";u.replaceWith(o.parseExpression(j))}else u.replaceWith(R)}function i(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase().replace(/^(ms|o|moz|webkit)-/,"-$1-")}function a(e,t){var r="",o="";return t&&e.preDev?r=e.preDev:e.pre&&(r=e.pre),t&&e.postDev?o=e.postDev:e.post&&(o=e.post),{pre:r,post:o}}function p(e,t){return Object.assign({},e,t)}require("babylon");var l=require("path");module.exports=function(e){var t=e.types;return{visitor:{TaggedTemplateExpression:function(e,r){"tw"===e.node.tag.name&&n({path:e,configPath:l.resolve(r.file.opts.sourceRoot||".",r.opts.config||"./tailwind.js"),t:t,outputFormat:r.opts.format})}}}}; | ||
var e={"bg-bottom":{backgroundPosition:"bottom"},"bg-center":{backgroundPosition:"center"},"bg-left":{backgroundPosition:"left"},"bg-left-bottom":{backgroundPosition:"left bottom"},"bg-left-top":{backgroundPosition:"left top"},"bg-right":{backgroundPosition:"right"},"bg-right-bottom":{backgroundPosition:"right bottom"},"bg-right-top":{backgroundPosition:"right-top"},"bg-top":{backgroundPosition:"top"},"bg-repeat":{backgroundRepeat:"repeat"},"bg-no-repeat":{backgroundRepeat:"no-repeat"},"bg-repeat-x":{backgroundRepeat:"repeat-x"},"bg-repeat-y":{backgroundRepeat:"repeat-y"},"bg-cover":{backgroundSize:"cover"},"bg-contain":{backgroundSize:"contain"},"bg-fixed":{backgroundAttachment:"fixed"},"bg-local":{backgroundAttachment:"local"},"bg-scroll":{backgroundAttachment:"scroll"},"border-solid":{borderStyle:"solid"},"border-dashed":{borderStyle:"dashed"},"border-dotted":{borderStyle:"dotted"},"border-none":{borderStyle:"none"},block:{display:"block"},"inline-block":{display:"inline-block"},inline:{display:"inline"},table:{display:"table"},"table-row":{display:"table-row"},"table-cell":{display:"table-cell"},hidden:{display:"none"},flex:{display:"flex"},"inline-flex":{display:"inline-flex"},"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"},"flex-no-wrap":{flexWrap:"nowrap"},"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"justify-start":{justifyContent:"flex-start"},"justify-center":{justifyContent:"center"},"justify-end":{justifyContent:"flex-end"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"items-stretch":{alignItems:"flex-stretch"},"items-start":{alignItems:"flex-start"},"items-center":{alignItems:"center"},"items-end":{alignItems:"flex-end"},"items-baseline":{alignItems:"baseline"},"content-start":{alignContent:"flex-start"},"content-center":{alignContent:"center"},"content-end":{alignContent:"flex-end"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-center":{alignSelf:"center"},"self-end":{alignSelf:"flex-end"},"self-stretch":{alignSelf:"stretch"},"flex-initial":{flex:"initial"},"flex-1":{flex:1},"flex-auto":{flex:"auto"},"flex-none":{flex:"none"},"flex-grow":{flexGrow:1},"flex-shrink":{flexShrink:1},"flex-no-grow":{flexGrow:0},"flex-no-shrink":{flexShrink:0},"float-right":{float:"right"},"float-left":{float:"left"},"float-none":{float:"none"},clearfix:{"::after":{content:'""',display:"table",clear:"both"}},"appearance-none":{appearance:"none"},"cursor-auto":{cursor:"auto"},"cursor-pointer":{cursor:"pointer"},"cursor-not-allowed":{cursor:"not-allowed"},"resize-none":{resize:"none"},resize:{resize:"both"},"resize-y":{resize:"vertical"},"resize-x":{resize:"horizontal"},"pointer-events-none":{pointerEvents:"none"},"pointer-events-auto":{pointerEvents:"auto"},"select-none":{userSelect:"none"},"select-text":{userSelect:"text"},"list-reset":{listStyle:"none",padding:0},"overflow-visible":{overflow:"visible"},"overflow-auto":{overflow:"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-x-scroll":{overflowX:"auto"},"overflow-y-scroll":{overflowY:"auto"},"overflow-scroll":{overflow:"scroll"},"scrolling-touch":{webkitOverflowScrolling:"touch"},"scrolling-auto":{webkitOverflowScrolling:"auto"},static:{position:"static"},fixed:{position:"fixed"},absolute:{position:"absolute"},relative:{position:"relative"},"pin-t":{top:0},"pin-r":{right:0},"pin-b":{bottom:0},"pin-l":{left:0},"pin-y":{top:0,bottom:0},"pin-x":{right:0,left:0},pin:{top:0,right:0,bottom:0,left:0},"pin-none":{top:"auto",right:"auto",bottom:"auto",left:"auto"},"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"},italic:{fontStyle:"italic"},roman:{fontStyle:"normal"},uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"},underline:{textDecoration:"underline"},"line-through":{textDecoration:"line-through"},"no-underline":{textDecoration:"none"},antialiased:{webkitFontSmoothing:"antialiased",mozOsxFontSmoothing:"grayscale"},"subpixel-antialiased":{webkitFontSmoothing:"auto",mozOsxFontSmoothing:"auto"},"whitespace-normal":{whiteSpace:"normal"},"whitespace-no-wrap":{whiteSpace:"nowrap"},"whitespace-pre":{whiteSpace:"pre"},"whitespace-pre-line":{whiteSpace:"pre-line"},"whitespace-pre-wrap":{whiteSpace:"pre-wrap"},"break-words":{wordWrap:"break-word"},"break-normal":{wordWrap:"normal"},truncate:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"align-baseline":{verticalAlign:"baseline"},"align-top":{verticalAlign:"top"},"align-middle":{verticalAlign:"middle"},"align-bottom":{verticalAlign:"bottom"},"align-text-top":{verticalAlign:"text-top"},"align-text-bottom":{verticalAlign:"text-bottom"},visible:{visibility:"visible"},invisible:{visibility:"hidden"}},o={bg:{prop:"backgroundColor",config:"backgroundColors"},"border-t":{prop:"borderTopWidth",config:"borderWidths"},"border-b":{prop:"borderBottomWidth",config:"borderWidths"},"border-l":{prop:"borderLeftWidth",config:"borderWidths"},"border-r":{prop:"borderRightWidth",config:"borderWidths"},border:[{prop:"borderColor",config:"borderColors"},{prop:"borderWidth",config:"borderWidths"}],"rounded-t":{prop:"borderTopRadius",config:"borderRadius"},"rounded-r":{prop:"borderRightRadius",config:"borderRadius"},"rounded-b":{prop:"borderBottomRadius",config:"borderRadius"},"rounded-l":{prop:"borderLeftRadius",config:"borderRadius"},"rounded-tl":{prop:"borderTopLeftRadius",config:"borderRadius"},"rounded-tr":{prop:"borderTopRightRadius",config:"borderRadius"},"rounded-br":{prop:"borderBottomRightRadius",config:"borderRadius"},"rounded-bl":{prop:"borderBottomLeftRadius",config:"borderRadius"},rounded:{prop:"borderRadius",config:"borderRadius"},opacity:{prop:"opacity",config:"opacity"},shadow:{prop:"boxShadow",config:"shadows"},w:{prop:"width",config:"width"},"min-w":{prop:"minWidth",config:"minWidth"},"max-w":{prop:"maxWidth",config:"maxWidth"},h:{prop:"height",config:"height"},"min-h":{prop:"minHeight",config:"minHeight"},"max-h":{prop:"maxHeight",config:"maxHeight"},pt:{prop:"paddingTop",config:"padding"},pr:{prop:"paddingRight",config:"padding"},pb:{prop:"paddingBottom",config:"padding"},pl:{prop:"paddingLeft",config:"padding"},px:{prop:["paddingLeft","paddingRight"],config:"padding"},py:{prop:["paddingTop","paddingBottom"],config:"padding"},p:{prop:"padding",config:"padding"},mt:{prop:"marginTop",config:"margin"},mr:{prop:"marginRight",config:"margin"},mb:{prop:"marginBottom",config:"margin"},ml:{prop:"marginLeft",config:"margin"},mx:{prop:["marginLeft","marginRight"],config:"margin"},my:{prop:["marginTop","marginBottom"],config:"margin"},m:{prop:"margin",config:"margin"},"-mt":{prop:"marginTop",config:"negativeMargin",pre:"-"},"-mr":{prop:"marginRight",config:"negativeMargin",pre:"-"},"-mb":{prop:"marginBottom",config:"negativeMargin",pre:"-"},"-ml":{prop:"marginLeft",config:"negativeMargin",pre:"-"},"-mx":{prop:["marginLeft","marginRight"],config:"negativeMargin",pre:"-"},"-my":{prop:["marginTop","marginBottom"],config:"negativeMargin",pre:"-"},"-m":{prop:"margin",config:"negativeMargin",pre:"-"},fill:{prop:"fill",config:"svgFill"},stroke:{prop:"stroke",config:"svgStroke"},font:[{prop:"fontWeight",config:"fontWeights"},{prop:"fontFamily",config:"fonts",preDev:"(",postDev:" || []).map(x => '\"' + x + '\"').join(', ')",format:function(e){return e.map(function(e){return'"'+e+'"'}).join(", ")}}],text:[{prop:"color",config:"textColors"},{prop:"fontSize",config:"textSizes"}],leading:{prop:"lineHeight",config:"leading"},tracking:{prop:"letterSpacing",config:"tracking"},z:{prop:"zIndex",config:"zIndex"}},t=Object.assign||function(e){for(var o=arguments,t=1;t<arguments.length;t++){var r=o[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r=require("babylon");require("path");function i(i){var p,l,s,g,c,d,f=i.path,u=i.t,b=i.configPath,m="production"===process.env.NODE_ENV,h=!m,x=f.node.quasi.quasis[0].value.cooked.match(/[a-z0-9-_:]+/gi)||[];if("production"===process.env.NODE_ENV)c=require(b);else{var v=f.find(function(e){return e.isProgram()});d=v.scope.generateUidIdentifier("tailwind"),v.unshiftContainer("body",u.importDeclaration([u.importDefaultSpecifier(d)],u.stringLiteral(b)))}var w=function e(o,t){if(null===o)return t.nullLiteral();switch(typeof o){case"function":var i=r.parse(o.toString(),{allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0});return traverse.removeProperties(i);case"number":return t.numericLiteral(o);case"string":return o.startsWith("$")?r.parseExpression(o.substr(1)):t.stringLiteral(o);case"boolean":return t.booleanLiteral(o);case"undefined":return t.unaryExpression("void",t.numericLiteral(0),!0);default:return Array.isArray(o)?t.arrayExpression(o.map(function(o){return e(o,t)})):t.objectExpression(Object.keys(o).filter(function(e){return void 0!==o[e]}).map(function(i){if(i.startsWith("__spread__"))return t.spreadProperty(r.parseExpression(o[i]));var n=i.startsWith("`"),a=n?r.parseExpression(i):t.stringLiteral(i);return t.objectProperty(a,e(o[i],t),n)}))}}(x.reduce(function(r,i,f){var u,b=i.match(/^([a-z-_]+):/i);if(b&&(i=i.substr(b[0].length),b="hover"===b[1]||"focus"===b[1]?":"+b[1]:m?"@media (min-width: "+c.screens[b[1]]+")":"`@media (min-width: ${"+d.name+'.screens["'+b[1]+'"]})`'),e[i])return a(r,b?((p={})[b]=a(r[b]||{},e[i]),p):e[i]);if(Object.keys(o).some(function(e){if(i.startsWith(e+"-")||i===e)return u=e,!0}),u){var x,v=i.substr(u.length+1);if(""===v&&(v="default"),Array.isArray(o[u])){var w=o[u].map(function(e){var o=n(e,h),t=o.pre,r=o.post;if(!m||void 0!==c[e.config][v]){var i=e.format?e.format:function(e){return e};return m?((l={})[e.prop]=t||r?t+i(c[e.config][v])+r:i(c[e.config][v]),l):"{"+e.prop+":"+t+d.name+"."+e.config+'["'+v+'"]'+r+"}"}});m?(x=w.filter(function(e){return void 0!==e})[0],console.log(x)):(w="["+w.join(",")+'].filter(x => typeof x[Object.keys(x)[0]] !== "undefined" && x[Object.keys(x)[0]] !== "")[0]',(x={})["__spread__"+f]=w)}else{x=Array.isArray(o[u].prop)?o[u].prop:[o[u].prop];var y=n(o[u],h),k=y.pre,S=y.post,R=o[u].format?o[u].format:function(e){return e};x=x.reduce(function(e,r){return t({},e,((s={})[r]=m?k+R(c[o[u].config][v])+S:"$"+k+d.name+"."+o[u].config+'["'+v+'"]'+S,s))},{})}return a(r,b?((g={})[b]=a(r[b]||{},x),g):x)}return r},{}),u);f.replaceWith(w)}function n(e,o){var t="",r="";return o&&e.preDev?t=e.preDev:e.pre&&(t=e.pre),o&&e.postDev?r=e.postDev:e.post&&(r=e.post),{pre:t,post:r}}function a(e,o){return Object.assign({},e,o)}require("babylon");var p=require("path");module.exports=function(e){var o=e.types;return{visitor:{TaggedTemplateExpression:function(e,t){"tw"===e.node.tag.name&&i({path:e,configPath:p.resolve(t.file.opts.sourceRoot||".",t.opts.config||"./tailwind.js"),t:o})}}}}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
var e={"bg-bottom":{backgroundPosition:"bottom"},"bg-center":{backgroundPosition:"center"},"bg-left":{backgroundPosition:"left"},"bg-left-bottom":{backgroundPosition:"left bottom"},"bg-left-top":{backgroundPosition:"left top"},"bg-right":{backgroundPosition:"right"},"bg-right-bottom":{backgroundPosition:"right bottom"},"bg-right-top":{backgroundPosition:"right-top"},"bg-top":{backgroundPosition:"top"},"bg-repeat":{backgroundRepeat:"repeat"},"bg-no-repeat":{backgroundRepeat:"no-repeat"},"bg-repeat-x":{backgroundRepeat:"repeat-x"},"bg-repeat-y":{backgroundRepeat:"repeat-y"},"bg-cover":{backgroundSize:"cover"},"bg-contain":{backgroundSize:"contain"},"bg-fixed":{backgroundAttachment:"fixed"},"bg-local":{backgroundAttachment:"local"},"bg-scroll":{backgroundAttachment:"scroll"},"border-solid":{borderStyle:"solid"},"border-dashed":{borderStyle:"dashed"},"border-dotted":{borderStyle:"dotted"},"border-none":{borderStyle:"none"},block:{display:"block"},"inline-block":{display:"inline-block"},inline:{display:"inline"},table:{display:"table"},"table-row":{display:"table-row"},"table-cell":{display:"table-cell"},hidden:{display:"none"},flex:{display:"flex"},"inline-flex":{display:"inline-flex"},"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"},"flex-no-wrap":{flexWrap:"nowrap"},"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"justify-start":{justifyContent:"flex-start"},"justify-center":{justifyContent:"center"},"justify-end":{justifyContent:"flex-end"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"items-stretch":{alignItems:"flex-stretch"},"items-start":{alignItems:"flex-start"},"items-center":{alignItems:"center"},"items-end":{alignItems:"flex-end"},"items-baseline":{alignItems:"baseline"},"content-start":{alignContent:"flex-start"},"content-center":{alignContent:"center"},"content-end":{alignContent:"flex-end"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-center":{alignSelf:"center"},"self-end":{alignSelf:"flex-end"},"self-stretch":{alignSelf:"stretch"},"flex-initial":{flex:"initial"},"flex-1":{flex:1},"flex-auto":{flex:"auto"},"flex-none":{flex:"none"},"flex-grow":{flexGrow:1},"flex-shrink":{flexShrink:1},"flex-no-grow":{flexGrow:0},"flex-no-shrink":{flexShrink:0},"float-right":{float:"right"},"float-left":{float:"left"},"float-none":{float:"none"},clearfix:{"::after":{content:'""',display:"table",clear:"both"}},"appearance-none":{appearance:"none"},"cursor-auto":{cursor:"auto"},"cursor-pointer":{cursor:"pointer"},"cursor-not-allowed":{cursor:"not-allowed"},"resize-none":{resize:"none"},resize:{resize:"both"},"resize-y":{resize:"vertical"},"resize-x":{resize:"horizontal"},"pointer-events-none":{pointerEvents:"none"},"pointer-events-auto":{pointerEvents:"auto"},"select-none":{userSelect:"none"},"select-text":{userSelect:"text"},"list-reset":{listStyle:"none",padding:0},"overflow-visible":{overflow:"visible"},"overflow-auto":{overflow:"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-x-scroll":{overflowX:"auto"},"overflow-y-scroll":{overflowY:"auto"},"overflow-scroll":{overflow:"scroll"},"scrolling-touch":{webkitOverflowScrolling:"touch"},"scrolling-auto":{webkitOverflowScrolling:"auto"},static:{position:"static"},fixed:{position:"fixed"},absolute:{position:"absolute"},relative:{position:"relative"},"pin-t":{top:0},"pin-r":{right:0},"pin-b":{bottom:0},"pin-l":{left:0},"pin-y":{top:0,bottom:0},"pin-x":{right:0,left:0},pin:{top:0,right:0,bottom:0,left:0},"pin-none":{top:"auto",right:"auto",bottom:"auto",left:"auto"},"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"},italic:{fontStyle:"italic"},roman:{fontStyle:"normal"},uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"},underline:{textDecoration:"underline"},"line-through":{textDecoration:"line-through"},"no-underline":{textDecoration:"none"},antialiased:{webkitFontSmoothing:"antialiased",mozOsxFontSmoothing:"grayscale"},"subpixel-antialiased":{webkitFontSmoothing:"auto",mozOsxFontSmoothing:"auto"},"whitespace-normal":{whiteSpace:"normal"},"whitespace-no-wrap":{whiteSpace:"nowrap"},"whitespace-pre":{whiteSpace:"pre"},"whitespace-pre-line":{whiteSpace:"pre-line"},"whitespace-pre-wrap":{whiteSpace:"pre-wrap"},"break-words":{wordWrap:"break-word"},"break-normal":{wordWrap:"normal"},truncate:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"align-baseline":{verticalAlign:"baseline"},"align-top":{verticalAlign:"top"},"align-middle":{verticalAlign:"middle"},"align-bottom":{verticalAlign:"bottom"},"align-text-top":{verticalAlign:"text-top"},"align-text-bottom":{verticalAlign:"text-bottom"},visible:{visibility:"visible"},invisible:{visibility:"hidden"}},r={bg:{prop:"backgroundColor",config:"backgroundColors"},"border-t":{prop:"borderTopWidth",config:"borderWidths"},"border-b":{prop:"borderBottomWidth",config:"borderWidths"},"border-l":{prop:"borderLeftWidth",config:"borderWidths"},"border-r":{prop:"borderRightWidth",config:"borderWidths"},border:[{prop:"borderColor",config:"borderColors"},{prop:"borderWidth",config:"borderWidths"}],"rounded-t":{prop:"borderTopRadius",config:"borderRadius"},"rounded-r":{prop:"borderRightRadius",config:"borderRadius"},"rounded-b":{prop:"borderBottomRadius",config:"borderRadius"},"rounded-l":{prop:"borderLeftRadius",config:"borderRadius"},"rounded-tl":{prop:"borderTopLeftRadius",config:"borderRadius"},"rounded-tr":{prop:"borderTopRightRadius",config:"borderRadius"},"rounded-br":{prop:"borderBottomRightRadius",config:"borderRadius"},"rounded-bl":{prop:"borderBottomLeftRadius",config:"borderRadius"},rounded:{prop:"borderRadius",config:"borderRadius"},opacity:{prop:"opacity",config:"opacity"},shadow:{prop:"boxShadow",config:"shadows"},w:{prop:"width",config:"width"},"min-w":{prop:"minWidth",config:"minWidth"},"max-w":{prop:"maxWidth",config:"maxWidth"},h:{prop:"height",config:"height"},"min-h":{prop:"minHeight",config:"minHeight"},"max-h":{prop:"maxHeight",config:"maxHeight"},pt:{prop:"paddingTop",config:"padding"},pr:{prop:"paddingRight",config:"padding"},pb:{prop:"paddingBottom",config:"padding"},pl:{prop:"paddingLeft",config:"padding"},px:{prop:["paddingLeft","paddingRight"],config:"padding"},py:{prop:["paddingTop","paddingBottom"],config:"padding"},p:{prop:"padding",config:"padding"},mt:{prop:"marginTop",config:"margin"},mr:{prop:"marginRight",config:"margin"},mb:{prop:"marginBottom",config:"margin"},ml:{prop:"marginLeft",config:"margin"},mx:{prop:["marginLeft","marginRight"],config:"margin"},my:{prop:["marginTop","marginBottom"],config:"margin"},m:{prop:"margin",config:"margin"},"-mt":{prop:"marginTop",config:"negativeMargin",pre:"-"},"-mr":{prop:"marginRight",config:"negativeMargin",pre:"-"},"-mb":{prop:"marginBottom",config:"negativeMargin",pre:"-"},"-ml":{prop:"marginLeft",config:"negativeMargin",pre:"-"},"-mx":{prop:["marginLeft","marginRight"],config:"negativeMargin",pre:"-"},"-my":{prop:["marginTop","marginBottom"],config:"negativeMargin",pre:"-"},"-m":{prop:"margin",config:"negativeMargin",pre:"-"},fill:{prop:"fill",config:"svgFill"},stroke:{prop:"stroke",config:"svgStroke"},font:[{prop:"fontWeight",config:"fontWeights"},{prop:"fontFamily",config:"fonts",preDev:"(",postDev:" || []).map(x => '\"' + x + '\"').join(', ')",format:function(e){return e.map(function(e){return'"'+e+'"'}).join(", ")}}],text:[{prop:"color",config:"textColors"},{prop:"fontSize",config:"textSizes"}],leading:{prop:"lineHeight",config:"leading"},tracking:{prop:"letterSpacing",config:"tracking"},z:{prop:"zIndex",config:"zIndex"}},t=Object.assign||function(e){for(var r=arguments,t=1;t<arguments.length;t++){var o=r[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},o=require("babylon");require("path");function i(i){var l,s,c,g,f,d,u=i.path,b=i.t,m=i.configPath,h=i.outputFormat,x="production"===process.env.NODE_ENV,v=!x,w=h||(u.findParent(function(e){return e.isTaggedTemplateExpression()})?"string":"object"),y=u.node.quasi.quasis[0].value.cooked.match(/[a-z0-9-_:]+/gi)||[];if("production"===process.env.NODE_ENV)f=require(m);else{var k=u.find(function(e){return e.isProgram()});d=k.scope.generateUidIdentifier("tailwind"),k.unshiftContainer("body",b.importDeclaration([b.importDefaultSpecifier(d)],b.stringLiteral(m)))}var S=y.reduce(function(o,i,u){var b,m=i.match(/^([a-z-_]+):/i);if(m&&(i=i.substr(m[0].length),m="hover"===m[1]||"focus"===m[1]?":"+m[1]:x?"@media (min-width: "+f.screens[m[1]]+")":"`@media (min-width: ${"+d.name+'.screens["'+m[1]+'"]})`'),e[i])return p(o,m?((l={})[m]=p(o[m]||{},e[i]),l):e[i]);if(Object.keys(r).some(function(e){if(i.startsWith(e+"-")||i===e)return b=e,!0}),b){var h,y=i.substr(b.length+1);if(""===y&&(y="default"),Array.isArray(r[b])){var k=r[b].map(function(e){var r=a(e,v),t=r.pre,o=r.post;if(!x||void 0!==f[e.config][y]){var i=e.format?e.format:function(e){return e};return x?((s={})[e.prop]=t||o?t+i(f[e.config][y])+o:i(f[e.config][y]),s):"string"===w?"['"+n(e.prop)+"', "+t+d.name+"."+e.config+'["'+y+'"]'+o+"]":"{"+e.prop+":"+t+d.name+"."+e.config+'["'+y+'"]'+o+"}"}});x?h=k.filter(function(e){return void 0!==e})[0]:"string"===w?(k="["+k.join(",")+"].filter(x => typeof x[1] !== 'undefined' && x[1] !== '')[0].join(':')",(h={})["__spread__"+u]=k):(k="["+k.join(",")+'].filter(x => typeof x[Object.keys(x)[0]] !== "undefined" && x[Object.keys(x)[0]] !== "")[0]',(h={})["__spread__"+u]=k)}else{h=Array.isArray(r[b].prop)?r[b].prop:[r[b].prop];var S=a(r[b],v),R=S.pre,j=S.post,W=r[b].format?r[b].format:function(e){return e};h=h.reduce(function(e,o){return t({},e,((c={})[o]=x?R+W(f[r[b].config][y])+j:"$"+R+d.name+"."+r[b].config+'["'+y+'"]'+j,c))},{})}return p(o,m?((g={})[m]=p(o[m]||{},h),g):h)}return o},{}),R=function e(r,t){if(null===r)return t.nullLiteral();switch(typeof r){case"function":var i=o.parse(r.toString(),{allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0});return traverse.removeProperties(i);case"number":return t.numericLiteral(r);case"string":return r.startsWith("$")?o.parseExpression(r.substr(1)):t.stringLiteral(r);case"boolean":return t.booleanLiteral(r);case"undefined":return t.unaryExpression("void",t.numericLiteral(0),!0);default:return Array.isArray(r)?t.arrayExpression(r.map(function(r){return e(r,t)})):t.objectExpression(Object.keys(r).filter(function(e){return void 0!==r[e]}).map(function(i){if(i.startsWith("__spread__"))return t.spreadProperty(o.parseExpression(r[i]));var n=i.startsWith("`"),a=n?o.parseExpression(i):t.stringLiteral(i);return t.objectProperty(a,e(r[i],t),n)}))}}(S,b);if("string"===w){var j="`"+function e(r){return Object.keys(r).reduce(function(t,o){var i=r[o];if(o.startsWith("__spread__"))return t+"${"+i+"};";if("string"==typeof i)return"$"===i[0]&&(i="${"+i.substr(1)+"}"),t+n(o)+":"+i+";";i=e(i);var a=":"===o[0]?"&"+o:o;return a="`"===a[0]?a.substr(1,a.length-2):a,t+n(a)+"{"+i+"};"},"")}(S)+"`";u.replaceWith(o.parseExpression(j))}else u.replaceWith(R)}function n(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase().replace(/^(ms|o|moz|webkit)-/,"-$1-")}function a(e,r){var t="",o="";return r&&e.preDev?t=e.preDev:e.pre&&(t=e.pre),r&&e.postDev?o=e.postDev:e.post&&(o=e.post),{pre:t,post:o}}function p(e,r){return Object.assign({},e,r)}var l=require("babel-plugin-macros").createMacro,s=require("path"),c=l(function(e){var r=e.babel.types,t=e.references,o=e.config,n=s.resolve(e.state.file.opts.sourceRoot||".",o&&o.config||"./tailwind.js");t.default.forEach(function(e){i({path:e.parentPath,t:r,configPath:n,outputFormat:o&&o.format})})},{configName:"tailwind"});module.exports=c; | ||
var e={"bg-bottom":{backgroundPosition:"bottom"},"bg-center":{backgroundPosition:"center"},"bg-left":{backgroundPosition:"left"},"bg-left-bottom":{backgroundPosition:"left bottom"},"bg-left-top":{backgroundPosition:"left top"},"bg-right":{backgroundPosition:"right"},"bg-right-bottom":{backgroundPosition:"right bottom"},"bg-right-top":{backgroundPosition:"right-top"},"bg-top":{backgroundPosition:"top"},"bg-repeat":{backgroundRepeat:"repeat"},"bg-no-repeat":{backgroundRepeat:"no-repeat"},"bg-repeat-x":{backgroundRepeat:"repeat-x"},"bg-repeat-y":{backgroundRepeat:"repeat-y"},"bg-cover":{backgroundSize:"cover"},"bg-contain":{backgroundSize:"contain"},"bg-fixed":{backgroundAttachment:"fixed"},"bg-local":{backgroundAttachment:"local"},"bg-scroll":{backgroundAttachment:"scroll"},"border-solid":{borderStyle:"solid"},"border-dashed":{borderStyle:"dashed"},"border-dotted":{borderStyle:"dotted"},"border-none":{borderStyle:"none"},block:{display:"block"},"inline-block":{display:"inline-block"},inline:{display:"inline"},table:{display:"table"},"table-row":{display:"table-row"},"table-cell":{display:"table-cell"},hidden:{display:"none"},flex:{display:"flex"},"inline-flex":{display:"inline-flex"},"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"},"flex-no-wrap":{flexWrap:"nowrap"},"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"justify-start":{justifyContent:"flex-start"},"justify-center":{justifyContent:"center"},"justify-end":{justifyContent:"flex-end"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"items-stretch":{alignItems:"flex-stretch"},"items-start":{alignItems:"flex-start"},"items-center":{alignItems:"center"},"items-end":{alignItems:"flex-end"},"items-baseline":{alignItems:"baseline"},"content-start":{alignContent:"flex-start"},"content-center":{alignContent:"center"},"content-end":{alignContent:"flex-end"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-center":{alignSelf:"center"},"self-end":{alignSelf:"flex-end"},"self-stretch":{alignSelf:"stretch"},"flex-initial":{flex:"initial"},"flex-1":{flex:1},"flex-auto":{flex:"auto"},"flex-none":{flex:"none"},"flex-grow":{flexGrow:1},"flex-shrink":{flexShrink:1},"flex-no-grow":{flexGrow:0},"flex-no-shrink":{flexShrink:0},"float-right":{float:"right"},"float-left":{float:"left"},"float-none":{float:"none"},clearfix:{"::after":{content:'""',display:"table",clear:"both"}},"appearance-none":{appearance:"none"},"cursor-auto":{cursor:"auto"},"cursor-pointer":{cursor:"pointer"},"cursor-not-allowed":{cursor:"not-allowed"},"resize-none":{resize:"none"},resize:{resize:"both"},"resize-y":{resize:"vertical"},"resize-x":{resize:"horizontal"},"pointer-events-none":{pointerEvents:"none"},"pointer-events-auto":{pointerEvents:"auto"},"select-none":{userSelect:"none"},"select-text":{userSelect:"text"},"list-reset":{listStyle:"none",padding:0},"overflow-visible":{overflow:"visible"},"overflow-auto":{overflow:"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-x-scroll":{overflowX:"auto"},"overflow-y-scroll":{overflowY:"auto"},"overflow-scroll":{overflow:"scroll"},"scrolling-touch":{webkitOverflowScrolling:"touch"},"scrolling-auto":{webkitOverflowScrolling:"auto"},static:{position:"static"},fixed:{position:"fixed"},absolute:{position:"absolute"},relative:{position:"relative"},"pin-t":{top:0},"pin-r":{right:0},"pin-b":{bottom:0},"pin-l":{left:0},"pin-y":{top:0,bottom:0},"pin-x":{right:0,left:0},pin:{top:0,right:0,bottom:0,left:0},"pin-none":{top:"auto",right:"auto",bottom:"auto",left:"auto"},"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"},italic:{fontStyle:"italic"},roman:{fontStyle:"normal"},uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"},underline:{textDecoration:"underline"},"line-through":{textDecoration:"line-through"},"no-underline":{textDecoration:"none"},antialiased:{webkitFontSmoothing:"antialiased",mozOsxFontSmoothing:"grayscale"},"subpixel-antialiased":{webkitFontSmoothing:"auto",mozOsxFontSmoothing:"auto"},"whitespace-normal":{whiteSpace:"normal"},"whitespace-no-wrap":{whiteSpace:"nowrap"},"whitespace-pre":{whiteSpace:"pre"},"whitespace-pre-line":{whiteSpace:"pre-line"},"whitespace-pre-wrap":{whiteSpace:"pre-wrap"},"break-words":{wordWrap:"break-word"},"break-normal":{wordWrap:"normal"},truncate:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"align-baseline":{verticalAlign:"baseline"},"align-top":{verticalAlign:"top"},"align-middle":{verticalAlign:"middle"},"align-bottom":{verticalAlign:"bottom"},"align-text-top":{verticalAlign:"text-top"},"align-text-bottom":{verticalAlign:"text-bottom"},visible:{visibility:"visible"},invisible:{visibility:"hidden"}},o={bg:{prop:"backgroundColor",config:"backgroundColors"},"border-t":{prop:"borderTopWidth",config:"borderWidths"},"border-b":{prop:"borderBottomWidth",config:"borderWidths"},"border-l":{prop:"borderLeftWidth",config:"borderWidths"},"border-r":{prop:"borderRightWidth",config:"borderWidths"},border:[{prop:"borderColor",config:"borderColors"},{prop:"borderWidth",config:"borderWidths"}],"rounded-t":{prop:"borderTopRadius",config:"borderRadius"},"rounded-r":{prop:"borderRightRadius",config:"borderRadius"},"rounded-b":{prop:"borderBottomRadius",config:"borderRadius"},"rounded-l":{prop:"borderLeftRadius",config:"borderRadius"},"rounded-tl":{prop:"borderTopLeftRadius",config:"borderRadius"},"rounded-tr":{prop:"borderTopRightRadius",config:"borderRadius"},"rounded-br":{prop:"borderBottomRightRadius",config:"borderRadius"},"rounded-bl":{prop:"borderBottomLeftRadius",config:"borderRadius"},rounded:{prop:"borderRadius",config:"borderRadius"},opacity:{prop:"opacity",config:"opacity"},shadow:{prop:"boxShadow",config:"shadows"},w:{prop:"width",config:"width"},"min-w":{prop:"minWidth",config:"minWidth"},"max-w":{prop:"maxWidth",config:"maxWidth"},h:{prop:"height",config:"height"},"min-h":{prop:"minHeight",config:"minHeight"},"max-h":{prop:"maxHeight",config:"maxHeight"},pt:{prop:"paddingTop",config:"padding"},pr:{prop:"paddingRight",config:"padding"},pb:{prop:"paddingBottom",config:"padding"},pl:{prop:"paddingLeft",config:"padding"},px:{prop:["paddingLeft","paddingRight"],config:"padding"},py:{prop:["paddingTop","paddingBottom"],config:"padding"},p:{prop:"padding",config:"padding"},mt:{prop:"marginTop",config:"margin"},mr:{prop:"marginRight",config:"margin"},mb:{prop:"marginBottom",config:"margin"},ml:{prop:"marginLeft",config:"margin"},mx:{prop:["marginLeft","marginRight"],config:"margin"},my:{prop:["marginTop","marginBottom"],config:"margin"},m:{prop:"margin",config:"margin"},"-mt":{prop:"marginTop",config:"negativeMargin",pre:"-"},"-mr":{prop:"marginRight",config:"negativeMargin",pre:"-"},"-mb":{prop:"marginBottom",config:"negativeMargin",pre:"-"},"-ml":{prop:"marginLeft",config:"negativeMargin",pre:"-"},"-mx":{prop:["marginLeft","marginRight"],config:"negativeMargin",pre:"-"},"-my":{prop:["marginTop","marginBottom"],config:"negativeMargin",pre:"-"},"-m":{prop:"margin",config:"negativeMargin",pre:"-"},fill:{prop:"fill",config:"svgFill"},stroke:{prop:"stroke",config:"svgStroke"},font:[{prop:"fontWeight",config:"fontWeights"},{prop:"fontFamily",config:"fonts",preDev:"(",postDev:" || []).map(x => '\"' + x + '\"').join(', ')",format:function(e){return e.map(function(e){return'"'+e+'"'}).join(", ")}}],text:[{prop:"color",config:"textColors"},{prop:"fontSize",config:"textSizes"}],leading:{prop:"lineHeight",config:"leading"},tracking:{prop:"letterSpacing",config:"tracking"},z:{prop:"zIndex",config:"zIndex"}},r=Object.assign||function(e){for(var o=arguments,r=1;r<arguments.length;r++){var t=o[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},t=require("babylon");require("path");function i(i){var p,l,s,c,g,d,f=i.path,u=i.t,b=i.configPath,m="production"===process.env.NODE_ENV,h=!m,x=f.node.quasi.quasis[0].value.cooked.match(/[a-z0-9-_:]+/gi)||[];if("production"===process.env.NODE_ENV)g=require(b);else{var v=f.find(function(e){return e.isProgram()});d=v.scope.generateUidIdentifier("tailwind"),v.unshiftContainer("body",u.importDeclaration([u.importDefaultSpecifier(d)],u.stringLiteral(b)))}var w=function e(o,r){if(null===o)return r.nullLiteral();switch(typeof o){case"function":var i=t.parse(o.toString(),{allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0});return traverse.removeProperties(i);case"number":return r.numericLiteral(o);case"string":return o.startsWith("$")?t.parseExpression(o.substr(1)):r.stringLiteral(o);case"boolean":return r.booleanLiteral(o);case"undefined":return r.unaryExpression("void",r.numericLiteral(0),!0);default:return Array.isArray(o)?r.arrayExpression(o.map(function(o){return e(o,r)})):r.objectExpression(Object.keys(o).filter(function(e){return void 0!==o[e]}).map(function(i){if(i.startsWith("__spread__"))return r.spreadProperty(t.parseExpression(o[i]));var n=i.startsWith("`"),a=n?t.parseExpression(i):r.stringLiteral(i);return r.objectProperty(a,e(o[i],r),n)}))}}(x.reduce(function(t,i,f){var u,b=i.match(/^([a-z-_]+):/i);if(b&&(i=i.substr(b[0].length),b="hover"===b[1]||"focus"===b[1]?":"+b[1]:m?"@media (min-width: "+g.screens[b[1]]+")":"`@media (min-width: ${"+d.name+'.screens["'+b[1]+'"]})`'),e[i])return a(t,b?((p={})[b]=a(t[b]||{},e[i]),p):e[i]);if(Object.keys(o).some(function(e){if(i.startsWith(e+"-")||i===e)return u=e,!0}),u){var x,v=i.substr(u.length+1);if(""===v&&(v="default"),Array.isArray(o[u])){var w=o[u].map(function(e){var o=n(e,h),r=o.pre,t=o.post;if(!m||void 0!==g[e.config][v]){var i=e.format?e.format:function(e){return e};return m?((l={})[e.prop]=r||t?r+i(g[e.config][v])+t:i(g[e.config][v]),l):"{"+e.prop+":"+r+d.name+"."+e.config+'["'+v+'"]'+t+"}"}});m?(x=w.filter(function(e){return void 0!==e})[0],console.log(x)):(w="["+w.join(",")+'].filter(x => typeof x[Object.keys(x)[0]] !== "undefined" && x[Object.keys(x)[0]] !== "")[0]',(x={})["__spread__"+f]=w)}else{x=Array.isArray(o[u].prop)?o[u].prop:[o[u].prop];var y=n(o[u],h),k=y.pre,S=y.post,R=o[u].format?o[u].format:function(e){return e};x=x.reduce(function(e,t){return r({},e,((s={})[t]=m?k+R(g[o[u].config][v])+S:"$"+k+d.name+"."+o[u].config+'["'+v+'"]'+S,s))},{})}return a(t,b?((c={})[b]=a(t[b]||{},x),c):x)}return t},{}),u);f.replaceWith(w)}function n(e,o){var r="",t="";return o&&e.preDev?r=e.preDev:e.pre&&(r=e.pre),o&&e.postDev?t=e.postDev:e.post&&(t=e.post),{pre:r,post:t}}function a(e,o){return Object.assign({},e,o)}var p=require("babel-plugin-macros").createMacro,l=require("path"),s=p(function(e){var o=e.babel.types,r=e.references,t=e.config,n=l.resolve(e.state.file.opts.sourceRoot||".",t&&t.config||"./tailwind.js");r.default.forEach(function(e){i({path:e.parentPath,t:o,configPath:n})})},{configName:"tailwind"});module.exports=s; | ||
//# sourceMappingURL=macro.js.map |
{ | ||
"name": "babel-plugin-tailwind-components", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Use Tailwind with any CSS-in-JS library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -65,3 +65,3 @@ # babel-plugin-tailwind-components [![npm](https://img.shields.io/npm/v/babel-plugin-tailwind-components.svg)](https://www.npmjs.com/package/babel-plugin-tailwind-components) [![Babel Macro](https://img.shields.io/badge/babel--macro-%F0%9F%8E%A3-f5da55.svg?style=flat)](https://github.com/kentcdodds/babel-plugin-macros) | ||
The babel plugin transforms the tagged template literal into either a style object or template literal, depending on context. If you use the tag inside a template literal, the output will be a template literal, like in the styled-components example above. | ||
The babel plugin transforms the tagged template literal into a style object: | ||
@@ -71,4 +71,3 @@ **In** | ||
```js | ||
const foo = tw`bg-cover` | ||
const bar = `${tw`bg-cover`}` | ||
const foo = tw`text-red hover:text-green sm:text-blue` | ||
``` | ||
@@ -80,9 +79,12 @@ | ||
const foo = { | ||
backgroundSize: 'cover' | ||
color: '#e3342f', | ||
':hover': { | ||
color: '#38c172' | ||
}, | ||
'@media (min-width: 576px)': { | ||
color: '#3490dc' | ||
} | ||
} | ||
const bar = ${`background-size:cover;`} | ||
``` | ||
You can enforce a particular format globally by setting the `format` option... | ||
## Options | ||
@@ -92,4 +94,2 @@ | ||
`format`: the format of the resulting styles (`object` or `string`). By default it will be an object except when inside a template literal. | ||
```js | ||
@@ -99,4 +99,3 @@ // babel-plugin-macros.config.js | ||
tailwind: { | ||
config: './tailwind.config.js', | ||
format: 'object' | ||
config: './tailwind.js' | ||
} | ||
@@ -110,4 +109,3 @@ } | ||
"tailwind-components", { | ||
"config": "./tailwind.config.js", | ||
"format": "object" | ||
"config": "./tailwind.js" | ||
} | ||
@@ -168,3 +166,3 @@ ] | ||
* support for the [container class](https://tailwindcss.com/docs/container); [in progress](https://github.com/bradlc/babel-plugin-tailwind-components/pull/2) | ||
* support for defaults; for example `rounded` should be an alias for `rounded-default` | ||
* ~~support for defaults; for example `rounded` should be an alias for `rounded-default`~~ | ||
* add [CodeSandbox](https://codesandbox.io/) demos |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
59988
90
162