UNPKG

tw-clamp-css

Version:
2 lines (1 loc) 2.14 kB
var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},x=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of m(t))!g.call(e,n)&&n!==r&&c(e,n,{get:()=>t[n],enumerable:!(o=b(t,n))||o.enumerable});return e};var w=e=>x(c({},"__esModule",{value:!0}),e);var G={};h(G,{withClamp:()=>C});module.exports=w(G);var y=":",P=y.length;var d=(e,{cacheSize:t,prefix:r,experimentalParseClassName:o,extend:n={},override:s={}})=>(i(e,"cacheSize",t),i(e,"prefix",r),i(e,"experimentalParseClassName",o),l(e.theme,s.theme),l(e.classGroups,s.classGroups),l(e.conflictingClassGroups,s.conflictingClassGroups),l(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),i(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),a(e.theme,n.theme),a(e.classGroups,n.classGroups),a(e.conflictingClassGroups,n.conflictingClassGroups),a(e.conflictingClassGroupModifiers,n.conflictingClassGroupModifiers),p(e,n,"orderSensitiveModifiers"),e),i=(e,t,r)=>{r!==void 0&&(e[t]=r)},l=(e,t)=>{if(t)for(let r in t)i(e,r,t[r])},a=(e,t)=>{if(t)for(let r in t)p(e,t,r)},p=(e,t,r)=>{let o=t[r];o!==void 0&&(e[r]=e[r]?e[r].concat(o):o)};var v=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"],k=["0","1","2","3","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96","112","128","144","160","176","192","px","0.5","1.5","2.5","3.5"],u=["2xs","xs","sm","md","lg","xl","2xl"];function f(e){return t=>{let r=t.split("-");return r.length<3||!e.includes(r[0])||!e.includes(r[1])||r[2]!=="clamp"?!1:!!(r.length===3||r.length===5&&u.includes(r[3])&&u.includes(r[4]))}}var z=f(v),M=f(k),S=["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gap-x","gap-y","space-x","space-y","w","h","min-w","min-h","max-w","max-h","inset","inset-x","inset-y","top","right","bottom","left"];function C(e){let t=S.reduce((r,o)=>(r[o]=[{[o]:[M]}],r),{});return d(e,{extend:{classGroups:{"font-size":[{text:[z]}],...t}}})}