tailwindcss 4.0.0-beta.5 → 4.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Kr=Object.defineProperty;var _r=(t,r)=>{for(var n in r)Kr(t,n,{get:r[n],enumerable:!0})};var We={};_r(We,{Features:()=>fe,__unstable__loadDesignSystem:()=>li,compile:()=>oi,compileAst:()=>Or,default:()=>Ce});var pt="4.0.0-beta.5";var me=92,$e=47,Te=42,Ur=34,Pr=39,jr=58,Se=59,te=10,ge=32,Ve=9,mt=123,qe=125,Je=40,gt=41,Fr=91,zr=93,ht=45,He=64,Lr=33;function re(t){t=t.replaceAll(`\r
1
+ "use strict";var Kr=Object.defineProperty;var _r=(t,r)=>{for(var n in r)Kr(t,n,{get:r[n],enumerable:!0})};var We={};_r(We,{Features:()=>fe,__unstable__loadDesignSystem:()=>li,compile:()=>oi,compileAst:()=>Or,default:()=>Ce});var pt="4.0.0-beta.6";var me=92,$e=47,Te=42,Ur=34,Pr=39,jr=58,Se=59,te=10,ge=32,Ve=9,mt=123,qe=125,Je=40,gt=41,Fr=91,zr=93,ht=45,He=64,Lr=33;function re(t){t=t.replaceAll(`\r
2
2
  `,`
3
3
  `);let r=[],n=[],e=[],o=null,s=null,l="",f="",p;for(let c=0;c<t.length;c++){let d=t.charCodeAt(c);if(d===me)l+=t.slice(c,c+2),c+=1;else if(d===$e&&t.charCodeAt(c+1)===Te){let h=c;for(let v=c+2;v<t.length;v++)if(p=t.charCodeAt(v),p===me)v+=1;else if(p===Te&&t.charCodeAt(v+1)===$e){c=v+1;break}let g=t.slice(h,c+1);g.charCodeAt(2)===Lr&&n.push(Ee(g.slice(2,-2)))}else if(d===Pr||d===Ur){let h=c;for(let g=c+1;g<t.length;g++)if(p=t.charCodeAt(g),p===me)g+=1;else if(p===d){c=g;break}else{if(p===Se&&t.charCodeAt(g+1)===te)throw new Error(`Unterminated string: ${t.slice(h,g+1)+String.fromCharCode(d)}`);if(p===te)throw new Error(`Unterminated string: ${t.slice(h,g)+String.fromCharCode(d)}`)}l+=t.slice(h,c+1)}else{if((d===ge||d===te||d===Ve)&&(p=t.charCodeAt(c+1))&&(p===ge||p===te||p===Ve))continue;if(d===te){if(l.length===0)continue;p=l.charCodeAt(l.length-1),p!==ge&&p!==te&&p!==Ve&&(l+=" ")}else if(d===ht&&t.charCodeAt(c+1)===ht&&l.length===0){let h="",g=c,v=-1;for(let k=c+2;k<t.length;k++)if(p=t.charCodeAt(k),p===me)k+=1;else if(p===$e&&t.charCodeAt(k+1)===Te){for(let $=k+2;$<t.length;$++)if(p=t.charCodeAt($),p===me)$+=1;else if(p===Te&&t.charCodeAt($+1)===$e){k=$+1;break}}else if(v===-1&&p===jr)v=l.length+k-g;else if(p===Se&&h.length===0){l+=t.slice(g,k),c=k;break}else if(p===Je)h+=")";else if(p===Fr)h+="]";else if(p===mt)h+="}";else if((p===qe||t.length-1===k)&&h.length===0){c=k-1,l+=t.slice(g,k);break}else(p===gt||p===zr||p===qe)&&h.length>0&&t[k]===h[h.length-1]&&(h=h.slice(0,-1));let y=Ge(l,v);o?o.nodes.push(y):r.push(y),l=""}else if(d===Se&&l.charCodeAt(0)===He)s=he(l),o?o.nodes.push(s):r.push(s),l="",s=null;else if(d===Se&&f[f.length-1]!==")"){let h=Ge(l);o?o.nodes.push(h):r.push(h),l=""}else if(d===mt&&f[f.length-1]!==")")f+="}",s=L(l.trim()),o&&o.nodes.push(s),e.push(o),o=s,l="",s=null;else if(d===qe&&f[f.length-1]!==")"){if(f==="")throw new Error("Missing opening {");if(f=f.slice(0,-1),l.length>0)if(l.charCodeAt(0)===He)s=he(l),o?o.nodes.push(s):r.push(s),l="",s=null;else{let g=l.indexOf(":");o&&o.nodes.push(Ge(l,g))}let h=e.pop()??null;h===null&&o&&r.push(o),o=h,l="",s=null}else if(d===Je)f+=")",l+="(";else if(d===gt){if(f[f.length-1]!==")")throw new Error("Missing opening (");f=f.slice(0,-1),l+=")"}else{if(l.length===0&&(d===ge||d===te||d===Ve))continue;l+=String.fromCharCode(d)}}}if(l.charCodeAt(0)===He&&r.push(he(l)),f.length>0&&o){if(o.kind==="rule")throw new Error(`Missing closing } at ${o.selector}`);if(o.kind==="at-rule")throw new Error(`Missing closing } at ${o.name} ${o.params}`)}return n.length>0?n.concat(r):r}function he(t,r=[]){for(let n=5;n<t.length;n++){let e=t.charCodeAt(n);if(e===ge||e===Je){let o=t.slice(0,n).trim(),s=t.slice(n).trim();return _(o,s,r)}}return _(t.trim(),"",r)}function Ge(t,r=t.indexOf(":")){let n=t.indexOf("!important",r+1);return a(t.slice(0,r).trim(),t.slice(r+1,n===-1?t.length:n).trim(),n!==-1)}var Ir=64;function P(t,r=[]){return{kind:"rule",selector:t,nodes:r}}function _(t,r="",n=[]){return{kind:"at-rule",name:t,params:r,nodes:n}}function L(t,r=[]){return t.charCodeAt(0)===Ir?he(t,r):P(t,r)}function a(t,r,n=!1){return{kind:"declaration",property:t,value:r,important:n}}function Ee(t){return{kind:"comment",value:t}}function ne(t,r){return{kind:"context",context:t,nodes:r}}function D(t){return{kind:"at-root",nodes:t}}function U(t,r,n=[],e={}){for(let o=0;o<t.length;o++){let s=t[o],l=[...n,s],f=n.at(-1)??null;if(s.kind==="context"){if(U(s.nodes,r,n,{...e,...s.context})===2)return 2;continue}let p=r(s,{parent:f,context:e,path:l,replaceWith(c){t.splice(o,1,...Array.isArray(c)?c:[c]),o--}})??0;if(p===2)return 2;if(p!==1&&(s.kind==="rule"||s.kind==="at-rule")&&U(s.nodes,r,l,e)===2)return 2}}function Re(t,r,n=[],e={}){for(let o=0;o<t.length;o++){let s=t[o],l=[...n,s],f=n.at(-1)??null;if(s.kind==="rule"||s.kind==="at-rule")Re(s.nodes,r,l,e);else if(s.kind==="context"){Re(s.nodes,r,n,{...e,...s.context});continue}r(s,{parent:f,context:e,path:l,replaceWith(p){t.splice(o,1,...p),o+=p.length-1}})}}function ve(t){let r=[],n=new Set,e=[],o=[];function s(f,p,c=0){if(f.kind==="declaration"){if(f.property==="--tw-sort"||f.value===void 0||f.value===null)return;p.push(f)}else if(f.kind==="rule"){let d={...f,nodes:[]};for(let h of f.nodes)s(h,d.nodes,c+1);p.push(d)}else if(f.kind==="at-rule"&&f.name==="@property"&&c===0){if(n.has(f.params))return;let d=f.params,h=null,g=!1;for(let y of f.nodes)y.kind==="declaration"&&(y.property==="initial-value"?h=y.value:y.property==="inherits"&&(g=y.value==="true"));g?e.push(a(d,h??"initial")):o.push(a(d,h??"initial")),n.add(f.params);let v={...f,nodes:[]};for(let y of f.nodes)s(y,v.nodes,c+1);p.push(v)}else if(f.kind==="at-rule"){let d={...f,nodes:[]};for(let h of f.nodes)s(h,d.nodes,c+1);p.push(d)}else if(f.kind==="at-root")for(let d of f.nodes){let h=[];s(d,h,0);for(let g of h)r.push(g)}else if(f.kind==="context")for(let d of f.nodes)s(d,p,c);else f.kind==="comment"&&p.push(f)}let l=[];for(let f of t)s(f,l,0);{let f=[];e.length>0&&f.push(L(":root",e)),o.length>0&&f.push(L("*, ::before, ::after, ::backdrop",o)),f.length>0&&l.push(_("@supports","(-moz-orient: inline)",[_("@layer","base",f)]))}return l.concat(r)}function Y(t){function r(e,o=0){let s="",l=" ".repeat(o);if(e.kind==="declaration")s+=`${l}${e.property}: ${e.value}${e.important?" !important":""};
