@teacss/preset-standard 0.6.3 → 0.6.4
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/README.md +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -139,12 +139,12 @@ has no public Theme field; programmatic consumers load the CSS entry with
|
|
|
139
139
|
`resolveEntryConfig()`.
|
|
140
140
|
|
|
141
141
|
```html
|
|
142
|
-
<html data-css-primary="blue" data-css-neutral="slate" data-css-
|
|
142
|
+
<html data-css-primary="blue" data-css-neutral="slate" data-css-appearance="dark">
|
|
143
143
|
<body><p class="text-color:primary-900">Global blue / slate / dark</p></body>
|
|
144
144
|
</html>
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
Only html role attributes, `data-css-
|
|
147
|
+
Only html role attributes, `data-css-appearance` and configured mode aliases select
|
|
148
148
|
colors. Descendants inherit; the same markers on descendants have no effect.
|
|
149
149
|
Missing, empty, unknown or undeclared role values use configured defaults.
|
|
150
150
|
Focused defaults to final global neutral while preserving explicit default
|
|
@@ -155,7 +155,7 @@ Changing root attributes switches registered candidates without regenerating CSS
|
|
|
155
155
|
Without a valid explicit mode, neither condition activates, even when `defaultMode` is
|
|
156
156
|
dark; `defaultMode` names the base table. OS conditions remain independent media
|
|
157
157
|
queries. `modeSelectors: { dark: ".night", light: ".day" }` adds optional aliases
|
|
158
|
-
on html. Canonical `data-css-
|
|
158
|
+
on html. Canonical `data-css-appearance` wins even when empty/invalid; conflicting
|
|
159
159
|
aliases select neither mode. Aliases are never implicit. Mode names preserve
|
|
160
160
|
case, spaces and punctuation; empty names, NUL and unpaired surrogates are invalid.
|
|
161
161
|
|
package/dist/index.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ interface Theme {
|
|
|
100
100
|
/**
|
|
101
101
|
* Non-default mode color overrides. `theme.colors` and
|
|
102
102
|
* `theme.semanticColors` are the default mode; each entry here (e.g. `dark`)
|
|
103
|
-
* contributes to the complete mapping for its `data-css-
|
|
103
|
+
* contributes to the complete mapping for its `data-css-appearance` on html (or a
|
|
104
104
|
* configured `dark`/`light` alias). Only declare values that differ. OS
|
|
105
105
|
* preference uses `@os-dark` / `@os-light`.
|
|
106
106
|
*/
|
|
@@ -116,7 +116,7 @@ interface Theme {
|
|
|
116
116
|
preflightBase?: Record<string, string | number>;
|
|
117
117
|
}
|
|
118
118
|
type CustomRule = Rule<Theme>;
|
|
119
|
-
/** Optional html selector aliases for `dark` / `light`; canonical `data-css-
|
|
119
|
+
/** Optional html selector aliases for `dark` / `light`; canonical `data-css-appearance` takes precedence. */
|
|
120
120
|
interface ModeSelectors {
|
|
121
121
|
dark?: string;
|
|
122
122
|
light?: string;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import{$ as e,$i as t,$n as n,$r as r,A as i,Aa as a,Bi as o,Bn as s,Br as c,C a
|
|
|
3
3
|
`||e[n]===`\r`||e[n]===`\f`)return;if(!Vi(e[n]))return n+1;let r=0;for(;n<e.length&&r<6&&Vi(e[n]);)n++,r++;return e[n]===`\r`&&e[n+1]===`
|
|
4
4
|
`?n+2:p(e[n])?n+1:n}function Wi(e,t){let n=t;for(;n<e.length;){if(Ui(e[n])){n++;continue}if(e[n]!==`\\`)break;let t=m(e,n);if(t==null)break;n=t}return n}function Gi(e,t=0){return Hi(e[t])?!0:e[t]===`\\`?m(e,t)!=null:e[t]===`-`?e[t+1]===`-`||Hi(e[t+1])||e[t+1]===`\\`&&m(e,t+1)!=null:!1}function h(e,t=0){if(Gi(e,t))return Wi(e,t)}function g(e){return h(e)===e.length}function _(e){let t=``;for(let n=0;n<e.length;){if(e[n]!==`\\`){t+=e[n],n++;continue}if(n++,n>=e.length)break;if(!Vi(e[n])){t+=e[n],n++;continue}let r=n;for(;n<e.length&&n-r<6&&Vi(e[n]);)n++;let i=Number.parseInt(e.slice(r,n),16);t+=i===0||i>1114111||i>=55296&&i<=57343?`�`:String.fromCodePoint(i),e[n]===`\r`&&e[n+1]===`
|
|
5
5
|
`?n+=2:p(e[n])&&n++}return t}const Ki=`(?:${Ze.join(`|`)})`,qi=RegExp(`^([+-]?\\d*(?:\\.\\d+)?(?:e[+-]?\\d+)?)(${Ki})?$`,`i`),Ji=/^([+-]?\d*(?:\.\d+)?(?:e[+-]?\d+)?)$/i,Yi=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?(?:deg|grad|rad|turn)$/i,Xi=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?%$/i,Zi=RegExp(`^[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?${re}$`,`i`),Qi={px:1,vw:100,vh:100,svw:100,svh:100,dvw:100,dvh:100,lvh:100,lvw:100},$i=RegExp(`^(${Object.keys(Qi).join(`|`)})$`,`i`),ea=/^\[(color|image|length|size|position|quoted|string):/i,ta=new Set([...Ze,`angle`,`color`,`dpcm`,`deg`,`dpi`,`dppx`,`flex`,`fr`,`frequency`,`grad`,`hz`,`integer`,`khz`,`length`,`ms`,`number`,`percentage`,`rad`,`raw-string`,`resolution`,`s`,`string`,`time`,`turn`,`url`,`x`]);function na(e){return e.length>2&&e.startsWith(`--`)&&g(e)}function ra(e){let t=0,n,r=-1;for(let i=0;i<e.length;i++){let a=e[i];if(n){a===`\\`?i++:a===n&&(n=void 0,r=-1);continue}if(a===`"`||a===`'`)n=a,r=i;else if(a===`\\`)i++;else if(a===`[`)t++;else if(a===`]`&&--t<0)return!1}if(r>=0){for(let n=r+1;n<e.length;n++)if(e[n]===`\\`)n++;else if(e[n]===`[`)t++;else if(e[n]===`]`&&--t<0)return!1}return t===0}function ia(e){let t=[],n;for(let r=0;r<e.length;r++){let i=e[r];if(!n&&ua(e,r)){let t=h(e,r);if(t!=null){if(e[r-1]!==`#`&&e[r-1]!==`@`&&e[t]===`(`&&_(e.slice(r,t)).toLowerCase()===`url`){let n=t+1;for(;p(e[n]);)n++;if(e[n]!==`"`&&e[n]!==`'`){let t=aa(e,n);if(t==null)return!1;r=t-1;continue}}r=t-1;continue}}if(i===`\\`){if(n&&/[\n\r\f]/.test(e[r+1]??``)){r+=e[r+1]===`\r`&&e[r+2]===`
|
|
6
|
-
`?2:1;continue}let t=m(e,r);if(t==null)return!1;r=t-1;continue}if(n){if(i===n)n=void 0;else if(/[\n\r\f]/.test(i))return!1;continue}if(i===`"`||i===`'`)n=i;else if(i===`/`&&e[r+1]===`*`){let t=e.indexOf(`*/`,r+2);if(t===-1)return!1;r=t+1}else if(i===`*`&&e[r+1]===`/`)return!1;else if(i===`(`||i===`[`||i===`{`)t.push(i===`(`?`)`:i===`[`?`]`:`}`);else if(i===`)`||i===`]`||i===`}`){if(t.pop()!==i)return!1}else if(i===`;`&&t.length===0)return!1}return n==null&&t.length===0}function aa(e,t){for(let n=t;n<e.length;n++){if(e[n]===`)`)return n+1;if(e[n]===`\\`){let t=m(e,n);if(t==null)return;n=t-1}}}function oa(e){return`"${e.replace(/[\0-\x1f\x7f"\\]/g,e=>e===`\0`?`�`:e===`"`||e===`\\`?`\\${e}`:`\\${e.charCodeAt(0).toString(16)} `)}"`}function sa(e){if(!e)return;let t=e.length-1;if(!(t<2||e.charCodeAt(0)!==91||e.charCodeAt(t)!==93)&&(e.charCodeAt(1)!==45||e.charCodeAt(2)!==45)){for(let n=1;n<t;n++)switch(e.charCodeAt(n)){case 34:case 39:case 40:case 41:case 58:case 59:case 91:case 92:case 93:case 95:case 96:case 123:case 125:return;case 42:case 47:if(e.charCodeAt(n+1)===42||e.charCodeAt(n+1)===47)return}return e.slice(1,t)}}function ca(e){let t=``;for(let n=0;n<e.length;n++)e[n]===`\\`&&e[n+1]===`_`?(t+=`_`,n++):t+=e[n]===`_`?` `:e[n];return t}function la(e,t){let n=0;for(;t>0&&e[--t]===`\\`;)n++;return n%2==1}function ua(e,t){if(t===0)return!0;let n=e[t-1];return n===`_`&&!la(e,t-1)||n!==`\\`&&!Ui(n)}function da(e,t,n,r){for(let i=t;i<n;i++)e[i]===`_`&&!la(e,i)&&!fa(e,i)&&r.add(i)}function fa(e,t){let n=t-1,r=0;for(;n>=0&&r<6&&/[0-9a-f]/i.test(e[n]);)n--,r++;return r>0&&e[n]===`\\`&&!la(e,n)}function pa(e,t,n){let r=e.lastIndexOf(`_`,n-1);for(;r>=t&&la(e,r);)r=e.lastIndexOf(`_`,r-1);return r}function ma(e,t,n){let r=pa(e,t,n);if(r<t)return n;if(r===n-1&&e[n]===`%`)return r;let i=_(e.slice(r+1,n)).toLowerCase();return ta.has(i)||i===`type`&&e[n]===`(`?r:n}function ha(e){return e!=null&&e>=`0`&&e<=`9`}function ga(e,t,n){let r=ha(e[n])||e[n]===`+`&&ha(e[n+1]);if(e[n-1]===`_`&&!la(e,n-1)&&r)return n-1;let i=n;for(;i>t&&ha(e[i-1]);)i--;if(i===n)return n;let a=n;for(;i>t&&e[i-1]===`_`&&!la(e,i-1);){a=--i;let n=i;for(;i>t&&ha(e[i-1]);)i--;if(i===n)break}return a}function _a(e){let t=[];return e.replace(/var\((--.+?)[,)]/g,(e,n)=>(t.push(n),e.replace(n,`--calc`))).replace(/(-?\d*\.?\d(?!-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,`$1 $2 `).replace(/--calc/g,()=>t.shift())}function va(e){let t=[],n=/(?:calc|clamp|max|min)\(/gi,r=0,i;for(;(i=n.exec(e))!==null;){if(!ua(e,i.index))continue;let a=Ca(e,n.lastIndex);a!=null&&(t.push(e.slice(r,i.index),_a(e.slice(i.index,a))),r=a,n.lastIndex=a)}return r===0?e:(t.push(e.slice(r)),t.join(``))}function ya(e,t){let n=e[t];if(n===`"`||n===`'`){for(let r=t+1;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r+1;return e.length}if(e[t]===`/`&&e[t+1]===`*`){let n=e.indexOf(`*/`,t+2);return n<0?e.length:n+2}}function ba(e,t){let n=t;for(;n<e.length;){if(p(e[n])||e[n]===`_`&&!la(e,n)){n++;continue}if(e[n]!==`/`||e[n+1]!==`*`)return n;let t=ya(e,n);if(t==null)return n;n=t}return n}function xa(e){let t=new Set,n=[];for(let r=0;r<e.length;){let i=ya(e,r);if(i!=null){r=i;continue}let a=h(e,r);if(a==null){r++;continue}if(!ua(e,r)){if(e[a]!==`(`){r=a;continue}let t=e.lastIndexOf(`_`,a-1);r=t>r?t+1:a;continue}if(e[a]!==`(`){r=a;continue}let o=pa(e,r,a);if(o>=r){r=o+1;continue}let s=_(e.slice(r,a)).toLowerCase();if(s===`url`){let t=Ca(e,a+1);if(t==null)break;n.push({start:r,end:t}),r=t;continue}if(s===`attr`||s===`env`||s===`var`){let n=ba(e,a+1),r=h(e,n);r!=null&&da(e,n,s===`attr`?ma(e,n,r):s===`env`?ga(e,n,r):r,t)}r=a+1}return{indexes:t,literals:n}}function Sa(e){let t=xa(e),n=0,r=``;for(let i=0;i<e.length;i++){let a=t.literals[n];if(a&&i===a.start){r+=e.slice(a.start,a.end),i=a.end-1,n++;continue}if(e[i]===`\\`&&e[i+1]===`_`){r+=`_`,i++;continue}r+=e[i]===`_`&&!t.indexes.has(i)?` `:e[i]}return r}function Ca(e,t){let n=1,r;for(let i=t;i<e.length;i++){let t=e[i];if(t===`\\`){i++;continue}if(r)t===r&&(r=void 0);else if(t===`"`||t===`'`)r=t;else if(t===`(`)n++;else if(t===`)`&&--n===0)return i+1}}function wa(e){let t=sa(e);if(t!==void 0)return t;if(!e?.startsWith(`[`)||!e.endsWith(`]`))return;let n=e.match(ea),r=e.slice(n?.[0].length??1,-1);if(!r||r===`=""`)return;let i=n?.[1];if(i===`quoted`)return ra(r)?oa(ca(r)):void 0;if(!ia(r))return;if(i===`string`){let e=ca(r);return ia(e)?e:void 0}na(r)&&(r=`var(${r})`);let a=va(Sa(r));return ia(a)?a:void 0}function Ta(e){return wa(e)}function v(e,t){if(e!=null&&Object.hasOwn(e,t))return e[t]}const Ea=[`hsl`,`hsla`,`hwb`,`lab`,`lch`,`oklab`,`oklch`,`rgb`,`rgba`],Da=[`srgb`,`srgb-linear`,`display-p3`,`display-p3-linear`,`a98-rgb`,`prophoto-rgb`,`rec2020`,`lab`,`oklab`,`xyz`,`xyz-d50`,`xyz-d65`],Oa=[`hsl`,`hwb`,`lch`,`oklch`],ka=[`shorter`,`longer`,`increasing`,`decreasing`];new RegExp([`%alpha`,`<alpha-value>`].map(e=>bi(e)).join(`|`),`g`),[...Da,...Oa,...ka],RegExp(`^(${Ea.join(`|`)})\\((.+)\\)$`,`i`);function y(e,t={}){let{syntax:n=`*`,inherits:r=!1,initialValue:i}=t,a={[Ai.shortcutsNoMerge]:!0,[Ai.noMerge]:!0,[Ai.variants]:()=>[{parent:``,layer:hi,selector:()=>`@property ${e}`}],syntax:JSON.stringify(n),inherits:r?`true`:`false`};return i!=null&&(a[`initial-value`]=i),a}function Aa(e,t,n=!1){if(e.length<=t.length+1||e[t.length]!==`(`||e.at(-1)!==`)`)return!1;let r=e.slice(0,t.length);if(n?r.toLowerCase()!==t.toLowerCase():r!==t)return!1;let i=1,a;for(let n=t.length+1;n<e.length;n++){let t=e[n];if(t===`\\`){n++;continue}if(a!=null){t===a&&(a=void 0);continue}if(t===`'`||t===`"`){a=t;continue}if(t===`(`)i++;else if(t===`)`&&--i===0)return n===e.length-1}return!1}const ja=new Set(a),Ma=String.raw`[+-]?(?:\d+|\d*\.\d+)(?:[eE][+-]?\d+)?`,Na=RegExp(`^${Ma}$`),Pa=RegExp(`^${Ma}%$`),Fa=RegExp(`^(${Ma})(s|ms)?$`,`i`),Ia=RegExp(`^(${Ma})(deg|rad|grad|turn)?$`,`i`),La=`color.border-color.background-color.outline-color.text-decoration-color.flex-grow.flex.flex-shrink.caret-color.font.gap.opacity.visibility.z-index.font-weight.zoom.text-shadow.transform.box-shadow.border.background-position.left.right.top.bottom.object-position.max-height.min-height.max-width.min-width.height.width.border-width.margin.padding.outline-width.outline-offset.font-size.line-height.text-indent.vertical-align.border-spacing.letter-spacing.word-spacing.stroke.filter.backdrop-filter.fill.mask.mask-size.mask-border.clip-path.clip.border-radius`.split(`.`);function b(e){return+e.toFixed(10)}function Ra(e){let t=e.match(qi);if(!t)return;let[,n,r]=t,i=Number.parseFloat(n);if(r&&Number.isFinite(i))return`${b(i)}${r}`}function za(e){if(e===`auto`)return`auto`}function Ba(e){if(e===`empty`)return`""`}function Va(e){if(e===`square`)return`1/1`}function Ha(e){if(e===`video`)return`16/9`}function Ua(e){if(!e)return;if($i.test(e))return`${Qi[e.toLowerCase()]}${e}`;let t=e.match(qi);if(!t)return;let[,n,r]=t,i=Number.parseFloat(n);if(Number.isFinite(i))return i===0?`0`:r?`${b(i)}${r}`:`${b(i/4)}rem`}function Wa(e){if($i.test(e))return`${Qi[e.toLowerCase()]}${e}`;let t=e?.match(qi);if(!t)return;let[,n,r]=t,i=Number.parseFloat(n);if(Number.isFinite(i))return r?`${b(i)}${r}`:`${b(i)}px`}function Ga(e){if(!Ji.test(e))return;let t=Number.parseFloat(e);if(Number.isFinite(t))return b(t)}function Ka(e){if(/^-?\d+$/.test(e))return e}function qa(e){if(/^[1-9]\d*$/.test(e))return e}function Ja(e){if(!g(e))return;let t=_(e).toLowerCase();if(!(t==="default"||ja.has(t)))return e}function Ya(e){if(e.length>5&&Aa(e,`url`,!0))return e}function Xa(e){if(Pa.test(e))return e;if(Ji.test(e)){let t=Number.parseFloat(e);if(Number.isFinite(t))return`${b(t)}%`}}function Za(e){return/^\d*\.\d+$/.test(e)?e:Xa(e)}function Qa(e){if(!e)return;let t=e.indexOf(`/`);if(t<=0||t!==e.lastIndexOf(`/`)||t===e.length-1)return;let n=e.slice(0,t),r=e.slice(t+1);if(!Na.test(n)||!Na.test(r))return;let i=Number(r);if(i===0)return;let a=Number(n)/i;if(Number.isFinite(a))return a===0?`0`:`${b(a*100)}%`}function $a(e){let t=Ga(e);if(t!=null)return Number(t)===0?`0`:`calc(var(--spacing) * ${t})`}function eo(e){return Ta(e)}function to(e){if(!/^\$[^\s'"`;{}]/.test(e))return;let t=e.slice(1),n=t.indexOf(`|`),r=n===-1?t:t.slice(0,n),i=n===-1?void 0:t.slice(n+1);if(!r||/[,@\s'"`;{}]/.test(r)||n!==-1&&!i)return;let a=i;if(i?.startsWith(`$`)){if(a=to(i),a==null)return}else if(i!=null&&!ia(i))return;return`var(--${xi(r)}${a?`, ${a}`:``})`}function no(e){let t=e.match(Fa);if(!t)return;let[,n,r]=t,i=Number(n);if(Number.isFinite(i))return i===0&&!r?`0s`:r?`${b(i)}${r}`:`${b(i)}ms`}function ro(e){let t=e.match(Ia);if(!t)return;let[,n,r]=t,i=Number(n);if(Number.isFinite(i))return i===0&&!r?`0`:r?`${b(i)}${r}`:`${b(i)}deg`}function io(e){if(ja.has(e))return e}function ao(e){if(e.split(`,`).every(e=>La.includes(e)))return e}function oo(e){if([`top`,`left`,`right`,`bottom`,`center`].includes(e))return e}function so(e){if([`top`,`bottom`,`left`,`right`,`center`,`top-left`,`top-right`,`bottom-left`,`bottom-right`].includes(e))return e}function co(e){if(e===`none`)return`none`}function lo(e){if(e===`none`||e===`zero`)return`0`}function uo(e){return eo(e)??to(e)}function fo(e){return uo(e)??io(e)}function x(e,t,n){return[e,([,e])=>({[t]:uo(e)}),{autocomplete:n}]}function S(e,t,n){return[e,([,e])=>({[t]:fo(e)}),{autocomplete:n}]}function po(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function mo(e,t,n={}){let{as:r=`record`,dedupe:i=!0,ignores:a=[]}=n,o=new Set,s=a.length?new Set(a.map(String)):void 0,c=t??(e=>e);if(r===`map`){let t=new Map;for(let n of e){let e=String(n);s?.has(e)||i&&o.has(e)||(o.add(e),t.set(e,c(e)))}return t}let l={};for(let t of e){let e=String(t);if(s?.has(e)||i&&o.has(e))continue;o.add(e);let n=c(e);e===`__proto__`?po(l,e,n):l[e]=n}return l}function ho(e,t={}){return mo(e,e=>e.includes(`-`)?e.replaceAll(`-`,` `):e,t)}function go(e){let t=new Set,n=[];for(let r of e)r&&(t.has(r)||(t.add(r),n.push(r)));return n}function _o(e){let t=new Set,n=[];for(let r of e){let e=String(r);if(!e)throw TypeError(`makeStaticRules requires non-empty enum values; use shortcuts for bare names`);t.has(e)||(t.add(e),n.push(e))}return n}function vo(e){if(!e)return()=>void 0;if(typeof e==`function`)return e;if(e instanceof Map)return t=>e.get(t);let t=e;return e=>v(t,e)}function yo(e,t){let n=(e??``).trim(),r=vo(t);return e=>{let t=r(e);if(t!=null&&typeof t!=`string`&&typeof t!=`number`)return t;if(!n)throw Error(`makeStaticRules requires a non-empty property`);return{[n]:t??e}}}function C(e,t,n={}){if(`bareExclude`in n)throw TypeError(`makeStaticRules no longer accepts bareExclude; use shortcuts for bare names`);let r=typeof e==`string`?[e]:e;if(!Array.isArray(r)||r.some(e=>typeof e!=`string`))throw TypeError(`makeStaticRules requires declaration prefixes; false is no longer supported, use shortcuts for bare names`);let{valueMap:i,meta:a}=n,o=go(r),s=_o(t);if(o.length===0||s.length===0)return[];let c=yo(n.property??o[0],i),l=[];for(let e of o)for(let t of s){let n=`${e}:${t}`;l.push(a?[n,c(t),a]:[n,c(t)])}return l}const bo=a.join(`|`),xo=new Set(a),So=Symbol.for(`@teacss/rule-helpers/global-rule-name`);function Co(e){return e[2]?.[So]}function wo(e){if(e.flags)return;let t=e.source;if(!t.startsWith(`^`))return;let n=1;for(;n<t.length&&/[A-Za-z0-9_-]/.test(t[n]);)n++;return t[n]===`:`?t.slice(1,n):void 0}function w(e,t,n={}){let r=C(e,t.filter(e=>!xo.has(String(e))),n),i=go(typeof e==`string`?[e]:e);if(i.length===0)return r;let a=yo(n.property??i[0],n.valueMap),o=n.meta?.autocomplete,s=typeof o==`string`?[o]:o??[],c=n.meta?.prefix==null?[``]:ji(n.meta.prefix);for(let e of i){let t={...n.meta,autocomplete:[...s,...c.map(t=>`${t}${e}:<globalKeyword>`)],[So]:e},i=[RegExp(`^${bi(e)}:(${bo})$`),([,e])=>a(e),t];r.push(i)}if(n.escapeHatch){let e=(n.property??i[0]??``).trim();if(!e)throw Error(`escapeHatch requires a rule name or property`);for(let t of i){let i={...n.meta,autocomplete:[...s,...c.map(e=>`${e}${t}:[]`)]};r.push([RegExp(`^${bi(t)}:(.+)$`),([,t])=>({[e]:eo(t)??to(t)}),i])}}return r}function To(e,t){let n=e.lastIndexOf(`:`);return n<=0||!xo.has(e.slice(n+1))?!1:t.has(e.slice(0,n))}function Eo(e){let t=new Set;for(let n of e){let e=Co(n);e!=null&&t.add(e)}return t.size===0?[...e]:e.map(e=>{if(Ei(e)||Co(e)!=null)return e;let[n,r,i]=e,a=wo(n);if(a!=null&&!t.has(a))return e;let o=(e,n)=>{if(!To(e[0],t))return r(e,n)};return i==null?[n,o]:[n,o,i]})}function Do(e){let t=`>:not(:last-child)`;return e.includes(t)?`:where(${e})`:`:where(${e}${t})`}function Oo(e){if(Object.hasOwn(e,`__options`))throw Error(`"__options" is a reserved createValueHandler name`);let t=Object.keys(e),n=Object.create(Function.prototype),r=new WeakMap;function i(t){let i=Object.freeze([...t]),a=((t,n)=>{for(let r of i){let i=e[r](t,n);if(i!=null)return i}});return Object.defineProperty(a,"__options",{enumerable:!0,value:Object.freeze({sequence:Object.freeze([...i])})}),r.set(a,i),Object.setPrototypeOf(a,n),a}function a(e){for(let n of t)Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get(){let e=i([...r.get(this)??[],n]);return Object.defineProperty(this,n,{enumerable:!0,configurable:!0,value:e}),e}})}a(n);let o=i([]);return a(o),o}const ko=Oo(Object.freeze({alpha:Za,auto:za,bracket:eo,cssvar:to,customIdent:Ja,degree:ro,empty:Ba,fraction:Qa,global:io,integer:Ka,none:co,number:Ga,numberWithUnit:Ra,percent:Xa,placement:so,position:oo,positiveInteger:qa,properties:ao,px:Wa,rem:Ua,spacing:$a,square:Va,time:no,url:Ya,video:Ha,zero:lo})),T=ko;function Ao(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n===0)return!1;if(n>=55296&&n<=56319){let n=e.charCodeAt(++t);if(!(n>=56320&&n<=57343))return!1}else if(n>=56320&&n<=57343)return!1}return!0}function jo(e){return`"${e.replace(/["\\\x00-\x1f\x7f]/g,e=>e===`"`||e===`\\`?`\\${e}`:`\\${e.charCodeAt(0).toString(16)} `)}"`}function Mo(e){let t=e=>{if(!e||!Ao(e))throw TypeError(`[Teacss] invalid mode name ${JSON.stringify(e)}`)},n=v(e,`defaultMode`);n!==void 0&&t(n);for(let n of Object.keys(v(e,`modes`)??{}))t(n);if(Object.hasOwn(e,`themes`))throw TypeError(`Theme.themes was removed; use CSS role candidate lists and data-css-<role> on html`)}const No=(e,t)=>`[data-css-${e}=${jo(t)}]`;function Po(e,t){let n=e===`dark`||e===`light`?v(t,e):void 0;if(!n)return`html${No(`scheme`,e)}`;let r=v(t,e===`dark`?`light`:`dark`);return`html:is(${No(`scheme`,e)},:not([data-css-scheme]):is(${n})${r?`:not(${r})`:``})`}function Fo(e,t){return`html${No(e,t)}`}function Io(e,t){let n=Po(e,t);return`:is(:root:where(${n}),:where(${n}) *)`}function Lo({important:e}){return e?[e=>{e.selector.startsWith(`@property `)||e.entries.forEach(e=>{e[0]!==gi&&e[1]!=null&&!String(e[1]).endsWith(`!important`)&&(e[1]+=` !important`)})}]:[]}function Ro(e,t){let n=``,r=0,i=0,a,o;for(let s=0;s<e.length;s++){let c=e[s];if(c===`\\`){s=(m(e,s)??s+2)-1;continue}if(a){c===a&&(a=void 0);continue}if(c===`'`||c===`"`){a=c;continue}if(c===`/`&&e[s+1]===`*`){let t=e.indexOf(`*/`,s+2);s=t<0?e.length:t+1;continue}let l=i?void 0:t.find(t=>e.startsWith(t,s));if(l){if(o&&o!==l)return;o&&(n+=e.slice(r,s),r=s+l.length),o=l,s+=l.length-1}else c===`(`||c===`[`?i++:(c===`)`||c===`]`)&&i--}return n+e.slice(r)}function zo(e){let t=[`dark`,`light`].map(t=>Io(t,e.modeSelectors));return e=>{if(!t.some(t=>e.selector.includes(t)))return;let n=Ii(e.selector).map(e=>Ro(e,t)).filter(e=>e!==void 0);if(!n.length)return[];e.selector=n.join(`,`)}}function Bo(e,t){let n=e.indexOf(`*/`,t+2);return n===-1?e.length:n+2}function Vo(e,t){let n=t;for(;n<e.length;){if(p(e[n])){n++;continue}if(e[n]!==`/`||e[n+1]!==`*`)break;n=Bo(e,n)}return n}function Ho(e,t){let n=e[t],r=t+1;for(;r<e.length;){if(e[r]===`\\`){r+=2;continue}if(e[r]===n)return r+1;r++}return r}function Uo(e,t,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a];if(o===`"`||o===`'`){a=Ho(e,a)-1;continue}if(o===`/`&&e[a+1]===`*`){a=Bo(e,a)-1;continue}if(Ui(o)||o===`\\`){let o=Wi(e,a),s=_(e.slice(a,o));if(e[o]===`(`){let e=s.toLowerCase();r.push({name:e,firstArgument:!0}),e===`url`&&i++,a=o;continue}if(i===0&&s.startsWith(`--`)){let i=r.at(-1);i?.name===`var`&&i.firstArgument&&n({decoded:s,start:a,end:o,kind:`reference`}),t&&e[Vo(e,o)]===`:`&&n({decoded:s,start:a,end:o,kind:`declaration`})}a=o-1;continue}o===`(`?r.push({firstArgument:!0}):o===`)`?r.pop()?.name===`url`&&i--:o===`,`&&r.length>0&&(r[r.length-1].firstArgument=!1)}}function Wo(e){let t=[];return Uo(e,!1,({decoded:e})=>t.push(e)),t}function Go(e,t){let n=_(e);return n.startsWith(`--T-`)?xi(`--${t}${n.slice(4)}`):e}function Ko(e,t,n=!1){return qo(e,e=>e.startsWith(`--T-`)?xi(`--${t}${e.slice(4)}`):void 0,n)}function qo(e,t,n){let r=[];if(Uo(e,n,e=>{let n=t(e.decoded);n!==void 0&&r.push({...e,replacement:n})}),r.length===0)return e;let i=``,a=0;for(let t of r)t.start<a||(i+=e.slice(a,t.start),i+=t.replacement,a=t.end);return i+e.slice(a)}function Jo({variablePrefix:e}){return e==null||e===`T-`?[]:[t=>{let n=`@property `;t.selector.startsWith(n)&&(t.selector=n+Go(t.selector.slice(10),e));for(let n of t.entries){let t=n[0]===gi;!t&&typeof n[0]==`string`&&(n[0]=Go(n[0],e)),typeof n[1]==`string`&&(n[1]=Ko(n[1],e,t))}}]}function Yo(e){return[zo(e),...Jo(e),...Lo(e)]}const Xo={sans:`'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,classic:`'IBM Plex Serif', ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif`,mono:`'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace`},Zo={"1x":`100`,"2x":`200`,"3x":`300`,"4x":`400`,"5x":`500`,"6x":`600`,"7x":`700`,"8x":`800`,"9x":`900`},Qo={"1x":`0.75rem`,"2x":`0.875rem`,"3x":`1rem`,"4x":`1.125rem`,"5x":`1.25rem`,"6x":`1.5rem`,"7x":`1.75rem`,"8x":`2.25rem`,"9x":`3.75rem`},$o={"1x":`1rem`,"2x":`1.25rem`,"3x":`1.5rem`,"4x":`1.625rem`,"5x":`1.75rem`,"6x":`1.875rem`,"7x":`2.25rem`,"8x":`2.5rem`,"9x":`3.75rem`},es={"1x":`0.0025em`,"2x":`0em`,"3x":`0em`,"4x":`-0.0025em`,"5x":`-0.005em`,"6x":`-0.00625em`,"7x":`-0.0075em`,"8x":`-0.01em`,"9x":`-0.025em`},ts={"1x":`-0.05em`,"2x":`-0.025em`,"3x":`-0.0125em`,"4x":`-0.00625em`,"5x":`0em`,"6x":`0.00625em`,"7x":`0.0125em`,"8x":`0.025em`,"9x":`0.05em`};function ns(e){return e.replace(/\/\*[\s\S]*?\*\//g,``).trim().replace(/\s+/g,` `)}const rs=ns(`
|
|
6
|
+
`?2:1;continue}let t=m(e,r);if(t==null)return!1;r=t-1;continue}if(n){if(i===n)n=void 0;else if(/[\n\r\f]/.test(i))return!1;continue}if(i===`"`||i===`'`)n=i;else if(i===`/`&&e[r+1]===`*`){let t=e.indexOf(`*/`,r+2);if(t===-1)return!1;r=t+1}else if(i===`*`&&e[r+1]===`/`)return!1;else if(i===`(`||i===`[`||i===`{`)t.push(i===`(`?`)`:i===`[`?`]`:`}`);else if(i===`)`||i===`]`||i===`}`){if(t.pop()!==i)return!1}else if(i===`;`&&t.length===0)return!1}return n==null&&t.length===0}function aa(e,t){for(let n=t;n<e.length;n++){if(e[n]===`)`)return n+1;if(e[n]===`\\`){let t=m(e,n);if(t==null)return;n=t-1}}}function oa(e){return`"${e.replace(/[\0-\x1f\x7f"\\]/g,e=>e===`\0`?`�`:e===`"`||e===`\\`?`\\${e}`:`\\${e.charCodeAt(0).toString(16)} `)}"`}function sa(e){if(!e)return;let t=e.length-1;if(!(t<2||e.charCodeAt(0)!==91||e.charCodeAt(t)!==93)&&(e.charCodeAt(1)!==45||e.charCodeAt(2)!==45)){for(let n=1;n<t;n++)switch(e.charCodeAt(n)){case 34:case 39:case 40:case 41:case 58:case 59:case 91:case 92:case 93:case 95:case 96:case 123:case 125:return;case 42:case 47:if(e.charCodeAt(n+1)===42||e.charCodeAt(n+1)===47)return}return e.slice(1,t)}}function ca(e){let t=``;for(let n=0;n<e.length;n++)e[n]===`\\`&&e[n+1]===`_`?(t+=`_`,n++):t+=e[n]===`_`?` `:e[n];return t}function la(e,t){let n=0;for(;t>0&&e[--t]===`\\`;)n++;return n%2==1}function ua(e,t){if(t===0)return!0;let n=e[t-1];return n===`_`&&!la(e,t-1)||n!==`\\`&&!Ui(n)}function da(e,t,n,r){for(let i=t;i<n;i++)e[i]===`_`&&!la(e,i)&&!fa(e,i)&&r.add(i)}function fa(e,t){let n=t-1,r=0;for(;n>=0&&r<6&&/[0-9a-f]/i.test(e[n]);)n--,r++;return r>0&&e[n]===`\\`&&!la(e,n)}function pa(e,t,n){let r=e.lastIndexOf(`_`,n-1);for(;r>=t&&la(e,r);)r=e.lastIndexOf(`_`,r-1);return r}function ma(e,t,n){let r=pa(e,t,n);if(r<t)return n;if(r===n-1&&e[n]===`%`)return r;let i=_(e.slice(r+1,n)).toLowerCase();return ta.has(i)||i===`type`&&e[n]===`(`?r:n}function ha(e){return e!=null&&e>=`0`&&e<=`9`}function ga(e,t,n){let r=ha(e[n])||e[n]===`+`&&ha(e[n+1]);if(e[n-1]===`_`&&!la(e,n-1)&&r)return n-1;let i=n;for(;i>t&&ha(e[i-1]);)i--;if(i===n)return n;let a=n;for(;i>t&&e[i-1]===`_`&&!la(e,i-1);){a=--i;let n=i;for(;i>t&&ha(e[i-1]);)i--;if(i===n)break}return a}function _a(e){let t=[];return e.replace(/var\((--.+?)[,)]/g,(e,n)=>(t.push(n),e.replace(n,`--calc`))).replace(/(-?\d*\.?\d(?!-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,`$1 $2 `).replace(/--calc/g,()=>t.shift())}function va(e){let t=[],n=/(?:calc|clamp|max|min)\(/gi,r=0,i;for(;(i=n.exec(e))!==null;){if(!ua(e,i.index))continue;let a=Ca(e,n.lastIndex);a!=null&&(t.push(e.slice(r,i.index),_a(e.slice(i.index,a))),r=a,n.lastIndex=a)}return r===0?e:(t.push(e.slice(r)),t.join(``))}function ya(e,t){let n=e[t];if(n===`"`||n===`'`){for(let r=t+1;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r+1;return e.length}if(e[t]===`/`&&e[t+1]===`*`){let n=e.indexOf(`*/`,t+2);return n<0?e.length:n+2}}function ba(e,t){let n=t;for(;n<e.length;){if(p(e[n])||e[n]===`_`&&!la(e,n)){n++;continue}if(e[n]!==`/`||e[n+1]!==`*`)return n;let t=ya(e,n);if(t==null)return n;n=t}return n}function xa(e){let t=new Set,n=[];for(let r=0;r<e.length;){let i=ya(e,r);if(i!=null){r=i;continue}let a=h(e,r);if(a==null){r++;continue}if(!ua(e,r)){if(e[a]!==`(`){r=a;continue}let t=e.lastIndexOf(`_`,a-1);r=t>r?t+1:a;continue}if(e[a]!==`(`){r=a;continue}let o=pa(e,r,a);if(o>=r){r=o+1;continue}let s=_(e.slice(r,a)).toLowerCase();if(s===`url`){let t=Ca(e,a+1);if(t==null)break;n.push({start:r,end:t}),r=t;continue}if(s===`attr`||s===`env`||s===`var`){let n=ba(e,a+1),r=h(e,n);r!=null&&da(e,n,s===`attr`?ma(e,n,r):s===`env`?ga(e,n,r):r,t)}r=a+1}return{indexes:t,literals:n}}function Sa(e){let t=xa(e),n=0,r=``;for(let i=0;i<e.length;i++){let a=t.literals[n];if(a&&i===a.start){r+=e.slice(a.start,a.end),i=a.end-1,n++;continue}if(e[i]===`\\`&&e[i+1]===`_`){r+=`_`,i++;continue}r+=e[i]===`_`&&!t.indexes.has(i)?` `:e[i]}return r}function Ca(e,t){let n=1,r;for(let i=t;i<e.length;i++){let t=e[i];if(t===`\\`){i++;continue}if(r)t===r&&(r=void 0);else if(t===`"`||t===`'`)r=t;else if(t===`(`)n++;else if(t===`)`&&--n===0)return i+1}}function wa(e){let t=sa(e);if(t!==void 0)return t;if(!e?.startsWith(`[`)||!e.endsWith(`]`))return;let n=e.match(ea),r=e.slice(n?.[0].length??1,-1);if(!r||r===`=""`)return;let i=n?.[1];if(i===`quoted`)return ra(r)?oa(ca(r)):void 0;if(!ia(r))return;if(i===`string`){let e=ca(r);return ia(e)?e:void 0}na(r)&&(r=`var(${r})`);let a=va(Sa(r));return ia(a)?a:void 0}function Ta(e){return wa(e)}function v(e,t){if(e!=null&&Object.hasOwn(e,t))return e[t]}const Ea=[`hsl`,`hsla`,`hwb`,`lab`,`lch`,`oklab`,`oklch`,`rgb`,`rgba`],Da=[`srgb`,`srgb-linear`,`display-p3`,`display-p3-linear`,`a98-rgb`,`prophoto-rgb`,`rec2020`,`lab`,`oklab`,`xyz`,`xyz-d50`,`xyz-d65`],Oa=[`hsl`,`hwb`,`lch`,`oklch`],ka=[`shorter`,`longer`,`increasing`,`decreasing`];new RegExp([`%alpha`,`<alpha-value>`].map(e=>bi(e)).join(`|`),`g`),[...Da,...Oa,...ka],RegExp(`^(${Ea.join(`|`)})\\((.+)\\)$`,`i`);function y(e,t={}){let{syntax:n=`*`,inherits:r=!1,initialValue:i}=t,a={[Ai.shortcutsNoMerge]:!0,[Ai.noMerge]:!0,[Ai.variants]:()=>[{parent:``,layer:hi,selector:()=>`@property ${e}`}],syntax:JSON.stringify(n),inherits:r?`true`:`false`};return i!=null&&(a[`initial-value`]=i),a}function Aa(e,t,n=!1){if(e.length<=t.length+1||e[t.length]!==`(`||e.at(-1)!==`)`)return!1;let r=e.slice(0,t.length);if(n?r.toLowerCase()!==t.toLowerCase():r!==t)return!1;let i=1,a;for(let n=t.length+1;n<e.length;n++){let t=e[n];if(t===`\\`){n++;continue}if(a!=null){t===a&&(a=void 0);continue}if(t===`'`||t===`"`){a=t;continue}if(t===`(`)i++;else if(t===`)`&&--i===0)return n===e.length-1}return!1}const ja=new Set(a),Ma=String.raw`[+-]?(?:\d+|\d*\.\d+)(?:[eE][+-]?\d+)?`,Na=RegExp(`^${Ma}$`),Pa=RegExp(`^${Ma}%$`),Fa=RegExp(`^(${Ma})(s|ms)?$`,`i`),Ia=RegExp(`^(${Ma})(deg|rad|grad|turn)?$`,`i`),La=`color.border-color.background-color.outline-color.text-decoration-color.flex-grow.flex.flex-shrink.caret-color.font.gap.opacity.visibility.z-index.font-weight.zoom.text-shadow.transform.box-shadow.border.background-position.left.right.top.bottom.object-position.max-height.min-height.max-width.min-width.height.width.border-width.margin.padding.outline-width.outline-offset.font-size.line-height.text-indent.vertical-align.border-spacing.letter-spacing.word-spacing.stroke.filter.backdrop-filter.fill.mask.mask-size.mask-border.clip-path.clip.border-radius`.split(`.`);function b(e){return+e.toFixed(10)}function Ra(e){let t=e.match(qi);if(!t)return;let[,n,r]=t,i=Number.parseFloat(n);if(r&&Number.isFinite(i))return`${b(i)}${r}`}function za(e){if(e===`auto`)return`auto`}function Ba(e){if(e===`empty`)return`""`}function Va(e){if(e===`square`)return`1/1`}function Ha(e){if(e===`video`)return`16/9`}function Ua(e){if(!e)return;if($i.test(e))return`${Qi[e.toLowerCase()]}${e}`;let t=e.match(qi);if(!t)return;let[,n,r]=t,i=Number.parseFloat(n);if(Number.isFinite(i))return i===0?`0`:r?`${b(i)}${r}`:`${b(i/4)}rem`}function Wa(e){if($i.test(e))return`${Qi[e.toLowerCase()]}${e}`;let t=e?.match(qi);if(!t)return;let[,n,r]=t,i=Number.parseFloat(n);if(Number.isFinite(i))return r?`${b(i)}${r}`:`${b(i)}px`}function Ga(e){if(!Ji.test(e))return;let t=Number.parseFloat(e);if(Number.isFinite(t))return b(t)}function Ka(e){if(/^-?\d+$/.test(e))return e}function qa(e){if(/^[1-9]\d*$/.test(e))return e}function Ja(e){if(!g(e))return;let t=_(e).toLowerCase();if(!(t==="default"||ja.has(t)))return e}function Ya(e){if(e.length>5&&Aa(e,`url`,!0))return e}function Xa(e){if(Pa.test(e))return e;if(Ji.test(e)){let t=Number.parseFloat(e);if(Number.isFinite(t))return`${b(t)}%`}}function Za(e){return/^\d*\.\d+$/.test(e)?e:Xa(e)}function Qa(e){if(!e)return;let t=e.indexOf(`/`);if(t<=0||t!==e.lastIndexOf(`/`)||t===e.length-1)return;let n=e.slice(0,t),r=e.slice(t+1);if(!Na.test(n)||!Na.test(r))return;let i=Number(r);if(i===0)return;let a=Number(n)/i;if(Number.isFinite(a))return a===0?`0`:`${b(a*100)}%`}function $a(e){let t=Ga(e);if(t!=null)return Number(t)===0?`0`:`calc(var(--spacing) * ${t})`}function eo(e){return Ta(e)}function to(e){if(!/^\$[^\s'"`;{}]/.test(e))return;let t=e.slice(1),n=t.indexOf(`|`),r=n===-1?t:t.slice(0,n),i=n===-1?void 0:t.slice(n+1);if(!r||/[,@\s'"`;{}]/.test(r)||n!==-1&&!i)return;let a=i;if(i?.startsWith(`$`)){if(a=to(i),a==null)return}else if(i!=null&&!ia(i))return;return`var(--${xi(r)}${a?`, ${a}`:``})`}function no(e){let t=e.match(Fa);if(!t)return;let[,n,r]=t,i=Number(n);if(Number.isFinite(i))return i===0&&!r?`0s`:r?`${b(i)}${r}`:`${b(i)}ms`}function ro(e){let t=e.match(Ia);if(!t)return;let[,n,r]=t,i=Number(n);if(Number.isFinite(i))return i===0&&!r?`0`:r?`${b(i)}${r}`:`${b(i)}deg`}function io(e){if(ja.has(e))return e}function ao(e){if(e.split(`,`).every(e=>La.includes(e)))return e}function oo(e){if([`top`,`left`,`right`,`bottom`,`center`].includes(e))return e}function so(e){if([`top`,`bottom`,`left`,`right`,`center`,`top-left`,`top-right`,`bottom-left`,`bottom-right`].includes(e))return e}function co(e){if(e===`none`)return`none`}function lo(e){if(e===`none`||e===`zero`)return`0`}function uo(e){return eo(e)??to(e)}function fo(e){return uo(e)??io(e)}function x(e,t,n){return[e,([,e])=>({[t]:uo(e)}),{autocomplete:n}]}function S(e,t,n){return[e,([,e])=>({[t]:fo(e)}),{autocomplete:n}]}function po(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function mo(e,t,n={}){let{as:r=`record`,dedupe:i=!0,ignores:a=[]}=n,o=new Set,s=a.length?new Set(a.map(String)):void 0,c=t??(e=>e);if(r===`map`){let t=new Map;for(let n of e){let e=String(n);s?.has(e)||i&&o.has(e)||(o.add(e),t.set(e,c(e)))}return t}let l={};for(let t of e){let e=String(t);if(s?.has(e)||i&&o.has(e))continue;o.add(e);let n=c(e);e===`__proto__`?po(l,e,n):l[e]=n}return l}function ho(e,t={}){return mo(e,e=>e.includes(`-`)?e.replaceAll(`-`,` `):e,t)}function go(e){let t=new Set,n=[];for(let r of e)r&&(t.has(r)||(t.add(r),n.push(r)));return n}function _o(e){let t=new Set,n=[];for(let r of e){let e=String(r);if(!e)throw TypeError(`makeStaticRules requires non-empty enum values; use shortcuts for bare names`);t.has(e)||(t.add(e),n.push(e))}return n}function vo(e){if(!e)return()=>void 0;if(typeof e==`function`)return e;if(e instanceof Map)return t=>e.get(t);let t=e;return e=>v(t,e)}function yo(e,t){let n=(e??``).trim(),r=vo(t);return e=>{let t=r(e);if(t!=null&&typeof t!=`string`&&typeof t!=`number`)return t;if(!n)throw Error(`makeStaticRules requires a non-empty property`);return{[n]:t??e}}}function C(e,t,n={}){if(`bareExclude`in n)throw TypeError(`makeStaticRules no longer accepts bareExclude; use shortcuts for bare names`);let r=typeof e==`string`?[e]:e;if(!Array.isArray(r)||r.some(e=>typeof e!=`string`))throw TypeError(`makeStaticRules requires declaration prefixes; false is no longer supported, use shortcuts for bare names`);let{valueMap:i,meta:a}=n,o=go(r),s=_o(t);if(o.length===0||s.length===0)return[];let c=yo(n.property??o[0],i),l=[];for(let e of o)for(let t of s){let n=`${e}:${t}`;l.push(a?[n,c(t),a]:[n,c(t)])}return l}const bo=a.join(`|`),xo=new Set(a),So=Symbol.for(`@teacss/rule-helpers/global-rule-name`);function Co(e){return e[2]?.[So]}function wo(e){if(e.flags)return;let t=e.source;if(!t.startsWith(`^`))return;let n=1;for(;n<t.length&&/[A-Za-z0-9_-]/.test(t[n]);)n++;return t[n]===`:`?t.slice(1,n):void 0}function w(e,t,n={}){let r=C(e,t.filter(e=>!xo.has(String(e))),n),i=go(typeof e==`string`?[e]:e);if(i.length===0)return r;let a=yo(n.property??i[0],n.valueMap),o=n.meta?.autocomplete,s=typeof o==`string`?[o]:o??[],c=n.meta?.prefix==null?[``]:ji(n.meta.prefix);for(let e of i){let t={...n.meta,autocomplete:[...s,...c.map(t=>`${t}${e}:<globalKeyword>`)],[So]:e},i=[RegExp(`^${bi(e)}:(${bo})$`),([,e])=>a(e),t];r.push(i)}if(n.escapeHatch){let e=(n.property??i[0]??``).trim();if(!e)throw Error(`escapeHatch requires a rule name or property`);for(let t of i){let i={...n.meta,autocomplete:[...s,...c.map(e=>`${e}${t}:[]`)]};r.push([RegExp(`^${bi(t)}:(.+)$`),([,t])=>({[e]:eo(t)??to(t)}),i])}}return r}function To(e,t){let n=e.lastIndexOf(`:`);return n<=0||!xo.has(e.slice(n+1))?!1:t.has(e.slice(0,n))}function Eo(e){let t=new Set;for(let n of e){let e=Co(n);e!=null&&t.add(e)}return t.size===0?[...e]:e.map(e=>{if(Ei(e)||Co(e)!=null)return e;let[n,r,i]=e,a=wo(n);if(a!=null&&!t.has(a))return e;let o=(e,n)=>{if(!To(e[0],t))return r(e,n)};return i==null?[n,o]:[n,o,i]})}function Do(e){let t=`>:not(:last-child)`;return e.includes(t)?`:where(${e})`:`:where(${e}${t})`}function Oo(e){if(Object.hasOwn(e,`__options`))throw Error(`"__options" is a reserved createValueHandler name`);let t=Object.keys(e),n=Object.create(Function.prototype),r=new WeakMap;function i(t){let i=Object.freeze([...t]),a=((t,n)=>{for(let r of i){let i=e[r](t,n);if(i!=null)return i}});return Object.defineProperty(a,"__options",{enumerable:!0,value:Object.freeze({sequence:Object.freeze([...i])})}),r.set(a,i),Object.setPrototypeOf(a,n),a}function a(e){for(let n of t)Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get(){let e=i([...r.get(this)??[],n]);return Object.defineProperty(this,n,{enumerable:!0,configurable:!0,value:e}),e}})}a(n);let o=i([]);return a(o),o}const ko=Oo(Object.freeze({alpha:Za,auto:za,bracket:eo,cssvar:to,customIdent:Ja,degree:ro,empty:Ba,fraction:Qa,global:io,integer:Ka,none:co,number:Ga,numberWithUnit:Ra,percent:Xa,placement:so,position:oo,positiveInteger:qa,properties:ao,px:Wa,rem:Ua,spacing:$a,square:Va,time:no,url:Ya,video:Ha,zero:lo})),T=ko;function Ao(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n===0)return!1;if(n>=55296&&n<=56319){let n=e.charCodeAt(++t);if(!(n>=56320&&n<=57343))return!1}else if(n>=56320&&n<=57343)return!1}return!0}function jo(e){return`"${e.replace(/["\\\x00-\x1f\x7f]/g,e=>e===`"`||e===`\\`?`\\${e}`:`\\${e.charCodeAt(0).toString(16)} `)}"`}function Mo(e){let t=e=>{if(!e||!Ao(e))throw TypeError(`[Teacss] invalid mode name ${JSON.stringify(e)}`)},n=v(e,`defaultMode`);n!==void 0&&t(n);for(let n of Object.keys(v(e,`modes`)??{}))t(n);if(Object.hasOwn(e,`themes`))throw TypeError(`Theme.themes was removed; use CSS role candidate lists and data-css-<role> on html`)}const No=(e,t)=>`[data-css-${e}=${jo(t)}]`;function Po(e,t){let n=e===`dark`||e===`light`?v(t,e):void 0;if(!n)return`html${No(`appearance`,e)}`;let r=v(t,e===`dark`?`light`:`dark`);return`html:is(${No(`appearance`,e)},:not([data-css-appearance]):is(${n})${r?`:not(${r})`:``})`}function Fo(e,t){return`html${No(e,t)}`}function Io(e,t){let n=Po(e,t);return`:is(:root:where(${n}),:where(${n}) *)`}function Lo({important:e}){return e?[e=>{e.selector.startsWith(`@property `)||e.entries.forEach(e=>{e[0]!==gi&&e[1]!=null&&!String(e[1]).endsWith(`!important`)&&(e[1]+=` !important`)})}]:[]}function Ro(e,t){let n=``,r=0,i=0,a,o;for(let s=0;s<e.length;s++){let c=e[s];if(c===`\\`){s=(m(e,s)??s+2)-1;continue}if(a){c===a&&(a=void 0);continue}if(c===`'`||c===`"`){a=c;continue}if(c===`/`&&e[s+1]===`*`){let t=e.indexOf(`*/`,s+2);s=t<0?e.length:t+1;continue}let l=i?void 0:t.find(t=>e.startsWith(t,s));if(l){if(o&&o!==l)return;o&&(n+=e.slice(r,s),r=s+l.length),o=l,s+=l.length-1}else c===`(`||c===`[`?i++:(c===`)`||c===`]`)&&i--}return n+e.slice(r)}function zo(e){let t=[`dark`,`light`].map(t=>Io(t,e.modeSelectors));return e=>{if(!t.some(t=>e.selector.includes(t)))return;let n=Ii(e.selector).map(e=>Ro(e,t)).filter(e=>e!==void 0);if(!n.length)return[];e.selector=n.join(`,`)}}function Bo(e,t){let n=e.indexOf(`*/`,t+2);return n===-1?e.length:n+2}function Vo(e,t){let n=t;for(;n<e.length;){if(p(e[n])){n++;continue}if(e[n]!==`/`||e[n+1]!==`*`)break;n=Bo(e,n)}return n}function Ho(e,t){let n=e[t],r=t+1;for(;r<e.length;){if(e[r]===`\\`){r+=2;continue}if(e[r]===n)return r+1;r++}return r}function Uo(e,t,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a];if(o===`"`||o===`'`){a=Ho(e,a)-1;continue}if(o===`/`&&e[a+1]===`*`){a=Bo(e,a)-1;continue}if(Ui(o)||o===`\\`){let o=Wi(e,a),s=_(e.slice(a,o));if(e[o]===`(`){let e=s.toLowerCase();r.push({name:e,firstArgument:!0}),e===`url`&&i++,a=o;continue}if(i===0&&s.startsWith(`--`)){let i=r.at(-1);i?.name===`var`&&i.firstArgument&&n({decoded:s,start:a,end:o,kind:`reference`}),t&&e[Vo(e,o)]===`:`&&n({decoded:s,start:a,end:o,kind:`declaration`})}a=o-1;continue}o===`(`?r.push({firstArgument:!0}):o===`)`?r.pop()?.name===`url`&&i--:o===`,`&&r.length>0&&(r[r.length-1].firstArgument=!1)}}function Wo(e){let t=[];return Uo(e,!1,({decoded:e})=>t.push(e)),t}function Go(e,t){let n=_(e);return n.startsWith(`--T-`)?xi(`--${t}${n.slice(4)}`):e}function Ko(e,t,n=!1){return qo(e,e=>e.startsWith(`--T-`)?xi(`--${t}${e.slice(4)}`):void 0,n)}function qo(e,t,n){let r=[];if(Uo(e,n,e=>{let n=t(e.decoded);n!==void 0&&r.push({...e,replacement:n})}),r.length===0)return e;let i=``,a=0;for(let t of r)t.start<a||(i+=e.slice(a,t.start),i+=t.replacement,a=t.end);return i+e.slice(a)}function Jo({variablePrefix:e}){return e==null||e===`T-`?[]:[t=>{let n=`@property `;t.selector.startsWith(n)&&(t.selector=n+Go(t.selector.slice(10),e));for(let n of t.entries){let t=n[0]===gi;!t&&typeof n[0]==`string`&&(n[0]=Go(n[0],e)),typeof n[1]==`string`&&(n[1]=Ko(n[1],e,t))}}]}function Yo(e){return[zo(e),...Jo(e),...Lo(e)]}const Xo={sans:`'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,classic:`'IBM Plex Serif', ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif`,mono:`'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace`},Zo={"1x":`100`,"2x":`200`,"3x":`300`,"4x":`400`,"5x":`500`,"6x":`600`,"7x":`700`,"8x":`800`,"9x":`900`},Qo={"1x":`0.75rem`,"2x":`0.875rem`,"3x":`1rem`,"4x":`1.125rem`,"5x":`1.25rem`,"6x":`1.5rem`,"7x":`1.75rem`,"8x":`2.25rem`,"9x":`3.75rem`},$o={"1x":`1rem`,"2x":`1.25rem`,"3x":`1.5rem`,"4x":`1.625rem`,"5x":`1.75rem`,"6x":`1.875rem`,"7x":`2.25rem`,"8x":`2.5rem`,"9x":`3.75rem`},es={"1x":`0.0025em`,"2x":`0em`,"3x":`0em`,"4x":`-0.0025em`,"5x":`-0.005em`,"6x":`-0.00625em`,"7x":`-0.0075em`,"8x":`-0.01em`,"9x":`-0.025em`},ts={"1x":`-0.05em`,"2x":`-0.025em`,"3x":`-0.0125em`,"4x":`-0.00625em`,"5x":`0em`,"6x":`0.00625em`,"7x":`0.0125em`,"8x":`0.025em`,"9x":`0.05em`};function ns(e){return e.replace(/\/\*[\s\S]*?\*\//g,``).trim().replace(/\s+/g,` `)}const rs=ns(`
|
|
7
7
|
/* Keep pseudo-elements outside :where(...) so downstream CSS transforms preserve them. */
|
|
8
8
|
:where(*),
|
|
9
9
|
:where(*)::before,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teacss/preset-standard",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "The standard utility vocabulary for TeaCSS — spacing, sizing, color, layout, typography, and more.",
|
|
5
5
|
"homepage": "https://css.teasim.com",
|
|
6
6
|
"funding": "https://github.com/sponsors/billgo",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"dev": "tsdown --watch"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@teacss/core": "0.6.
|
|
27
|
-
"@teacss/rule-helpers": "0.6.
|
|
26
|
+
"@teacss/core": "0.6.4",
|
|
27
|
+
"@teacss/rule-helpers": "0.6.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@teacss/classes": "0.6.
|
|
30
|
+
"@teacss/classes": "0.6.4",
|
|
31
31
|
"lightningcss": "^1.33.0",
|
|
32
32
|
"magic-string": "^1.2.3"
|
|
33
33
|
},
|