tailwindcss 4.0.5 → 4.0.7
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/chunk-CH45MXZF.mjs +10 -0
- package/dist/flatten-color-palette.js +1 -1
- package/dist/flatten-color-palette.mjs +1 -1
- package/dist/lib.d.mts +1 -1
- package/dist/lib.js +17 -17
- package/dist/lib.mjs +10 -10
- package/dist/plugin.d.mts +3 -2
- package/dist/plugin.d.ts +38 -38
- package/dist/plugin.js +1 -1
- package/dist/plugin.mjs +1 -1
- package/dist/{types-BTRmm49E.d.mts → types-B254mqw1.d.mts} +1 -1
- package/index.css +14 -12
- package/package.json +6 -2
- package/preflight.css +3 -3
- package/theme.css +6 -4
- package/dist/chunk-N4FJXYNV.mjs +0 -10
package/dist/plugin.d.mts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import { a as PluginFn, C as Config, b as PluginWithConfig, c as PluginWithOptions } from './types-
|
1
|
+
import { a as PluginFn, C as Config, b as PluginWithConfig, c as PluginWithOptions } from './types-B254mqw1.mjs';
|
2
|
+
export { d as PluginAPI, P as PluginsConfig, T as ThemeConfig } from './types-B254mqw1.mjs';
|
2
3
|
import './resolve-config-QUZ9b-Gn.mjs';
|
3
4
|
import './colors.mjs';
|
4
5
|
|
@@ -7,4 +8,4 @@ declare namespace createPlugin {
|
|
7
8
|
var withOptions: <T>(pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial<Config>) => PluginWithOptions<T>;
|
8
9
|
}
|
9
10
|
|
10
|
-
export { createPlugin as default };
|
11
|
+
export { Config, PluginFn as PluginCreator, createPlugin as default };
|
package/dist/plugin.d.ts
CHANGED
@@ -1,43 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-BIFUA2FY.js';
|
2
2
|
import './colors-b_6i0Oi7.js';
|
3
3
|
|
4
|
-
type ResolvableTo<T> = T | ((utils: PluginUtils) => T);
|
5
|
-
type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
|
6
|
-
type ThemeConfig = Record<string, ThemeValue> & {
|
7
|
-
extend?: Record<string, ThemeValue>;
|
8
|
-
};
|
9
|
-
type ContentFile = string | {
|
10
|
-
raw: string;
|
11
|
-
extension?: string;
|
12
|
-
};
|
13
|
-
type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
|
14
|
-
interface UserConfig {
|
15
|
-
presets?: UserConfig[];
|
16
|
-
theme?: ThemeConfig;
|
17
|
-
plugins?: Plugin[];
|
18
|
-
}
|
19
|
-
interface UserConfig {
|
20
|
-
content?: ContentFile[] | {
|
21
|
-
relative?: boolean;
|
22
|
-
files: ContentFile[];
|
23
|
-
};
|
24
|
-
}
|
25
|
-
interface UserConfig {
|
26
|
-
darkMode?: DarkModeStrategy;
|
27
|
-
}
|
28
|
-
interface UserConfig {
|
29
|
-
prefix?: string;
|
30
|
-
}
|
31
|
-
interface UserConfig {
|
32
|
-
blocklist?: string[];
|
33
|
-
}
|
34
|
-
interface UserConfig {
|
35
|
-
important?: boolean | string;
|
36
|
-
}
|
37
|
-
interface UserConfig {
|
38
|
-
future?: 'all' | Record<string, boolean>;
|
39
|
-
}
|
40
|
-
|
41
4
|
type Config = UserConfig;
|
42
5
|
type PluginFn = (api: PluginAPI) => void;
|
43
6
|
type PluginWithConfig = {
|
@@ -96,6 +59,43 @@ type CssInJs = {
|
|
96
59
|
[key: string]: string | string[] | CssInJs | CssInJs[];
|
97
60
|
};
|
98
61
|
|
62
|
+
type ResolvableTo<T> = T | ((utils: PluginUtils) => T);
|
63
|
+
type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
|
64
|
+
type ThemeConfig = Record<string, ThemeValue> & {
|
65
|
+
extend?: Record<string, ThemeValue>;
|
66
|
+
};
|
67
|
+
type ContentFile = string | {
|
68
|
+
raw: string;
|
69
|
+
extension?: string;
|
70
|
+
};
|
71
|
+
type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
|
72
|
+
interface UserConfig {
|
73
|
+
presets?: UserConfig[];
|
74
|
+
theme?: ThemeConfig;
|
75
|
+
plugins?: Plugin[];
|
76
|
+
}
|
77
|
+
interface UserConfig {
|
78
|
+
content?: ContentFile[] | {
|
79
|
+
relative?: boolean;
|
80
|
+
files: ContentFile[];
|
81
|
+
};
|
82
|
+
}
|
83
|
+
interface UserConfig {
|
84
|
+
darkMode?: DarkModeStrategy;
|
85
|
+
}
|
86
|
+
interface UserConfig {
|
87
|
+
prefix?: string;
|
88
|
+
}
|
89
|
+
interface UserConfig {
|
90
|
+
blocklist?: string[];
|
91
|
+
}
|
92
|
+
interface UserConfig {
|
93
|
+
important?: boolean | string;
|
94
|
+
}
|
95
|
+
interface UserConfig {
|
96
|
+
future?: 'all' | Record<string, boolean>;
|
97
|
+
}
|
98
|
+
|
99
99
|
declare function createPlugin(handler: PluginFn, config?: Partial<Config>): PluginWithConfig;
|
100
100
|
declare namespace createPlugin {
|
101
101
|
var withOptions: <T>(pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial<Config>) => PluginWithOptions<T>;
|
package/dist/plugin.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";function
|
1
|
+
"use strict";function g(i,n){return{handler:i,config:n}}g.withOptions=function(i,n=()=>({})){function t(o){return{handler:i(o),config:n(o)}}return t.__isOptionsFunction=!0,t};var u=g;module.exports=u;
|
package/dist/plugin.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
function
|
1
|
+
function g(n,i){return{handler:n,config:i}}g.withOptions=function(n,i=()=>({})){function t(o){return{handler:n(o),config:i(o)}}return t.__isOptionsFunction=!0,t};var u=g;export{u as default};
|
@@ -95,4 +95,4 @@ interface UserConfig {
|
|
95
95
|
future?: 'all' | Record<string, boolean>;
|
96
96
|
}
|
97
97
|
|
98
|
-
export type { Config as C, Plugin as P, UserConfig as U, PluginFn as a, PluginWithConfig as b, PluginWithOptions as c };
|
98
|
+
export type { Config as C, Plugin as P, ThemeConfig as T, UserConfig as U, PluginFn as a, PluginWithConfig as b, PluginWithOptions as c, PluginAPI as d };
|
package/index.css
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
@layer theme {
|
4
4
|
@theme default {
|
5
|
-
--font-sans:
|
5
|
+
--font-sans:
|
6
|
+
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
6
7
|
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
7
8
|
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
|
8
|
-
--font-mono:
|
9
|
-
|
9
|
+
--font-mono:
|
10
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
11
|
+
"Courier New", monospace;
|
10
12
|
|
11
13
|
--color-red-50: oklch(0.971 0.013 17.38);
|
12
14
|
--color-red-100: oklch(0.936 0.032 17.717);
|
@@ -359,12 +361,12 @@
|
|
359
361
|
--shadow-2xs: 0 1px rgb(0 0 0 / 0.05);
|
360
362
|
--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
361
363
|
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
362
|
-
--shadow-md:
|
363
|
-
0 2px 4px -2px rgb(0 0 0 / 0.1);
|
364
|
-
--shadow-lg:
|
365
|
-
0 4px 6px -4px rgb(0 0 0 / 0.1);
|
366
|
-
--shadow-xl:
|
367
|
-
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
364
|
+
--shadow-md:
|
365
|
+
0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
366
|
+
--shadow-lg:
|
367
|
+
0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
368
|
+
--shadow-xl:
|
369
|
+
0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
|
368
370
|
--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
369
371
|
|
370
372
|
--inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05);
|
@@ -597,15 +599,15 @@
|
|
597
599
|
"Liberation Mono",
|
598
600
|
"Courier New",
|
599
601
|
monospace
|
600
|
-
); /*
|
602
|
+
); /* 1 */
|
601
603
|
font-feature-settings: var(
|
602
604
|
--default-mono-font-feature-settings,
|
603
605
|
normal
|
604
|
-
); /*
|
606
|
+
); /* 2 */
|
605
607
|
font-variation-settings: var(
|
606
608
|
--default-mono-font-variation-settings,
|
607
609
|
normal
|
608
|
-
); /*
|
610
|
+
); /* 3 */
|
609
611
|
font-size: 1em; /* 4 */
|
610
612
|
}
|
611
613
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "tailwindcss",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.7",
|
4
4
|
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
5
5
|
"license": "MIT",
|
6
6
|
"repository": {
|
@@ -45,6 +45,10 @@
|
|
45
45
|
"require": "./dist/flatten-color-palette.js",
|
46
46
|
"import": "./dist/flatten-color-palette.mjs"
|
47
47
|
},
|
48
|
+
"./lib/util/flattenColorPalette.js": {
|
49
|
+
"require": "./dist/flatten-color-palette.js",
|
50
|
+
"import": "./dist/flatten-color-palette.mjs"
|
51
|
+
},
|
48
52
|
"./package.json": "./package.json",
|
49
53
|
"./index.css": "./index.css",
|
50
54
|
"./index": "./index.css",
|
@@ -71,7 +75,7 @@
|
|
71
75
|
"@types/node": "^20.14.8",
|
72
76
|
"lightningcss": "^1.29.1",
|
73
77
|
"dedent": "1.5.3",
|
74
|
-
"@tailwindcss/oxide": "^4.0.
|
78
|
+
"@tailwindcss/oxide": "^4.0.7"
|
75
79
|
},
|
76
80
|
"scripts": {
|
77
81
|
"lint": "tsc --noEmit",
|
package/preflight.css
CHANGED
@@ -128,9 +128,9 @@ pre {
|
|
128
128
|
'Liberation Mono',
|
129
129
|
'Courier New',
|
130
130
|
monospace
|
131
|
-
); /*
|
132
|
-
font-feature-settings: var(--default-mono-font-feature-settings, normal); /*
|
133
|
-
font-variation-settings: var(--default-mono-font-variation-settings, normal); /*
|
131
|
+
); /* 1 */
|
132
|
+
font-feature-settings: var(--default-mono-font-feature-settings, normal); /* 2 */
|
133
|
+
font-variation-settings: var(--default-mono-font-variation-settings, normal); /* 3 */
|
134
134
|
font-size: 1em; /* 4 */
|
135
135
|
}
|
136
136
|
|
package/theme.css
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
@theme default {
|
2
|
-
--font-sans:
|
3
|
-
'Segoe UI
|
2
|
+
--font-sans:
|
3
|
+
ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
4
|
+
'Noto Color Emoji';
|
4
5
|
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
5
|
-
--font-mono:
|
6
|
-
'Courier New',
|
6
|
+
--font-mono:
|
7
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
8
|
+
monospace;
|
7
9
|
|
8
10
|
--color-red-50: oklch(0.971 0.013 17.38);
|
9
11
|
--color-red-100: oklch(0.936 0.032 17.717);
|
package/dist/chunk-N4FJXYNV.mjs
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
function I(n){if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");var e=String(n),r=e.length,s=-1,t,l="",o=e.charCodeAt(0);if(r==1&&o==45)return"\\"+e;for(;++s<r;){if(t=e.charCodeAt(s),t==0){l+="\uFFFD";continue}if(t>=1&&t<=31||t==127||s==0&&t>=48&&t<=57||s==1&&t>=48&&t<=57&&o==45){l+="\\"+t.toString(16)+" ";continue}if(t>=128||t==45||t==95||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122){l+=e.charAt(s);continue}l+="\\"+e.charAt(s)}return l}function R(n){return n.replace(/\\([\dA-Fa-f]{1,6}[\t\n\f\r ]?|[\S\s])/g,e=>e.length>2?String.fromCodePoint(Number.parseInt(e.slice(1).trim(),16)):e[1])}var U=new Map([["--font",["--font-weight","--font-size"]],["--inset",["--inset-shadow","--inset-ring"]],["--text",["--text-color","--text-underline-offset","--text-indent","--text-decoration-thickness","--text-decoration-color"]]]);function D(n,e){return(U.get(e)??[]).some(r=>n===r||n.startsWith(`${r}-`))}var L=class{constructor(e=new Map,r=new Set([])){this.values=e;this.keyframes=r}prefix=null;add(e,r,s=0){if(e.endsWith("-*")){if(r!=="initial")throw new Error(`Invalid theme value \`${r}\` for namespace \`${e}\``);e==="--*"?this.values.clear():this.clearNamespace(e.slice(0,-2),0)}if(s&4){let t=this.values.get(e);if(t&&!(t.options&4))return}r==="initial"?this.values.delete(e):this.values.set(e,{value:r,options:s})}keysInNamespaces(e){let r=[];for(let s of e){let t=`${s}-`;for(let l of this.values.keys())l.startsWith(t)&&l.indexOf("--",2)===-1&&(D(l,s)||r.push(l.slice(t.length)))}return r}get(e){for(let r of e){let s=this.values.get(r);if(s)return s.value}return null}hasDefault(e){return(this.getOptions(e)&4)===4}getOptions(e){return e=R(this.#n(e)),this.values.get(e)?.options??0}entries(){return this.prefix?Array.from(this.values,e=>(e[0]=this.#r(e[0]),e)):this.values.entries()}#r(e){return this.prefix?`--${this.prefix}-${e.slice(2)}`:e}#n(e){return this.prefix?`--${e.slice(3+this.prefix.length)}`:e}clearNamespace(e,r){let s=U.get(e)??[];e:for(let t of this.values.keys())if(t.startsWith(e)){if(r!==0&&(this.getOptions(t)&r)!==r)continue;for(let l of s)if(t.startsWith(l))continue e;this.values.delete(t)}}#e(e,r){for(let s of r){let t=e!==null?`${s}-${e}`:s;if(!this.values.has(t))if(e!==null&&e.includes(".")){if(t=`${s}-${e.replaceAll(".","_")}`,!this.values.has(t))continue}else continue;if(!D(t,s))return t}return null}#t(e){return this.values.has(e)?`var(${I(this.#r(e))})`:null}markUsedVariable(e){let r=R(this.#n(e)),s=this.values.get(r);s&&(s.options|=16)}resolve(e,r){let s=this.#e(e,r);if(!s)return null;let t=this.values.get(s);return t.options&1?t.value:this.#t(s)}resolveValue(e,r){let s=this.#e(e,r);return s?this.values.get(s).value:null}resolveWith(e,r,s=[]){let t=this.#e(e,r);if(!t)return null;let l={};for(let u of s){let a=`${t}${u}`,i=this.values.get(a);i&&(i.options&1?l[u]=i.value:l[u]=this.#t(a))}let o=this.values.get(t);return o.options&1?[o.value,l]:[this.#t(t),l]}namespace(e){let r=new Map,s=`${e}-`;for(let[t,l]of this.values)t===e?r.set(null,l.value):t.startsWith(`${s}-`)?r.set(t.slice(e.length),l.value):t.startsWith(s)&&r.set(t.slice(s.length),l.value);return r}addKeyframes(e){this.keyframes.add(e)}getKeyframes(){return Array.from(this.keyframes)}};var N=class extends Map{constructor(r){super();this.factory=r}get(r){let s=super.get(r);return s===void 0&&(s=this.factory(r,this),this.set(r,s)),s}};var j=64;function G(n,e=[]){return{kind:"rule",selector:n,nodes:e}}function $(n,e="",r=[]){return{kind:"at-rule",name:n,params:e,nodes:r}}function M(n,e=[]){return n.charCodeAt(0)===j?x(n,e):G(n,e)}function _(n,e,r=!1){return{kind:"declaration",property:n,value:e,important:r}}function F(n){return{kind:"comment",value:n}}function oe(n,e){return{kind:"context",context:n,nodes:e}}function ae(n){return{kind:"at-root",nodes:n}}function b(n,e,r=[],s={}){for(let t=0;t<n.length;t++){let l=n[t],o=r[r.length-1]??null;if(l.kind==="context"){if(b(l.nodes,e,r,{...s,...l.context})===2)return 2;continue}r.push(l);let u=!1,a=0,i=e(l,{parent:o,context:s,path:r,replaceWith(f){u=!0,Array.isArray(f)?f.length===0?(n.splice(t,1),a=0):f.length===1?(n[t]=f[0],a=1):(n.splice(t,1,...f),a=f.length):(n[t]=f,a=1)}})??0;if(r.pop(),u){i===0?t--:t+=a-1;continue}if(i===2)return 2;if(i!==1&&"nodes"in l){r.push(l);let f=b(l.nodes,e,r,s);if(r.pop(),f===2)return 2}}}function W(n,e,r=[],s={}){for(let t=0;t<n.length;t++){let l=n[t],o=r[r.length-1]??null;if(l.kind==="rule"||l.kind==="at-rule")r.push(l),W(l.nodes,e,r,s),r.pop();else if(l.kind==="context"){W(l.nodes,e,r,{...s,...l.context});continue}r.push(l),e(l,{parent:o,context:s,path:r,replaceWith(u){Array.isArray(u)?u.length===0?n.splice(t,1):u.length===1?n[t]=u[0]:n.splice(t,1,...u):n[t]=u,t+=u.length-1}}),r.pop()}}function fe(n,e){let r=[],s=new Set,t=new N(()=>new Set),l=new Set,o=new Set;function u(i,f,h={},d=0){if(i.kind==="declaration"){if(i.property==="--tw-sort"||i.value===void 0||i.value===null)return;if(h.theme&&i.property[0]==="-"&&i.property[1]==="-"&&t.get(f).add(i),i.value.includes("var(")&&e.trackUsedVariables(i.value),i.property==="animation"){let c=i.value.split(/\s+/);for(let p of c)o.add(p)}f.push(i)}else if(i.kind==="rule")if(i.selector==="&")for(let c of i.nodes){let p=[];u(c,p,h,d+1),p.length>0&&f.push(...p)}else{let c={...i,nodes:[]};for(let p of i.nodes)u(p,c.nodes,h,d+1);c.nodes.length>0&&f.push(c)}else if(i.kind==="at-rule"&&i.name==="@property"&&d===0){if(s.has(i.params))return;s.add(i.params);let c={...i,nodes:[]};for(let p of i.nodes)u(p,c.nodes,h,d+1);f.push(c)}else if(i.kind==="at-rule"){let c={...i,nodes:[]};for(let p of i.nodes)u(p,c.nodes,h,d+1);i.name==="@keyframes"&&h.theme&&l.add(c),(c.nodes.length>0||c.name==="@layer"||c.name==="@charset"||c.name==="@custom-media"||c.name==="@namespace"||c.name==="@import")&&f.push(c)}else if(i.kind==="at-root")for(let c of i.nodes){let p=[];u(c,p,h,0);for(let g of p)r.push(g)}else if(i.kind==="context"){if(i.context.reference)return;for(let c of i.nodes)u(c,f,{...h,...i.context},d)}else i.kind==="comment"&&f.push(i)}let a=[];for(let i of n)u(i,a,{},0);e:for(let[i,f]of t)for(let h of f){if(e.theme.getOptions(h.property)&24){if(h.property.startsWith("--animate-")){let p=h.value.split(/\s+/);for(let g of p)o.add(g)}continue}let c=i.indexOf(h);if(i.splice(c,1),i.length===0){for(let[p,g]of a.entries())if(g.kind==="rule"&&g.nodes===i){a.splice(p,1);break}continue e}}for(let i of l)if(!o.has(i.params)){let f=r.indexOf(i);r.splice(f,1)}return a.concat(r)}function ue(n){function e(s,t=0){let l="",o=" ".repeat(t);if(s.kind==="declaration")l+=`${o}${s.property}: ${s.value}${s.important?" !important":""};
|
2
|
-
`;else if(s.kind==="rule"){l+=`${o}${s.selector} {
|
3
|
-
`;for(let u of s.nodes)l+=e(u,t+1);l+=`${o}}
|
4
|
-
`}else if(s.kind==="at-rule"){if(s.nodes.length===0)return`${o}${s.name} ${s.params};
|
5
|
-
`;l+=`${o}${s.name}${s.params?` ${s.params} `:" "}{
|
6
|
-
`;for(let u of s.nodes)l+=e(u,t+1);l+=`${o}}
|
7
|
-
`}else if(s.kind==="comment")l+=`${o}/*${s.value}*/
|
8
|
-
`;else if(s.kind==="context"||s.kind==="at-root")return"";return l}let r="";for(let s of n){let t=e(s);t!==""&&(r+=t)}return r}var y=92,C=47,k=42,H=34,z=39,Q=58,E=59,m=10,v=32,S=9,P=123,T=125,K=40,B=41,Y=91,q=93,V=45,w=64,X=33;function de(n){n=n.replaceAll(`\r
|
9
|
-
`,`
|
10
|
-
`);let e=[],r=[],s=[],t=null,l=null,o="",u="",a;for(let i=0;i<n.length;i++){let f=n.charCodeAt(i);if(f===y)o+=n.slice(i,i+2),i+=1;else if(f===C&&n.charCodeAt(i+1)===k){let h=i;for(let c=i+2;c<n.length;c++)if(a=n.charCodeAt(c),a===y)c+=1;else if(a===k&&n.charCodeAt(c+1)===C){i=c+1;break}let d=n.slice(h,i+1);d.charCodeAt(2)===X&&r.push(F(d.slice(2,-2)))}else if(f===z||f===H){let h=i;for(let d=i+1;d<n.length;d++)if(a=n.charCodeAt(d),a===y)d+=1;else if(a===f){i=d;break}else{if(a===E&&n.charCodeAt(d+1)===m)throw new Error(`Unterminated string: ${n.slice(h,d+1)+String.fromCharCode(f)}`);if(a===m)throw new Error(`Unterminated string: ${n.slice(h,d)+String.fromCharCode(f)}`)}o+=n.slice(h,i+1)}else{if((f===v||f===m||f===S)&&(a=n.charCodeAt(i+1))&&(a===v||a===m||a===S))continue;if(f===m){if(o.length===0)continue;a=o.charCodeAt(o.length-1),a!==v&&a!==m&&a!==S&&(o+=" ")}else if(f===V&&n.charCodeAt(i+1)===V&&o.length===0){let h="",d=i,c=-1;for(let g=i+2;g<n.length;g++)if(a=n.charCodeAt(g),a===y)g+=1;else if(a===C&&n.charCodeAt(g+1)===k){for(let A=g+2;A<n.length;A++)if(a=n.charCodeAt(A),a===y)A+=1;else if(a===k&&n.charCodeAt(A+1)===C){g=A+1;break}}else if(c===-1&&a===Q)c=o.length+g-d;else if(a===E&&h.length===0){o+=n.slice(d,g),i=g;break}else if(a===K)h+=")";else if(a===Y)h+="]";else if(a===P)h+="}";else if((a===T||n.length-1===g)&&h.length===0){i=g-1,o+=n.slice(d,g);break}else(a===B||a===q||a===T)&&h.length>0&&n[g]===h[h.length-1]&&(h=h.slice(0,-1));let p=O(o,c);if(!p)throw new Error("Invalid custom property, expected a value");t?t.nodes.push(p):e.push(p),o=""}else if(f===E&&o.charCodeAt(0)===w)l=x(o),t?t.nodes.push(l):e.push(l),o="",l=null;else if(f===E&&u[u.length-1]!==")"){let h=O(o);if(!h)throw o.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${o.trim()}\``);t?t.nodes.push(h):e.push(h),o=""}else if(f===P&&u[u.length-1]!==")")u+="}",l=M(o.trim()),t&&t.nodes.push(l),s.push(t),t=l,o="",l=null;else if(f===T&&u[u.length-1]!==")"){if(u==="")throw new Error("Missing opening {");if(u=u.slice(0,-1),o.length>0)if(o.charCodeAt(0)===w)l=x(o),t?t.nodes.push(l):e.push(l),o="",l=null;else{let d=o.indexOf(":");if(t){let c=O(o,d);if(!c)throw new Error(`Invalid declaration: \`${o.trim()}\``);t.nodes.push(c)}}let h=s.pop()??null;h===null&&t&&e.push(t),t=h,o="",l=null}else if(f===K)u+=")",o+="(";else if(f===B){if(u[u.length-1]!==")")throw new Error("Missing opening (");u=u.slice(0,-1),o+=")"}else{if(o.length===0&&(f===v||f===m||f===S))continue;o+=String.fromCharCode(f)}}}if(o.charCodeAt(0)===w&&e.push(x(o)),u.length>0&&t){if(t.kind==="rule")throw new Error(`Missing closing } at ${t.selector}`);if(t.kind==="at-rule")throw new Error(`Missing closing } at ${t.name} ${t.params}`)}return r.length>0?r.concat(e):e}function x(n,e=[]){for(let r=5;r<n.length;r++){let s=n.charCodeAt(r);if(s===v||s===K){let t=n.slice(0,r).trim(),l=n.slice(r).trim();return $(t,l,e)}}return $(n.trim(),"",e)}function O(n,e=n.indexOf(":")){if(e===-1)return null;let r=n.indexOf("!important",e+1);return _(n.slice(0,e).trim(),n.slice(e+1,r===-1?n.length:r).trim(),r!==-1)}export{de as a,I as b,R as c,L as d,N as e,G as f,$ as g,M as h,_ as i,F as j,oe as k,ae as l,b as m,W as n,fe as o,ue as p};
|