Socket
Socket
Sign inDemoInstall

babel-plugin-tailwind-components

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-tailwind-components - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

2

dist/index.js

@@ -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"}},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})}}}};
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 n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},o=require("babylon"),n=require("babel-generator").default;require("path");function i(i){var s,d,c,g,f=i.path,u=i.t,b=i.configPath,m="production"===process.env.NODE_ENV,h=!m,x=i.outputFormat;if(!x||"auto"===x){var v=f.findParent(function(e){return e.isJSXElement()});x=v&&"style"===v.node.openingElement.name.name?"string":"object"}var w,y,k=f.node.quasi.quasis[0].value.cooked.match(/[a-z0-9-_:]+/gi)||[];if("production"===process.env.NODE_ENV)w=require(b);else{var S=f.find(function(e){return e.isProgram()});y=S.scope.generateUidIdentifier("tailwind"),S.unshiftContainer("body",u.importDeclaration([u.importDefaultSpecifier(y)],u.stringLiteral(b)))}var R=k.reduce(function(o,n,i){var f,u=n.match(/^([a-z-_]+):/i);if(u&&(n=n.substr(u[0].length),u="hover"===u[1]||"focus"===u[1]?":"+u[1]:m?"@media (min-width: "+w.screens[u[1]]+")":"`@media (min-width: ${"+y.name+'.screens["'+u[1]+'"]})`'),e[n])return l(o,u?((s={})[u]=l(o[u]||{},e[n]),s):e[n]);if(Object.keys(r).some(function(e){if(n.startsWith(e+"-")||n===e)return f=e,!0}),f){var b,v=n.substr(f.length+1);if(""===v&&(v="default"),Array.isArray(r[f])){var k=r[f].map(function(e){var r=p(e,h),t=r.pre,o=r.post;if(!m||void 0!==w[e.config][v]){var n=e.format?e.format:function(e){return e};return m?((d={})[e.prop]=t||o?t+n(w[e.config][v])+o:n(w[e.config][v]),d):"string"===x?"['"+a(e.prop)+"', "+t+y.name+"."+e.config+'["'+v+'"]'+o+"]":"{"+e.prop+":"+t+y.name+"."+e.config+'["'+v+'"]'+o+"}"}});m?b=k.filter(function(e){return void 0!==e})[0]:"string"===x?(k="["+k.join(",")+"].filter(x => typeof x[1] !== 'undefined' && x[1] !== '')[0].join(':')",(b={})["__spread__"+i]=k):(k="["+k.join(",")+'].filter(x => typeof x[Object.keys(x)[0]] !== "undefined" && x[Object.keys(x)[0]] !== "")[0]',(b={})["__spread__"+i]=k)}else{b=Array.isArray(r[f].prop)?r[f].prop:[r[f].prop];var S=p(r[f],h),R=S.pre,j=S.post,W=r[f].format?r[f].format:function(e){return e};b=b.reduce(function(e,o){return t({},e,((c={})[o]=m?R+W(w[r[f].config][v])+j:"$"+R+y.name+"."+r[f].config+'["'+v+'"]'+j,c))},{})}return l(o,u?((g={})[u]=l(o[u]||{},b),g):b)}return o},{}),j=function e(r,t){if(null===r)return t.nullLiteral();switch(typeof r){case"function":var n=o.parse(r.toString(),{allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0});return traverse.removeProperties(n);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(n){if(n.startsWith("__spread__"))return t.spreadProperty(o.parseExpression(r[n]));var i=n.startsWith("`"),a=i?o.parseExpression(n):t.stringLiteral(n);return t.objectProperty(a,e(r[n],t),i)}))}}(R,u);if("string"===x){var W=function e(r,t){void 0===t&&(t=!1);var o=t?"/**/":"";return Object.keys(r).reduce(function(t,n){var i=r[n];if(n.startsWith("__spread__"))return t+"${"+i+"};"+o;if("string"==typeof i)return"$"===i[0]&&(i="${"+i.substr(1)+"}"),t+a(n)+":"+i+";"+o;i=e(i);var p=":"===n[0]?"&"+n:n;return p="`"===p[0]?p.substr(1,p.length-2):p,t+a(p)+"{"+i+"};"+o},"")}(R,h),z=f.parentPath;if(z.isTemplateLiteral()){var A=z.get("expressions").indexOf(f),_=z.get("quasis")[A],L=z.get("quasis")[A+1];L.node.value.raw=_.node.value.raw+W+L.node.value.raw,L.node.value.cooked=_.node.value.cooked+W+L.node.value.cooked,_.remove(),f.remove();var O=o.parseExpression(n(z.node).code);z.replaceWith(O)}else{f.replaceWith(o.parseExpression("`"+W+"`"))}}else f.replaceWith(j)}function a(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase().replace(/^(ms|o|moz|webkit)-/,"-$1-")}function p(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 l(e,r){return Object.assign({},e,r)}require("babylon");var s=require("path");module.exports=function(e){var r=e.types;return{visitor:{TaggedTemplateExpression:function(e,t){"tw"===e.node.tag.name&&i({path:e,configPath:s.resolve(t.file.opts.sourceRoot||".",t.opts.config||"./tailwind.js"),t:r,outputFormat:t.opts.format})}}}};
//# 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"}},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;
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 n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},o=require("babylon"),n=require("babel-generator").default;require("path");function i(i){var s,c,d,g,f=i.path,u=i.t,b=i.configPath,m="production"===process.env.NODE_ENV,h=!m,x=i.outputFormat;if(!x||"auto"===x){var v=f.findParent(function(e){return e.isJSXElement()});x=v&&"style"===v.node.openingElement.name.name?"string":"object"}var w,y,k=f.node.quasi.quasis[0].value.cooked.match(/[a-z0-9-_:]+/gi)||[];if("production"===process.env.NODE_ENV)w=require(b);else{var S=f.find(function(e){return e.isProgram()});y=S.scope.generateUidIdentifier("tailwind"),S.unshiftContainer("body",u.importDeclaration([u.importDefaultSpecifier(y)],u.stringLiteral(b)))}var R=k.reduce(function(o,n,i){var f,u=n.match(/^([a-z-_]+):/i);if(u&&(n=n.substr(u[0].length),u="hover"===u[1]||"focus"===u[1]?":"+u[1]:m?"@media (min-width: "+w.screens[u[1]]+")":"`@media (min-width: ${"+y.name+'.screens["'+u[1]+'"]})`'),e[n])return l(o,u?((s={})[u]=l(o[u]||{},e[n]),s):e[n]);if(Object.keys(r).some(function(e){if(n.startsWith(e+"-")||n===e)return f=e,!0}),f){var b,v=n.substr(f.length+1);if(""===v&&(v="default"),Array.isArray(r[f])){var k=r[f].map(function(e){var r=p(e,h),t=r.pre,o=r.post;if(!m||void 0!==w[e.config][v]){var n=e.format?e.format:function(e){return e};return m?((c={})[e.prop]=t||o?t+n(w[e.config][v])+o:n(w[e.config][v]),c):"string"===x?"['"+a(e.prop)+"', "+t+y.name+"."+e.config+'["'+v+'"]'+o+"]":"{"+e.prop+":"+t+y.name+"."+e.config+'["'+v+'"]'+o+"}"}});m?b=k.filter(function(e){return void 0!==e})[0]:"string"===x?(k="["+k.join(",")+"].filter(x => typeof x[1] !== 'undefined' && x[1] !== '')[0].join(':')",(b={})["__spread__"+i]=k):(k="["+k.join(",")+'].filter(x => typeof x[Object.keys(x)[0]] !== "undefined" && x[Object.keys(x)[0]] !== "")[0]',(b={})["__spread__"+i]=k)}else{b=Array.isArray(r[f].prop)?r[f].prop:[r[f].prop];var S=p(r[f],h),R=S.pre,j=S.post,W=r[f].format?r[f].format:function(e){return e};b=b.reduce(function(e,o){return t({},e,((d={})[o]=m?R+W(w[r[f].config][v])+j:"$"+R+y.name+"."+r[f].config+'["'+v+'"]'+j,d))},{})}return l(o,u?((g={})[u]=l(o[u]||{},b),g):b)}return o},{}),j=function e(r,t){if(null===r)return t.nullLiteral();switch(typeof r){case"function":var n=o.parse(r.toString(),{allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0});return traverse.removeProperties(n);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(n){if(n.startsWith("__spread__"))return t.spreadProperty(o.parseExpression(r[n]));var i=n.startsWith("`"),a=i?o.parseExpression(n):t.stringLiteral(n);return t.objectProperty(a,e(r[n],t),i)}))}}(R,u);if("string"===x){var W=function e(r,t){void 0===t&&(t=!1);var o=t?"/**/":"";return Object.keys(r).reduce(function(t,n){var i=r[n];if(n.startsWith("__spread__"))return t+"${"+i+"};"+o;if("string"==typeof i)return"$"===i[0]&&(i="${"+i.substr(1)+"}"),t+a(n)+":"+i+";"+o;i=e(i);var p=":"===n[0]?"&"+n:n;return p="`"===p[0]?p.substr(1,p.length-2):p,t+a(p)+"{"+i+"};"+o},"")}(R,h),z=f.parentPath;if(z.isTemplateLiteral()){var A=z.get("expressions").indexOf(f),_=z.get("quasis")[A],L=z.get("quasis")[A+1];L.node.value.raw=_.node.value.raw+W+L.node.value.raw,L.node.value.cooked=_.node.value.cooked+W+L.node.value.cooked,_.remove(),f.remove();var O=o.parseExpression(n(z.node).code);z.replaceWith(O)}else{f.replaceWith(o.parseExpression("`"+W+"`"))}}else f.replaceWith(j)}function a(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase().replace(/^(ms|o|moz|webkit)-/,"-$1-")}function p(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 l(e,r){return Object.assign({},e,r)}var s=require("babel-plugin-macros").createMacro,c=require("path"),d=s(function(e){var r=e.babel.types,t=e.references,o=e.config,n=c.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=d;
//# sourceMappingURL=macro.js.map
{
"name": "babel-plugin-tailwind-components",
"version": "0.4.0",
"version": "0.5.0",
"description": "Use Tailwind with any CSS-in-JS library",

@@ -33,2 +33,3 @@ "main": "dist/index.js",

"dependencies": {
"babel-generator": "^6.26.1",
"babel-plugin-macros": "^2.1.0",

@@ -35,0 +36,0 @@ "babylon": "^6.18.0"

# 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)
Use [Tailwind](https://tailwindcss.com/) with any CSS-in-JS library
> Use [Tailwind](https://tailwindcss.com/) with any CSS-in-JS library

@@ -87,6 +87,42 @@ ## Prerequisites

This style object format is compatible with most CSS-in-JS libraries, including [styled-components](#examples).
Some libraries such as [styled-jsx](https://github.com/zeit/styled-jsx) do not support this format, so when used inside a `<style>` element the tagged template literal is transformed into a CSS string instead:
**In**
```js
<style jsx>{`
.foo {
${tw`text-red hover:text-green sm:text-blue`};
}
`}</style>
```
**Out**
```js
<style jsx>{`
.foo {
color: #e3342f;
&:hover {
color: #38c172;
}
@media (min-width: 576px) {
color: #3490dc;
}
}
`}</style>
```
_Note: when using `hover:*`, `focus:*`, or media query (e.g. `sm:*`) class names the output is nested like above. You will need to use [styled-jsx-plugin-postcss](https://github.com/giuseppeg/styled-jsx-plugin-postcss) and [postcss-nested](https://github.com/postcss/postcss-nested) to get this to work._
## Options
`config`: path to your Tailwind config file. Defaults to _./tailwind.js_
`config`: path to your Tailwind config file. Defaults to `"./tailwind.js"`
`format`: CSS output format. `"object"`, `"string"`, or `"auto"` (default) – `"auto"` will cause the output to be an object except when inside a `<style>` element. See [how it works](#how-it-works) for more info.
```js

@@ -96,3 +132,4 @@ // babel-plugin-macros.config.js

tailwind: {
config: './tailwind.js'
config: './tailwind.js',
format: 'auto'
}

@@ -106,3 +143,4 @@ }

"tailwind-components", {
"config": "./tailwind.js"
"config": "./tailwind.js",
"format": "auto"
}

@@ -141,3 +179,3 @@ ]

const App = () => (
<Button class={green} css={tw`uppercase`}>
<Button className={green} css={tw`uppercase`}>
hello, world

@@ -161,6 +199,26 @@ </Button>

**[styled-jsx](https://github.com/zeit/styled-jsx)**
```js
import tw from 'tailwind.macro'
const App = () => (
<div>
<div className="foo">hello, world</div>
<style jsx>{`
.foo {
${tw`font-mono text-sm text-red hover:text-blue`};
}
`}</style>
</div>
)
```
_Note: when using `hover:*`, `focus:*`, or media query (e.g. `sm:*`) class names the output is nested. You will need to use [styled-jsx-plugin-postcss](https://github.com/giuseppeg/styled-jsx-plugin-postcss) and [postcss-nested](https://github.com/postcss/postcss-nested) to get this to work._
## Todo
* support for the [container class](https://tailwindcss.com/docs/container); [in progress](https://github.com/bradlc/babel-plugin-tailwind-components/pull/2)
* support for multiple modifiers, e.g. `sm:hover:*`
* ~~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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc