tw-clamp-css
Version:
TailwindCSS v4.0 compatible CSS clamp()
2 lines (1 loc) • 1.71 kB
JavaScript
var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var b=(e,o)=>{for(var r in o)c(e,r,{get:o[r],enumerable:!0})},h=(e,o,r,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of f(o))!g.call(e,t)&&t!==r&&c(e,t,{get:()=>o[t],enumerable:!(s=u(o,t))||s.enumerable});return e};var x=e=>h(c({},"__esModule",{value:!0}),e);var k={};b(k,{withClamp:()=>y});module.exports=x(k);var d=(e,{cacheSize:o,prefix:r,experimentalParseClassName:s,extend:t={},override:n={}})=>(a(e,"cacheSize",o),a(e,"prefix",r),a(e,"experimentalParseClassName",s),i(e.theme,n.theme),i(e.classGroups,n.classGroups),i(e.conflictingClassGroups,n.conflictingClassGroups),i(e.conflictingClassGroupModifiers,n.conflictingClassGroupModifiers),a(e,"orderSensitiveModifiers",n.orderSensitiveModifiers),l(e.theme,t.theme),l(e.classGroups,t.classGroups),l(e.conflictingClassGroups,t.conflictingClassGroups),l(e.conflictingClassGroupModifiers,t.conflictingClassGroupModifiers),m(e,t,"orderSensitiveModifiers"),e),a=(e,o,r)=>{r!==void 0&&(e[o]=r)},i=(e,o)=>{if(o)for(let r in o)a(e,r,o[r])},l=(e,o)=>{if(o)for(let r in o)m(e,o,r)},m=(e,o,r)=>{let s=o[r];s!==void 0&&(e[r]=e[r]?e[r].concat(s):s)};var p=["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gap-x","gap-y","w","h","min-w","min-h","max-w","max-h","inset","inset-x","inset-y","top","right","bottom","left"];function w(e){let o=e.split("-"),r=o[0];return o.length<4||o[3]!=="clamp"?!1:r==="text"?!0:p.includes(r)}function y(e){let o={clamp:[{clamp:[w]}]},r={"font-size":["clamp"]};return p.forEach(s=>{r[s]=["clamp"]}),d(e,{extend:{classGroups:o,conflictingClassGroups:r}})}