4
4
  `;else if(e.kind==="rule"){s+=`${l}${e.selector} {
@@ -21,7 +21,7 @@ Using an object as a plugin option is currently only supported in JavaScript con
21
21
 
22
22
  ${JSON.stringify(v,null,2)}
23
23
 
24
- This feature is not currently supported.`);e.push(v)}return l}var ei=/^[a-z]+$/,ti=/^[a-z][a-zA-Z0-9/%._-]*$/;function ri(){throw new Error("No `loadModule` function provided to `compile`")}function ni(){throw new Error("No `loadStylesheet` function provided to `compile`")}function ii(t){let r=0,n=null;for(let e of K(t," "))e==="reference"?r|=2:e==="inline"?r|=1:e==="default"?r|=4:e.startsWith("prefix(")&&e.endsWith(")")&&(n=e.slice(7,-1));return[r,n]}var fe=(l=>(l[l.None=0]="None",l[l.AtApply=1]="AtApply",l[l.AtImport=2]="AtImport",l[l.JsPluginCompat=4]="JsPluginCompat",l[l.ThemeFunction=8]="ThemeFunction",l[l.Utilities=16]="Utilities",l))(fe||{});async function Rr(t,{base:r="",loadModule:n=ri,loadStylesheet:e=ni}={}){let o=0;t=[ne({base:r},t)],o|=await ut(t,r,e);let s=null,l=new Pe,f=[],p=[],c=null,d=null,h=[],g=null;U(t,(y,{parent:k,replaceWith:$,context:S})=>{if(y.kind==="at-rule"){if(y.name==="@tailwind"&&(y.params==="utilities"||y.params.startsWith("utilities"))){if(d!==null){$([]);return}let R=K(y.params," ");for(let O of R)if(O.startsWith("source(")){let V=O.slice(7,-1);if(V==="none"){g=V;continue}if(V[0]==='"'&&V[V.length-1]!=='"'||V[0]==="'"&&V[V.length-1]!=="'"||V[0]!=="'"&&V[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");g={base:S.sourceBase??S.base,pattern:V.slice(1,-1)}}d=y,o|=16}if(y.name==="@utility"){if(k!==null)throw new Error("`@utility` cannot be nested.");let R=y.params;if(!ti.test(R))throw new Error(`\`@utility ${R}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);if(y.nodes.length===0)throw new Error(`\`@utility ${R}\` is empty. Utilities should include at least one property.`);p.push(O=>{O.utilities.static(R,()=>structuredClone(y.nodes))});return}if(y.name==="@source"){if(y.nodes.length>0)throw new Error("`@source` cannot have a body.");if(k!==null)throw new Error("`@source` cannot be nested.");let R=y.params;if(R[0]==='"'&&R[R.length-1]!=='"'||R[0]==="'"&&R[R.length-1]!=="'"||R[0]!=="'"&&R[0]!=='"')throw new Error("`@source` paths must be quoted.");h.push({base:S.base,pattern:R.slice(1,-1)}),$([]);return}if(y.name==="@variant"){if(k!==null)throw new Error("`@variant` cannot be nested.");$([]);let[R,O]=K(y.params," ");if(y.nodes.length>0&&O)throw new Error(`\`@variant ${R}\` cannot have both a selector and a body.`);if(y.nodes.length===0){if(!O)throw new Error(`\`@variant ${R}\` has no selector or body.`);let V=K(O.slice(1,-1),","),F=[],i=[];for(let u of V)u=u.trim(),u[0]==="@"?F.push(u):i.push(u);f.push(u=>{u.variants.static(R,m=>{let w=[];i.length>0&&w.push(P(i.join(", "),m.nodes));for(let b of F)w.push(L(b,m.nodes));m.nodes=w},{compounds:se([...i,...F])})});return}else{f.push(V=>{V.variants.fromAst(R,y.nodes)});return}}if(y.name==="@media"){let R=K(y.params," "),O=[];for(let V of R)if(V.startsWith("source(")){let F=V.slice(7,-1);U(y.nodes,(i,{replaceWith:u})=>{if(i.kind==="at-rule"&&i.name==="@tailwind"&&i.params==="utilities")return i.params+=` source(${F})`,u([ne({sourceBase:S.base},[i])]),2})}else if(V.startsWith("theme(")){let F=V.slice(6,-1);U(y.nodes,i=>{if(i.kind!=="at-rule")throw new Error('Files imported with `@import "\u2026" theme(\u2026)` must only contain `@theme` blocks.');if(i.name==="@theme")return i.params+=" "+F,1})}else if(V.startsWith("prefix(")){let F=V.slice(7,-1);U(y.nodes,i=>{if(i.kind==="at-rule"&&i.name==="@theme")return i.params+=` prefix(${F})`,1})}else V==="important"?s=!0:V==="reference"?(U(y.nodes,(F,{replaceWith:i})=>{if(F.kind!=="at-rule")return i([]),1;switch(F.name){case"@theme":return K(F.params," ").includes("reference")||(F.params=(F.params===""?"":" ")+"reference"),1;case"@import":case"@config":case"@plugin":case"@variant":case"@utility":return 1}}),y.nodes=[ne({reference:!0},y.nodes)]):O.push(V);return O.length>0?y.params=O.join(" "):R.length>0&&$(y.nodes),1}if(y.name==="@theme"){let[R,O]=ii(y.params);if(O){if(!ei.test(O))throw new Error(`The prefix "${O}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);l.prefix=O}return U(y.nodes,(V,{replaceWith:F})=>{if(V.kind==="at-rule"&&V.name==="@keyframes")return l.addKeyframes(V),F([]),1;if(V.kind==="comment")return;if(V.kind==="declaration"&&V.property.startsWith("--")){l.add(V.property,V.value??"",R);return}let i=Y([_(y.name,y.params,[V])]).split(`
24
+ This feature is not currently supported.`);e.push(v)}return l}var ei=/^[a-z]+$/,ti=/^[a-z][a-zA-Z0-9/%._-]*$/;function ri(){throw new Error("No `loadModule` function provided to `compile`")}function ni(){throw new Error("No `loadStylesheet` function provided to `compile`")}function ii(t){let r=0,n=null;for(let e of K(t," "))e==="reference"?r|=2:e==="inline"?r|=1:e==="default"?r|=4:e.startsWith("prefix(")&&e.endsWith(")")&&(n=e.slice(7,-1));return[r,n]}var fe=(l=>(l[l.None=0]="None",l[l.AtApply=1]="AtApply",l[l.AtImport=2]="AtImport",l[l.JsPluginCompat=4]="JsPluginCompat",l[l.ThemeFunction=8]="ThemeFunction",l[l.Utilities=16]="Utilities",l))(fe||{});async function Rr(t,{base:r="",loadModule:n=ri,loadStylesheet:e=ni}={}){let o=0;t=[ne({base:r},t)],o|=await ut(t,r,e);let s=null,l=new Pe,f=[],p=[],c=null,d=null,h=[],g=null;U(t,(y,{parent:k,replaceWith:$,context:S})=>{if(y.kind==="at-rule"){if(y.name==="@tailwind"&&(y.params==="utilities"||y.params.startsWith("utilities"))){if(d!==null){$([]);return}let R=K(y.params," ");for(let O of R)if(O.startsWith("source(")){let V=O.slice(7,-1);if(V==="none"){g=V;continue}if(V[0]==='"'&&V[V.length-1]!=='"'||V[0]==="'"&&V[V.length-1]!=="'"||V[0]!=="'"&&V[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");g={base:S.sourceBase??S.base,pattern:V.slice(1,-1)}}d=y,o|=16}if(y.name==="@utility"){if(k!==null)throw new Error("`@utility` cannot be nested.");let R=y.params;if(!ti.test(R))throw new Error(`\`@utility ${R}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);if(y.nodes.length===0)throw new Error(`\`@utility ${R}\` is empty. Utilities should include at least one property.`);p.push(O=>{O.utilities.static(R,()=>structuredClone(y.nodes))});return}if(y.name==="@source"){if(y.nodes.length>0)throw new Error("`@source` cannot have a body.");if(k!==null)throw new Error("`@source` cannot be nested.");let R=y.params;if(R[0]==='"'&&R[R.length-1]!=='"'||R[0]==="'"&&R[R.length-1]!=="'"||R[0]!=="'"&&R[0]!=='"')throw new Error("`@source` paths must be quoted.");h.push({base:S.base,pattern:R.slice(1,-1)}),$([]);return}if(y.name==="@variant"){if(k!==null)throw new Error("`@variant` cannot be nested.");$([]);let[R,O]=K(y.params," ");if(y.nodes.length>0&&O)throw new Error(`\`@variant ${R}\` cannot have both a selector and a body.`);if(y.nodes.length===0){if(!O)throw new Error(`\`@variant ${R}\` has no selector or body.`);let V=K(O.slice(1,-1),","),F=[],i=[];for(let u of V)u=u.trim(),u[0]==="@"?F.push(u):i.push(u);f.push(u=>{u.variants.static(R,m=>{let w=[];i.length>0&&w.push(P(i.join(", "),m.nodes));for(let b of F)w.push(L(b,m.nodes));m.nodes=w},{compounds:se([...i,...F])})});return}else{f.push(V=>{V.variants.fromAst(R,y.nodes)});return}}if(y.name==="@media"){let R=K(y.params," "),O=[];for(let V of R)if(V.startsWith("source(")){let F=V.slice(7,-1);U(y.nodes,(i,{replaceWith:u})=>{if(i.kind==="at-rule"&&i.name==="@tailwind"&&i.params==="utilities")return i.params+=` source(${F})`,u([ne({sourceBase:S.base},[i])]),2})}else if(V.startsWith("theme(")){let F=V.slice(6,-1);U(y.nodes,i=>{if(i.kind!=="at-rule")throw new Error('Files imported with `@import "\u2026" theme(\u2026)` must only contain `@theme` blocks.');if(i.name==="@theme")return i.params+=" "+F,1})}else if(V.startsWith("prefix(")){let F=V.slice(7,-1);U(y.nodes,i=>{if(i.kind==="at-rule"&&i.name==="@theme")return i.params+=` prefix(${F})`,1})}else V==="important"?s=!0:V==="reference"?(U(y.nodes,(F,{replaceWith:i})=>{if(F.kind!=="at-rule")return i([]),1;switch(F.name){case"@theme":return K(F.params," ").includes("reference")||(F.params=(F.params===""?"":" ")+"reference"),1;case"@import":case"@config":case"@plugin":case"@variant":case"@utility":return 1;case"@media":case"@supports":case"@layer":return;default:return i([]),1}}),y.nodes=[ne({reference:!0},y.nodes)]):O.push(V);return O.length>0?y.params=O.join(" "):R.length>0&&$(y.nodes),1}if(y.name==="@theme"){let[R,O]=ii(y.params);if(O){if(!ei.test(O))throw new Error(`The prefix "${O}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);l.prefix=O}return U(y.nodes,(V,{replaceWith:F})=>{if(V.kind==="at-rule"&&V.name==="@keyframes")return l.addKeyframes(V),F([]),1;if(V.kind==="comment")return;if(V.kind==="declaration"&&V.property.startsWith("--")){l.add(V.property,V.value??"",R);return}let i=Y([_(y.name,y.params,[V])]).split(`
25
25
  `).map((u,m,w)=>`${m===0||m>=w.length-2?" ":">"} ${u}`).join(`
26
26
  `);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`.
27
27
 
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{a as Qe,b as D,c as I,d as V,e as se,f as we,g as et}from"./chunk-XNK5LQL5.mjs";import{a as Xe}from"./chunk-AZANAYY2.mjs";var tt="4.0.0-beta.5";var ue=92,ke=47,xe=42,pr=34,gr=39,mr=58,Ae=59,Q=10,fe=32,Ce=9,rt=123,je=125,_e=40,nt=41,hr=91,vr=93,it=45,Pe=64,yr=33;function X(r){r=r.replaceAll(`\r
1
+ import{a as Qe,b as D,c as I,d as V,e as se,f as we,g as et}from"./chunk-XNK5LQL5.mjs";import{a as Xe}from"./chunk-AZANAYY2.mjs";var tt="4.0.0-beta.6";var ue=92,ke=47,xe=42,pr=34,gr=39,mr=58,Ae=59,Q=10,fe=32,Ce=9,rt=123,je=125,_e=40,nt=41,hr=91,vr=93,it=45,Pe=64,yr=33;function X(r){r=r.replaceAll(`\r
2
2
  `,`
3
3
  `);let t=[],n=[],e=[],o=null,s=null,l="",c="",g;for(let f=0;f<r.length;f++){let d=r.charCodeAt(f);if(d===ue)l+=r.slice(f,f+2),f+=1;else if(d===ke&&r.charCodeAt(f+1)===xe){let h=f;for(let v=f+2;v<r.length;v++)if(g=r.charCodeAt(v),g===ue)v+=1;else if(g===xe&&r.charCodeAt(v+1)===ke){f=v+1;break}let m=r.slice(h,f+1);m.charCodeAt(2)===yr&&n.push($e(m.slice(2,-2)))}else if(d===gr||d===pr){let h=f;for(let m=f+1;m<r.length;m++)if(g=r.charCodeAt(m),g===ue)m+=1;else if(g===d){f=m;break}else{if(g===Ae&&r.charCodeAt(m+1)===Q)throw new Error(`Unterminated string: ${r.slice(h,m+1)+String.fromCharCode(d)}`);if(g===Q)throw new Error(`Unterminated string: ${r.slice(h,m)+String.fromCharCode(d)}`)}l+=r.slice(h,f+1)}else{if((d===fe||d===Q||d===Ce)&&(g=r.charCodeAt(f+1))&&(g===fe||g===Q||g===Ce))continue;if(d===Q){if(l.length===0)continue;g=l.charCodeAt(l.length-1),g!==fe&&g!==Q&&g!==Ce&&(l+=" ")}else if(d===it&&r.charCodeAt(f+1)===it&&l.length===0){let h="",m=f,v=-1;for(let k=f+2;k<r.length;k++)if(g=r.charCodeAt(k),g===ue)k+=1;else if(g===ke&&r.charCodeAt(k+1)===xe){for(let $=k+2;$<r.length;$++)if(g=r.charCodeAt($),g===ue)$+=1;else if(g===xe&&r.charCodeAt($+1)===ke){k=$+1;break}}else if(v===-1&&g===mr)v=l.length+k-m;else if(g===Ae&&h.length===0){l+=r.slice(m,k),f=k;break}else if(g===_e)h+=")";else if(g===hr)h+="]";else if(g===rt)h+="}";else if((g===je||r.length-1===k)&&h.length===0){f=k-1,l+=r.slice(m,k);break}else(g===nt||g===vr||g===je)&&h.length>0&&r[k]===h[h.length-1]&&(h=h.slice(0,-1));let y=De(l,v);o?o.nodes.push(y):t.push(y),l=""}else if(d===Ae&&l.charCodeAt(0)===Pe)s=ce(l),o?o.nodes.push(s):t.push(s),l="",s=null;else if(d===Ae&&c[c.length-1]!==")"){let h=De(l);o?o.nodes.push(h):t.push(h),l=""}else if(d===rt&&c[c.length-1]!==")")c+="}",s=z(l.trim()),o&&o.nodes.push(s),e.push(o),o=s,l="",s=null;else if(d===je&&c[c.length-1]!==")"){if(c==="")throw new Error("Missing opening {");if(c=c.slice(0,-1),l.length>0)if(l.charCodeAt(0)===Pe)s=ce(l),o?o.nodes.push(s):t.push(s),l="",s=null;else{let m=l.indexOf(":");o&&o.nodes.push(De(l,m))}let h=e.pop()??null;h===null&&o&&t.push(o),o=h,l="",s=null}else if(d===_e)c+=")",l+="(";else if(d===nt){if(c[c.length-1]!==")")throw new Error("Missing opening (");c=c.slice(0,-1),l+=")"}else{if(l.length===0&&(d===fe||d===Q||d===Ce))continue;l+=String.fromCharCode(d)}}}if(l.charCodeAt(0)===Pe&&t.push(ce(l)),c.length>0&&o){if(o.kind==="rule")throw new Error(`Missing closing } at ${o.selector}`);if(o.kind==="at-rule")throw new Error(`Missing closing } at ${o.name} ${o.params}`)}return n.length>0?n.concat(t):t}function ce(r,t=[]){for(let n=5;n<r.length;n++){let e=r.charCodeAt(n);if(e===fe||e===_e){let o=r.slice(0,n).trim(),s=r.slice(n).trim();return O(o,s,t)}}return O(r.trim(),"",t)}function De(r,t=r.indexOf(":")){let n=r.indexOf("!important",t+1);return a(r.slice(0,t).trim(),r.slice(t+1,n===-1?r.length:n).trim(),n!==-1)}var br=64;function _(r,t=[]){return{kind:"rule",selector:r,nodes:t}}function O(r,t="",n=[]){return{kind:"at-rule",name:r,params:t,nodes:n}}function z(r,t=[]){return r.charCodeAt(0)===br?ce(r,t):_(r,t)}function a(r,t,n=!1){return{kind:"declaration",property:r,value:t,important:n}}function $e(r){return{kind:"comment",value:r}}function ee(r,t){return{kind:"context",context:r,nodes:t}}function j(r){return{kind:"at-root",nodes:r}}function P(r,t,n=[],e={}){for(let o=0;o<r.length;o++){let s=r[o],l=[...n,s],c=n.at(-1)??null;if(s.kind==="context"){if(P(s.nodes,t,n,{...e,...s.context})===2)return 2;continue}let g=t(s,{parent:c,context:e,path:l,replaceWith(f){r.splice(o,1,...Array.isArray(f)?f:[f]),o--}})??0;if(g===2)return 2;if(g!==1&&(s.kind==="rule"||s.kind==="at-rule")&&P(s.nodes,t,l,e)===2)return 2}}function Ne(r,t,n=[],e={}){for(let o=0;o<r.length;o++){let s=r[o],l=[...n,s],c=n.at(-1)??null;if(s.kind==="rule"||s.kind==="at-rule")Ne(s.nodes,t,l,e);else if(s.kind==="context"){Ne(s.nodes,t,n,{...e,...s.context});continue}t(s,{parent:c,context:e,path:l,replaceWith(g){r.splice(o,1,...g),o+=g.length-1}})}}function de(r){let t=[],n=new Set,e=[],o=[];function s(c,g,f=0){if(c.kind==="declaration"){if(c.property==="--tw-sort"||c.value===void 0||c.value===null)return;g.push(c)}else if(c.kind==="rule"){let d={...c,nodes:[]};for(let h of c.nodes)s(h,d.nodes,f+1);g.push(d)}else if(c.kind==="at-rule"&&c.name==="@property"&&f===0){if(n.has(c.params))return;let d=c.params,h=null,m=!1;for(let y of c.nodes)y.kind==="declaration"&&(y.property==="initial-value"?h=y.value:y.property==="inherits"&&(m=y.value==="true"));m?e.push(a(d,h??"initial")):o.push(a(d,h??"initial")),n.add(c.params);let v={...c,nodes:[]};for(let y of c.nodes)s(y,v.nodes,f+1);g.push(v)}else if(c.kind==="at-rule"){let d={...c,nodes:[]};for(let h of c.nodes)s(h,d.nodes,f+1);g.push(d)}else if(c.kind==="at-root")for(let d of c.nodes){let h=[];s(d,h,0);for(let m of h)t.push(m)}else if(c.kind==="context")for(let d of c.nodes)s(d,g,f);else c.kind==="comment"&&g.push(c)}let l=[];for(let c of r)s(c,l,0);{let c=[];e.length>0&&c.push(z(":root",e)),o.length>0&&c.push(z("*, ::before, ::after, ::backdrop",o)),c.length>0&&l.push(O("@supports","(-moz-orient: inline)",[O("@layer","base",c)]))}return l.concat(t)}function G(r){function t(e,o=0){let s="",l=" ".repeat(o);if(e.kind==="declaration")s+=`${l}${e.property}: ${e.value}${e.important?" !important":""};
4
4
  `;else if(e.kind==="rule"){s+=`${l}${e.selector} {
@@ -21,7 +21,7 @@ Using an object as a plugin option is currently only supported in JavaScript con
21
21
 
22
22
  ${JSON.stringify(v,null,2)}
23
23
 
24
- This feature is not currently supported.`);e.push(v)}return l}var ln=/^[a-z]+$/,an=/^[a-z][a-zA-Z0-9/%._-]*$/;function sn(){throw new Error("No `loadModule` function provided to `compile`")}function un(){throw new Error("No `loadStylesheet` function provided to `compile`")}function fn(r){let t=0,n=null;for(let e of D(r," "))e==="reference"?t|=2:e==="inline"?t|=1:e==="default"?t|=4:e.startsWith("prefix(")&&e.endsWith(")")&&(n=e.slice(7,-1));return[t,n]}var ge=(l=>(l[l.None=0]="None",l[l.AtApply=1]="AtApply",l[l.AtImport=2]="AtImport",l[l.JsPluginCompat=4]="JsPluginCompat",l[l.ThemeFunction=8]="ThemeFunction",l[l.Utilities=16]="Utilities",l))(ge||{});async function cr(r,{base:t="",loadModule:n=sn,loadStylesheet:e=un}={}){let o=0;r=[ee({base:t},r)],o|=await Ge(r,t,e);let s=null,l=new Te,c=[],g=[],f=null,d=null,h=[],m=null;P(r,(y,{parent:k,replaceWith:$,context:T})=>{if(y.kind==="at-rule"){if(y.name==="@tailwind"&&(y.params==="utilities"||y.params.startsWith("utilities"))){if(d!==null){$([]);return}let R=D(y.params," ");for(let K of R)if(K.startsWith("source(")){let S=K.slice(7,-1);if(S==="none"){m=S;continue}if(S[0]==='"'&&S[S.length-1]!=='"'||S[0]==="'"&&S[S.length-1]!=="'"||S[0]!=="'"&&S[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");m={base:T.sourceBase??T.base,pattern:S.slice(1,-1)}}d=y,o|=16}if(y.name==="@utility"){if(k!==null)throw new Error("`@utility` cannot be nested.");let R=y.params;if(!an.test(R))throw new Error(`\`@utility ${R}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);if(y.nodes.length===0)throw new Error(`\`@utility ${R}\` is empty. Utilities should include at least one property.`);g.push(K=>{K.utilities.static(R,()=>structuredClone(y.nodes))});return}if(y.name==="@source"){if(y.nodes.length>0)throw new Error("`@source` cannot have a body.");if(k!==null)throw new Error("`@source` cannot be nested.");let R=y.params;if(R[0]==='"'&&R[R.length-1]!=='"'||R[0]==="'"&&R[R.length-1]!=="'"||R[0]!=="'"&&R[0]!=='"')throw new Error("`@source` paths must be quoted.");h.push({base:T.base,pattern:R.slice(1,-1)}),$([]);return}if(y.name==="@variant"){if(k!==null)throw new Error("`@variant` cannot be nested.");$([]);let[R,K]=D(y.params," ");if(y.nodes.length>0&&K)throw new Error(`\`@variant ${R}\` cannot have both a selector and a body.`);if(y.nodes.length===0){if(!K)throw new Error(`\`@variant ${R}\` has no selector or body.`);let S=D(K.slice(1,-1),","),U=[],i=[];for(let u of S)u=u.trim(),u[0]==="@"?U.push(u):i.push(u);c.push(u=>{u.variants.static(R,p=>{let w=[];i.length>0&&w.push(_(i.join(", "),p.nodes));for(let b of U)w.push(z(b,p.nodes));p.nodes=w},{compounds:ie([...i,...U])})});return}else{c.push(S=>{S.variants.fromAst(R,y.nodes)});return}}if(y.name==="@media"){let R=D(y.params," "),K=[];for(let S of R)if(S.startsWith("source(")){let U=S.slice(7,-1);P(y.nodes,(i,{replaceWith:u})=>{if(i.kind==="at-rule"&&i.name==="@tailwind"&&i.params==="utilities")return i.params+=` source(${U})`,u([ee({sourceBase:T.base},[i])]),2})}else if(S.startsWith("theme(")){let U=S.slice(6,-1);P(y.nodes,i=>{if(i.kind!=="at-rule")throw new Error('Files imported with `@import "\u2026" theme(\u2026)` must only contain `@theme` blocks.');if(i.name==="@theme")return i.params+=" "+U,1})}else if(S.startsWith("prefix(")){let U=S.slice(7,-1);P(y.nodes,i=>{if(i.kind==="at-rule"&&i.name==="@theme")return i.params+=` prefix(${U})`,1})}else S==="important"?s=!0:S==="reference"?(P(y.nodes,(U,{replaceWith:i})=>{if(U.kind!=="at-rule")return i([]),1;switch(U.name){case"@theme":return D(U.params," ").includes("reference")||(U.params=(U.params===""?"":" ")+"reference"),1;case"@import":case"@config":case"@plugin":case"@variant":case"@utility":return 1}}),y.nodes=[ee({reference:!0},y.nodes)]):K.push(S);return K.length>0?y.params=K.join(" "):R.length>0&&$(y.nodes),1}if(y.name==="@theme"){let[R,K]=fn(y.params);if(K){if(!ln.test(K))throw new Error(`The prefix "${K}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);l.prefix=K}return P(y.nodes,(S,{replaceWith:U})=>{if(S.kind==="at-rule"&&S.name==="@keyframes")return l.addKeyframes(S),U([]),1;if(S.kind==="comment")return;if(S.kind==="declaration"&&S.property.startsWith("--")){l.add(S.property,S.value??"",R);return}let i=G([O(y.name,y.params,[S])]).split(`
24
+ This feature is not currently supported.`);e.push(v)}return l}var ln=/^[a-z]+$/,an=/^[a-z][a-zA-Z0-9/%._-]*$/;function sn(){throw new Error("No `loadModule` function provided to `compile`")}function un(){throw new Error("No `loadStylesheet` function provided to `compile`")}function fn(r){let t=0,n=null;for(let e of D(r," "))e==="reference"?t|=2:e==="inline"?t|=1:e==="default"?t|=4:e.startsWith("prefix(")&&e.endsWith(")")&&(n=e.slice(7,-1));return[t,n]}var ge=(l=>(l[l.None=0]="None",l[l.AtApply=1]="AtApply",l[l.AtImport=2]="AtImport",l[l.JsPluginCompat=4]="JsPluginCompat",l[l.ThemeFunction=8]="ThemeFunction",l[l.Utilities=16]="Utilities",l))(ge||{});async function cr(r,{base:t="",loadModule:n=sn,loadStylesheet:e=un}={}){let o=0;r=[ee({base:t},r)],o|=await Ge(r,t,e);let s=null,l=new Te,c=[],g=[],f=null,d=null,h=[],m=null;P(r,(y,{parent:k,replaceWith:$,context:T})=>{if(y.kind==="at-rule"){if(y.name==="@tailwind"&&(y.params==="utilities"||y.params.startsWith("utilities"))){if(d!==null){$([]);return}let R=D(y.params," ");for(let K of R)if(K.startsWith("source(")){let S=K.slice(7,-1);if(S==="none"){m=S;continue}if(S[0]==='"'&&S[S.length-1]!=='"'||S[0]==="'"&&S[S.length-1]!=="'"||S[0]!=="'"&&S[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");m={base:T.sourceBase??T.base,pattern:S.slice(1,-1)}}d=y,o|=16}if(y.name==="@utility"){if(k!==null)throw new Error("`@utility` cannot be nested.");let R=y.params;if(!an.test(R))throw new Error(`\`@utility ${R}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);if(y.nodes.length===0)throw new Error(`\`@utility ${R}\` is empty. Utilities should include at least one property.`);g.push(K=>{K.utilities.static(R,()=>structuredClone(y.nodes))});return}if(y.name==="@source"){if(y.nodes.length>0)throw new Error("`@source` cannot have a body.");if(k!==null)throw new Error("`@source` cannot be nested.");let R=y.params;if(R[0]==='"'&&R[R.length-1]!=='"'||R[0]==="'"&&R[R.length-1]!=="'"||R[0]!=="'"&&R[0]!=='"')throw new Error("`@source` paths must be quoted.");h.push({base:T.base,pattern:R.slice(1,-1)}),$([]);return}if(y.name==="@variant"){if(k!==null)throw new Error("`@variant` cannot be nested.");$([]);let[R,K]=D(y.params," ");if(y.nodes.length>0&&K)throw new Error(`\`@variant ${R}\` cannot have both a selector and a body.`);if(y.nodes.length===0){if(!K)throw new Error(`\`@variant ${R}\` has no selector or body.`);let S=D(K.slice(1,-1),","),U=[],i=[];for(let u of S)u=u.trim(),u[0]==="@"?U.push(u):i.push(u);c.push(u=>{u.variants.static(R,p=>{let w=[];i.length>0&&w.push(_(i.join(", "),p.nodes));for(let b of U)w.push(z(b,p.nodes));p.nodes=w},{compounds:ie([...i,...U])})});return}else{c.push(S=>{S.variants.fromAst(R,y.nodes)});return}}if(y.name==="@media"){let R=D(y.params," "),K=[];for(let S of R)if(S.startsWith("source(")){let U=S.slice(7,-1);P(y.nodes,(i,{replaceWith:u})=>{if(i.kind==="at-rule"&&i.name==="@tailwind"&&i.params==="utilities")return i.params+=` source(${U})`,u([ee({sourceBase:T.base},[i])]),2})}else if(S.startsWith("theme(")){let U=S.slice(6,-1);P(y.nodes,i=>{if(i.kind!=="at-rule")throw new Error('Files imported with `@import "\u2026" theme(\u2026)` must only contain `@theme` blocks.');if(i.name==="@theme")return i.params+=" "+U,1})}else if(S.startsWith("prefix(")){let U=S.slice(7,-1);P(y.nodes,i=>{if(i.kind==="at-rule"&&i.name==="@theme")return i.params+=` prefix(${U})`,1})}else S==="important"?s=!0:S==="reference"?(P(y.nodes,(U,{replaceWith:i})=>{if(U.kind!=="at-rule")return i([]),1;switch(U.name){case"@theme":return D(U.params," ").includes("reference")||(U.params=(U.params===""?"":" ")+"reference"),1;case"@import":case"@config":case"@plugin":case"@variant":case"@utility":return 1;case"@media":case"@supports":case"@layer":return;default:return i([]),1}}),y.nodes=[ee({reference:!0},y.nodes)]):K.push(S);return K.length>0?y.params=K.join(" "):R.length>0&&$(y.nodes),1}if(y.name==="@theme"){let[R,K]=fn(y.params);if(K){if(!ln.test(K))throw new Error(`The prefix "${K}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);l.prefix=K}return P(y.nodes,(S,{replaceWith:U})=>{if(S.kind==="at-rule"&&S.name==="@keyframes")return l.addKeyframes(S),U([]),1;if(S.kind==="comment")return;if(S.kind==="declaration"&&S.property.startsWith("--")){l.add(S.property,S.value??"",R);return}let i=G([O(y.name,y.params,[S])]).split(`
25
25
  `).map((u,p,w)=>`${p===0||p>=w.length-2?" ":">"} ${u}`).join(`
26
26
  `);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`.
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "4.0.0-beta.5",
3
+ "version": "4.0.0-beta.6",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -67,7 +67,7 @@
67
67
  "@types/node": "^20.14.8",
68
68
  "lightningcss": "^1.26.0",
69
69
  "dedent": "1.5.3",
70
- "@tailwindcss/oxide": "4.0.0-beta.5"
70
+ "@tailwindcss/oxide": "4.0.0-beta.6"
71
71
  },
72
72
  "scripts": {
73
73
  "lint": "tsc --noEmit",