@csszyx/unplugin 0.11.8 → 0.11.9

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/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const cssMangler = require('./css-mangler.cjs');
6
- const unplugin = require('./shared/unplugin.DtPQz8Kg.cjs');
6
+ const unplugin = require('./shared/unplugin.DUI48s3S.cjs');
7
7
  const types = require('@csszyx/types');
8
8
  require('postcss');
9
9
  require('postcss-selector-parser');
@@ -21,7 +21,7 @@ require('@csszyx/vue-adapter');
21
21
  require('unplugin');
22
22
  require('./shared/unplugin.DmuOKVS4.cjs');
23
23
  require('./shared/unplugin.DVCQC5wq.cjs');
24
- require('./shared/unplugin.CcA7jP1r.cjs');
24
+ require('./shared/unplugin.BkRah5Ot.cjs');
25
25
  require('postcss-value-parser');
26
26
 
27
27
 
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { CSSManglerOptions, CSSManglerResult, MangleMap, createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.cjs';
2
2
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
3
- import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.CNwV3RrQ.cjs';
3
+ import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.CjCKWnoX.cjs';
4
4
  // @ts-ignore
5
5
  export = undefined;
6
- export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, M as MangleHybridHazards, o as ParsedTheme, p as RSCBoundaryViolation, q as RSCModuleRecord, r as appendTailwindSourceDirective, s as assertNoRSCBoundaryViolation, t as assertNoRSCGraphViolation, u as collectMangleHybridHazards, v as computeSafelistRelPath, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as cssImportsTailwind, B as deleteRSCModuleRecord, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, Q as isCompileSourceOptedIn, T as isHardIgnoredPath, U as isMonorepoPackage, W as isPackagesSkippedSource, X as isRSCServerModule, Y as mangleCodeClassesSync, Z as mangleEligibleClasses, _ as mangleHybridHazardMessage, $ as mergeThemes, a0 as missingTailwindEntryMessage, a1 as normalizeGlobalVarAliasesForCache, a2 as parseThemeBlocks, a3 as recordGlobalVarSourceFile, a4 as resolveCompileSourceDirs, a5 as resolveNativeCacheIdentity, a6 as rollupPlugin, a7 as scanCustomPropertyNames, a8 as shouldEmitWarning, a9 as shouldTrackGlobalVarSources, aa as shouldWarnMissingTailwindEntry, ab as shouldWarnUnscopedMonorepo, ac as skippedSzFilesMessage, A as unplugin, ad as unscopedMonorepoMessage, ae as vitePlugin, af as webpackPlugin } from './shared/unplugin.CNwV3RrQ.cjs';
6
+ export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, M as MangleHybridHazards, o as ParsedTheme, p as RSCBoundaryViolation, q as RSCModuleRecord, r as appendTailwindSourceDirective, s as assertNoRSCBoundaryViolation, t as assertNoRSCGraphViolation, u as collectMangleHybridHazards, v as computeSafelistRelPath, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as cssImportsTailwind, B as deleteRSCModuleRecord, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, Q as isCompileSourceOptedIn, T as isHardIgnoredPath, U as isMonorepoPackage, W as isPackagesSkippedSource, X as isRSCServerModule, Y as mangleCodeClassesSync, Z as mangleEligibleClasses, _ as mangleHybridHazardMessage, $ as mergeThemes, a0 as missingTailwindEntryMessage, a1 as normalizeGlobalVarAliasesForCache, a2 as parseThemeBlocks, a3 as recordGlobalVarSourceFile, a4 as resolveCompileSourceDirs, a5 as resolveNativeCacheIdentity, a6 as rollupPlugin, a7 as scanCustomPropertyNames, a8 as shouldEmitWarning, a9 as shouldTrackGlobalVarSources, aa as shouldWarnMissingTailwindEntry, ab as shouldWarnUnscopedMonorepo, ac as skippedSzFilesMessage, A as unplugin, ad as unscopedMonorepoMessage, ae as vitePlugin, af as webpackPlugin } from './shared/unplugin.CjCKWnoX.cjs';
7
7
  import 'postcss';
8
8
  import '@csszyx/compiler';
9
9
  import 'esbuild';
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CSSManglerOptions, CSSManglerResult, MangleMap, createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
2
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
3
- import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.CNwV3RrQ.mjs';
4
- export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, M as MangleHybridHazards, o as ParsedTheme, p as RSCBoundaryViolation, q as RSCModuleRecord, r as appendTailwindSourceDirective, s as assertNoRSCBoundaryViolation, t as assertNoRSCGraphViolation, u as collectMangleHybridHazards, v as computeSafelistRelPath, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as cssImportsTailwind, A as default, B as deleteRSCModuleRecord, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, Q as isCompileSourceOptedIn, T as isHardIgnoredPath, U as isMonorepoPackage, W as isPackagesSkippedSource, X as isRSCServerModule, Y as mangleCodeClassesSync, Z as mangleEligibleClasses, _ as mangleHybridHazardMessage, $ as mergeThemes, a0 as missingTailwindEntryMessage, a1 as normalizeGlobalVarAliasesForCache, a2 as parseThemeBlocks, a3 as recordGlobalVarSourceFile, a4 as resolveCompileSourceDirs, a5 as resolveNativeCacheIdentity, a6 as rollupPlugin, a7 as scanCustomPropertyNames, a8 as shouldEmitWarning, a9 as shouldTrackGlobalVarSources, aa as shouldWarnMissingTailwindEntry, ab as shouldWarnUnscopedMonorepo, ac as skippedSzFilesMessage, A as unplugin, ad as unscopedMonorepoMessage, ae as vitePlugin, af as webpackPlugin } from './shared/unplugin.CNwV3RrQ.mjs';
3
+ import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.CjCKWnoX.mjs';
4
+ export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, M as MangleHybridHazards, o as ParsedTheme, p as RSCBoundaryViolation, q as RSCModuleRecord, r as appendTailwindSourceDirective, s as assertNoRSCBoundaryViolation, t as assertNoRSCGraphViolation, u as collectMangleHybridHazards, v as computeSafelistRelPath, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as cssImportsTailwind, A as default, B as deleteRSCModuleRecord, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, Q as isCompileSourceOptedIn, T as isHardIgnoredPath, U as isMonorepoPackage, W as isPackagesSkippedSource, X as isRSCServerModule, Y as mangleCodeClassesSync, Z as mangleEligibleClasses, _ as mangleHybridHazardMessage, $ as mergeThemes, a0 as missingTailwindEntryMessage, a1 as normalizeGlobalVarAliasesForCache, a2 as parseThemeBlocks, a3 as recordGlobalVarSourceFile, a4 as resolveCompileSourceDirs, a5 as resolveNativeCacheIdentity, a6 as rollupPlugin, a7 as scanCustomPropertyNames, a8 as shouldEmitWarning, a9 as shouldTrackGlobalVarSources, aa as shouldWarnMissingTailwindEntry, ab as shouldWarnUnscopedMonorepo, ac as skippedSzFilesMessage, A as unplugin, ad as unscopedMonorepoMessage, ae as vitePlugin, af as webpackPlugin } from './shared/unplugin.CjCKWnoX.mjs';
5
5
  import 'postcss';
6
6
  import '@csszyx/compiler';
7
7
  import 'esbuild';
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
- export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as computeSafelistRelPath, f as createGlobalVarAliasValidationOptions, g as createGlobalVarMapAssetSource, h as createGlobalVarScanCacheKey, i as createRSCModuleRecord, j as cssHasContentScope, k as cssImportsTailwind, u as default, l as deleteRSCModuleRecord, m as esbuildPlugin, n as extractGlobalVarAliasesForManifest, o as fileMayContainSafelistableSz, p as findLocalImportSources, q as findRSCBoundaryViolation, r as findRSCGraphViolation, s as hasInjectableTailwindCandidate, t as hasTokens, v as hasUseClientDirective, w as hasUseServerDirective, x as isCompileSourceOptedIn, y as isHardIgnoredPath, z as isMonorepoPackage, A as isPackagesSkippedSource, B as isRSCServerModule, C as isTailwindReservedGlobalVar, D as mangleCodeClassesSync, E as mangleEligibleClasses, F as mangleHybridHazardMessage, G as mergeThemes, H as missingTailwindEntryMessage, I as normalizeGlobalVarAliasesForCache, J as parseThemeBlocks, K as planGlobalVarAliases, L as readGlobalVarScanCache, M as recordGlobalVarSourceFile, N as resolveCompileSourceDirs, O as resolveGlobalVarScanCacheDir, P as resolveNativeCacheIdentity, Q as rewriteGlobalVarCssAliases, R as rollupPlugin, S as scanCustomPropertyNames, T as scanGlobalVarCss, U as shouldEmitWarning, V as shouldTrackGlobalVarSources, W as shouldWarnMissingTailwindEntry, X as shouldWarnUnscopedMonorepo, Y as skippedSzFilesMessage, u as unplugin, Z as unscopedMonorepoMessage, _ as validateGlobalVarAliasInputs, $ as vitePlugin, a0 as webpackPlugin, a1 as writeGlobalVarScanCache } from './shared/unplugin.DtYxS8M8.mjs';
2
+ export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as computeSafelistRelPath, f as createGlobalVarAliasValidationOptions, g as createGlobalVarMapAssetSource, h as createGlobalVarScanCacheKey, i as createRSCModuleRecord, j as cssHasContentScope, k as cssImportsTailwind, u as default, l as deleteRSCModuleRecord, m as esbuildPlugin, n as extractGlobalVarAliasesForManifest, o as fileMayContainSafelistableSz, p as findLocalImportSources, q as findRSCBoundaryViolation, r as findRSCGraphViolation, s as hasInjectableTailwindCandidate, t as hasTokens, v as hasUseClientDirective, w as hasUseServerDirective, x as isCompileSourceOptedIn, y as isHardIgnoredPath, z as isMonorepoPackage, A as isPackagesSkippedSource, B as isRSCServerModule, C as isTailwindReservedGlobalVar, D as mangleCodeClassesSync, E as mangleEligibleClasses, F as mangleHybridHazardMessage, G as mergeThemes, H as missingTailwindEntryMessage, I as normalizeGlobalVarAliasesForCache, J as parseThemeBlocks, K as planGlobalVarAliases, L as readGlobalVarScanCache, M as recordGlobalVarSourceFile, N as resolveCompileSourceDirs, O as resolveGlobalVarScanCacheDir, P as resolveNativeCacheIdentity, Q as rewriteGlobalVarCssAliases, R as rollupPlugin, S as scanCustomPropertyNames, T as scanGlobalVarCss, U as shouldEmitWarning, V as shouldTrackGlobalVarSources, W as shouldWarnMissingTailwindEntry, X as shouldWarnUnscopedMonorepo, Y as skippedSzFilesMessage, u as unplugin, Z as unscopedMonorepoMessage, _ as validateGlobalVarAliasInputs, $ as vitePlugin, a0 as webpackPlugin, a1 as writeGlobalVarScanCache } from './shared/unplugin.wx3cvxxX.mjs';
3
3
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
4
4
  import 'postcss';
5
5
  import 'postcss-selector-parser';
@@ -17,5 +17,5 @@ import '@csszyx/vue-adapter';
17
17
  import 'unplugin';
18
18
  import './shared/unplugin.nnsa7OVW.mjs';
19
19
  import './shared/unplugin.D-K57LNR.mjs';
20
- import './shared/unplugin.TtmP77BS.mjs';
20
+ import './shared/unplugin.B3XoSRB8.mjs';
21
21
  import 'postcss-value-parser';
@@ -3,11 +3,11 @@
3
3
  const node_crypto = require('node:crypto');
4
4
  const fs = require('node:fs');
5
5
  const path = require('node:path');
6
- const nextTransformMetadata = require('./shared/unplugin.DdtOZANG.cjs');
7
- const nextWatcherCycle = require('./shared/unplugin.C9dMG7ye.cjs');
6
+ const nextTransformMetadata = require('./shared/unplugin.jZsBqx54.cjs');
7
+ const nextWatcherCycle = require('./shared/unplugin.WVn08Fln.cjs');
8
8
  const transformCache = require('./shared/unplugin.DVCQC5wq.cjs');
9
9
  require('@csszyx/compiler');
10
- require('./shared/unplugin.CcA7jP1r.cjs');
10
+ require('./shared/unplugin.BkRah5Ot.cjs');
11
11
  require('node:os');
12
12
  require('proper-lockfile');
13
13
 
@@ -1,11 +1,11 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
3
  import * as path from 'node:path';
4
- import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.Rl8sIkHi.mjs';
5
- import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.Dg1tGPSd.mjs';
4
+ import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.Bqx2WfBV.mjs';
5
+ import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.7TELUwsj.mjs';
6
6
  import { r as resolveTransformCacheDir, n as normalizePathSeparators } from './shared/unplugin.D-K57LNR.mjs';
7
7
  import '@csszyx/compiler';
8
- import './shared/unplugin.TtmP77BS.mjs';
8
+ import './shared/unplugin.B3XoSRB8.mjs';
9
9
  import 'node:os';
10
10
  import 'proper-lockfile';
11
11
 
@@ -4,14 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const node_crypto = require('node:crypto');
6
6
  const path = require('node:path');
7
- const nextWatcherCycle = require('./shared/unplugin.C9dMG7ye.cjs');
8
- const nextTransformMetadata = require('./shared/unplugin.DdtOZANG.cjs');
7
+ const nextWatcherCycle = require('./shared/unplugin.WVn08Fln.cjs');
8
+ const nextTransformMetadata = require('./shared/unplugin.jZsBqx54.cjs');
9
9
  const runtimeImportScan = require('./shared/unplugin.DmuOKVS4.cjs');
10
10
  const transformCache = require('./shared/unplugin.DVCQC5wq.cjs');
11
11
  require('node:fs');
12
12
  require('node:os');
13
13
  require('proper-lockfile');
14
- require('./shared/unplugin.CcA7jP1r.cjs');
14
+ require('./shared/unplugin.BkRah5Ot.cjs');
15
15
  require('@csszyx/compiler');
16
16
 
17
17
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -1,13 +1,13 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import * as path from 'node:path';
3
- import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle, v as validateNextGenerationManifest, a as readNextGenerationManifest } from './shared/unplugin.Dg1tGPSd.mjs';
4
- import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.Rl8sIkHi.mjs';
3
+ import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle, v as validateNextGenerationManifest, a as readNextGenerationManifest } from './shared/unplugin.7TELUwsj.mjs';
4
+ import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.Bqx2WfBV.mjs';
5
5
  import { i as importsRuntimeHelper, a as insertAfterUseDirective } from './shared/unplugin.nnsa7OVW.mjs';
6
6
  import { r as resolveTransformCacheDir, n as normalizePathSeparators } from './shared/unplugin.D-K57LNR.mjs';
7
7
  import 'node:fs';
8
8
  import 'node:os';
9
9
  import 'proper-lockfile';
10
- import './shared/unplugin.TtmP77BS.mjs';
10
+ import './shared/unplugin.B3XoSRB8.mjs';
11
11
  import '@csszyx/compiler';
12
12
 
13
13
  function injectNextRuntimeImports(code, usage) {
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  const path = require('node:path');
4
- const nextWatcherCycle = require('./shared/unplugin.C9dMG7ye.cjs');
4
+ const nextWatcherCycle = require('./shared/unplugin.WVn08Fln.cjs');
5
5
  require('node:fs');
6
6
  require('node:crypto');
7
7
  require('node:os');
8
8
  require('proper-lockfile');
9
- require('./shared/unplugin.CcA7jP1r.cjs');
9
+ require('./shared/unplugin.BkRah5Ot.cjs');
10
10
 
11
11
  function _interopNamespaceCompat(e) {
12
12
  if (e && typeof e === 'object' && 'default' in e) return e;
@@ -1,10 +1,10 @@
1
1
  import * as path from 'node:path';
2
- import { r as runNextWatcherCycle } from './shared/unplugin.Dg1tGPSd.mjs';
2
+ import { r as runNextWatcherCycle } from './shared/unplugin.7TELUwsj.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:crypto';
5
5
  import 'node:os';
6
6
  import 'proper-lockfile';
7
- import './shared/unplugin.TtmP77BS.mjs';
7
+ import './shared/unplugin.B3XoSRB8.mjs';
8
8
 
9
9
  class NextWatcherLoop {
10
10
  context;
@@ -3,7 +3,7 @@ import * as fs from 'node:fs';
3
3
  import { createHash, randomUUID } from 'node:crypto';
4
4
  import { hostname } from 'node:os';
5
5
  import lockfile from 'proper-lockfile';
6
- import { s as sortStrings, e as escapeHtmlAttribute, r as renderTailwindScannerCandidates } from './unplugin.TtmP77BS.mjs';
6
+ import { s as sortStrings, e as escapeHtmlAttribute, r as renderTailwindScannerCandidates } from './unplugin.B3XoSRB8.mjs';
7
7
 
8
8
  const DEFAULT_RENAME_RETRIES = 5;
9
9
  const DEFAULT_RENAME_RETRY_DELAY_MS = 10;
@@ -11,7 +11,7 @@ function unicodeEscape(hexadecimal) {
11
11
  return `${BACKSLASH}u${hexadecimal}`;
12
12
  }
13
13
  function replaceEveryLiteral(value, search, replacement) {
14
- return value.split(search).join(replacement);
14
+ return value.replaceAll(search, () => replacement);
15
15
  }
16
16
  function escapeSingleQuotedString(value) {
17
17
  let escaped = replaceEveryLiteral(value, BACKSLASH, BACKSLASH.repeat(2));
@@ -13,7 +13,7 @@ function unicodeEscape(hexadecimal) {
13
13
  return `${BACKSLASH}u${hexadecimal}`;
14
14
  }
15
15
  function replaceEveryLiteral(value, search, replacement) {
16
- return value.split(search).join(replacement);
16
+ return value.replaceAll(search, () => replacement);
17
17
  }
18
18
  function escapeSingleQuotedString(value) {
19
19
  let escaped = replaceEveryLiteral(value, BACKSLASH, BACKSLASH.repeat(2));
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
2
2
  import { ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transform } from '@csszyx/compiler';
3
3
  import { c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache, n as normalizePathSeparators } from './unplugin.D-K57LNR.mjs';
4
4
  import { createHash } from 'node:crypto';
5
- import { s as sortStrings } from './unplugin.TtmP77BS.mjs';
5
+ import { s as sortStrings } from './unplugin.B3XoSRB8.mjs';
6
6
 
7
7
  function readPackageVersion(relativePackageJson, fromUrl) {
8
8
  try {
@@ -334,7 +334,7 @@ declare function findLocalImportSources(code: string): string[];
334
334
  *
335
335
  * Supports:
336
336
  * - Multiple @theme blocks per file
337
- * - @theme inline { } syntax (inline keyword ignored)
337
+ * - @theme option keywords (inline, static, reference, combinations ignored)
338
338
  * - @theme inside @layer (two-pass strip)
339
339
  * - --color-brand-50 shade suffixes (deduped to 'brand')
340
340
  * - Multi-file merge via mergeThemes()
@@ -407,6 +407,12 @@ interface PluginState {
407
407
  classes: Set<string>;
408
408
  /** Merged @theme scan result — feeds the theme-groups virtual module. */
409
409
  parsedTheme: ParsedTheme | null;
410
+ /**
411
+ * CSS files the zero-config @theme auto-scan found tokens in (only when
412
+ * `build.scanCss` is unset). Dev HMR re-scans when one of these — or any
413
+ * other .css file — changes, mirroring the explicit scanCss reload path.
414
+ */
415
+ autoThemeCssFiles: string[];
410
416
  /**
411
417
  * True once any processed CSS file was seen importing `tailwindcss`. Used to
412
418
  * warn at build end when csszyx generated classes but nothing makes Tailwind
@@ -334,7 +334,7 @@ declare function findLocalImportSources(code: string): string[];
334
334
  *
335
335
  * Supports:
336
336
  * - Multiple @theme blocks per file
337
- * - @theme inline { } syntax (inline keyword ignored)
337
+ * - @theme option keywords (inline, static, reference, combinations ignored)
338
338
  * - @theme inside @layer (two-pass strip)
339
339
  * - --color-brand-50 shade suffixes (deduped to 'brand')
340
340
  * - Multi-file merge via mergeThemes()
@@ -407,6 +407,12 @@ interface PluginState {
407
407
  classes: Set<string>;
408
408
  /** Merged @theme scan result — feeds the theme-groups virtual module. */
409
409
  parsedTheme: ParsedTheme | null;
410
+ /**
411
+ * CSS files the zero-config @theme auto-scan found tokens in (only when
412
+ * `build.scanCss` is unset). Dev HMR re-scans when one of these — or any
413
+ * other .css file — changes, mirroring the explicit scanCss reload path.
414
+ */
415
+ autoThemeCssFiles: string[];
410
416
  /**
411
417
  * True once any processed CSS file was seen importing `tailwindcss`. Used to
412
418
  * warn at build end when csszyx generated classes but nothing makes Tailwind
@@ -16,7 +16,7 @@ const unplugin$1 = require('unplugin');
16
16
  const cssMangler = require('../css-mangler.cjs');
17
17
  const runtimeImportScan = require('./unplugin.DmuOKVS4.cjs');
18
18
  const transformCache = require('./unplugin.DVCQC5wq.cjs');
19
- const htmlEscape = require('./unplugin.CcA7jP1r.cjs');
19
+ const htmlEscape = require('./unplugin.BkRah5Ot.cjs');
20
20
  const postcss = require('postcss');
21
21
  const valueParser = require('postcss-value-parser');
22
22
 
@@ -1180,15 +1180,44 @@ function stripLayerWrappers(css) {
1180
1180
  }
1181
1181
  return result;
1182
1182
  }
1183
+ function themePreludeStart(css, at) {
1184
+ const cursor = at + "@theme".length;
1185
+ const next = css[cursor];
1186
+ const validBoundary = next === "{" || next === " " || next === " " || next === "\n" || next === "\r";
1187
+ return validBoundary ? cursor : null;
1188
+ }
1189
+ function readThemeBlock(css, start) {
1190
+ for (let cursor = start; cursor < css.length; cursor++) {
1191
+ const character = css[cursor];
1192
+ if (character === "{") {
1193
+ const close = findMatchingBrace(css, cursor);
1194
+ return {
1195
+ body: close === -1 ? null : css.slice(cursor + 1, close),
1196
+ end: close === -1 ? cursor : close
1197
+ };
1198
+ }
1199
+ if (character === ";" || character === "}" || character === "@") {
1200
+ return { body: null, end: cursor };
1201
+ }
1202
+ }
1203
+ return { body: null, end: css.length };
1204
+ }
1183
1205
  function extractThemeBlocks(css) {
1184
1206
  const blocks = [];
1185
- const themeStart = /@theme\s+(?:inline\s+)?\{|@theme\{/g;
1186
- for (const match of css.matchAll(themeStart)) {
1187
- const openPos = css.indexOf("{", match.index);
1188
- const closePos = findMatchingBrace(css, openPos);
1189
- if (closePos !== -1) {
1190
- blocks.push(css.slice(openPos + 1, closePos));
1207
+ let searchFrom = 0;
1208
+ for (; ; ) {
1209
+ const at = css.indexOf("@theme", searchFrom);
1210
+ if (at === -1) {
1211
+ break;
1191
1212
  }
1213
+ const preludeStart = themePreludeStart(css, at);
1214
+ if (preludeStart === null) {
1215
+ searchFrom = at + "@theme".length;
1216
+ continue;
1217
+ }
1218
+ const match = readThemeBlock(css, preludeStart);
1219
+ if (match.body !== null) blocks.push(match.body);
1220
+ searchFrom = Math.max(match.end, at + "@theme".length);
1192
1221
  }
1193
1222
  return blocks;
1194
1223
  }
@@ -1358,6 +1387,26 @@ const SIMPLE_ESCAPES = {
1358
1387
  v: "\v",
1359
1388
  "0": "\0"
1360
1389
  };
1390
+ function decodeBracedUnicodeEscape(value, cursor) {
1391
+ if (value[cursor] !== "u" || value[cursor + 1] !== "{") return null;
1392
+ const close = value.indexOf("}", cursor + 2);
1393
+ const hex = close === -1 ? "" : value.slice(cursor + 2, close);
1394
+ const codePoint = hex && /^[\dA-F]+$/i.test(hex) ? Number.parseInt(hex, 16) : -1;
1395
+ if (codePoint < 0 || codePoint > 1114111) return null;
1396
+ return { value: String.fromCodePoint(codePoint), cursor: close };
1397
+ }
1398
+ function decodeFixedWidthEscape(value, cursor) {
1399
+ const escaped = value[cursor];
1400
+ let width = 0;
1401
+ if (escaped === "x") width = 2;
1402
+ if (escaped === "u") width = 4;
1403
+ const hex = value.slice(cursor + 1, cursor + width + 1);
1404
+ if (width === 0 || !isFixedHex(hex, width)) return null;
1405
+ return {
1406
+ value: String.fromCodePoint(Number.parseInt(hex, 16)),
1407
+ cursor: cursor + width
1408
+ };
1409
+ }
1361
1410
  function isFixedHex(value, width) {
1362
1411
  if (value.length !== width) return false;
1363
1412
  for (const character of value) {
@@ -1373,24 +1422,10 @@ function decodeEscape(value, cursor) {
1373
1422
  if (escaped === "\r" && value[cursor + 1] === "\n") {
1374
1423
  return { value: "", cursor: cursor + 1 };
1375
1424
  }
1376
- if (escaped === "u" && value[cursor + 1] === "{") {
1377
- const close = value.indexOf("}", cursor + 2);
1378
- const hex2 = close === -1 ? "" : value.slice(cursor + 2, close);
1379
- const codePoint = hex2 && /^[\dA-F]+$/i.test(hex2) ? Number.parseInt(hex2, 16) : -1;
1380
- if (codePoint >= 0 && codePoint <= 1114111) {
1381
- return { value: String.fromCodePoint(codePoint), cursor: close };
1382
- }
1383
- }
1384
- let width = 0;
1385
- if (escaped === "x") width = 2;
1386
- else if (escaped === "u") width = 4;
1387
- const hex = value.slice(cursor + 1, cursor + width + 1);
1388
- if (width > 0 && isFixedHex(hex, width)) {
1389
- return {
1390
- value: String.fromCodePoint(Number.parseInt(hex, 16)),
1391
- cursor: cursor + width
1392
- };
1393
- }
1425
+ const bracedUnicode = decodeBracedUnicodeEscape(value, cursor);
1426
+ if (bracedUnicode) return bracedUnicode;
1427
+ const fixedWidth = decodeFixedWidthEscape(value, cursor);
1428
+ if (fixedWidth) return fixedWidth;
1394
1429
  const decoded = escaped === "\n" || escaped === "\r" ? "" : escaped;
1395
1430
  return { value: decoded, cursor };
1396
1431
  }
@@ -2196,9 +2231,9 @@ let _hasWarnedTransformCacheVersion = false;
2196
2231
  let _hasWarnedNativeFallback = false;
2197
2232
  const _loggedActiveParsers = /* @__PURE__ */ new Set();
2198
2233
  const _babelFallbackFiles = /* @__PURE__ */ new Set();
2199
- const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.DtPQz8Kg.cjs', document.baseURI).href)));
2234
+ const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.DUI48s3S.cjs', document.baseURI).href)));
2200
2235
  const PLUGIN_VERSION = findPackageVersionFromFile(
2201
- node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.DtPQz8Kg.cjs', document.baseURI).href))),
2236
+ node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.DUI48s3S.cjs', document.baseURI).href))),
2202
2237
  UNKNOWN_PACKAGE_VERSION
2203
2238
  );
2204
2239
  const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
@@ -3145,6 +3180,7 @@ function createCsszyxPlugins(options = {}) {
3145
3180
  const state = {
3146
3181
  classes: /* @__PURE__ */ new Set(),
3147
3182
  parsedTheme: null,
3183
+ autoThemeCssFiles: [],
3148
3184
  sawTailwindEntry: false,
3149
3185
  sawAnyCss: false,
3150
3186
  tailwindWarningEmitted: false,
@@ -3245,6 +3281,59 @@ function createCsszyxPlugins(options = {}) {
3245
3281
  );
3246
3282
  }
3247
3283
  }
3284
+ function runAutoThemeScan(rootDir) {
3285
+ if (options.build?.scanCss) {
3286
+ return;
3287
+ }
3288
+ refreshCompileSourceDirs();
3289
+ const cssFiles = [];
3290
+ const walk = (dir) => {
3291
+ let entries;
3292
+ try {
3293
+ entries = fs__namespace.readdirSync(dir, { withFileTypes: true });
3294
+ } catch {
3295
+ return;
3296
+ }
3297
+ for (const entry of entries) {
3298
+ if (entry.isDirectory()) {
3299
+ if (!IGNORE_DIRS.has(entry.name) && !entry.name.startsWith(".")) {
3300
+ walk(path__namespace.join(dir, entry.name));
3301
+ }
3302
+ continue;
3303
+ }
3304
+ if (entry.name.endsWith(".css")) {
3305
+ cssFiles.push(path__namespace.join(dir, entry.name));
3306
+ }
3307
+ }
3308
+ };
3309
+ walk(rootDir);
3310
+ const normRoot = normalizeForMatch(rootDir);
3311
+ for (const sourceDir of compileSourceDirs) {
3312
+ if (sourceDir === normRoot || sourceDir.startsWith(`${normRoot}/`)) {
3313
+ continue;
3314
+ }
3315
+ walk(sourceDir);
3316
+ }
3317
+ const themes = [];
3318
+ const themeFiles = [];
3319
+ for (const file of cssFiles) {
3320
+ let content;
3321
+ try {
3322
+ content = fs__namespace.readFileSync(file, "utf-8");
3323
+ } catch {
3324
+ continue;
3325
+ }
3326
+ if (!content.includes("@theme")) {
3327
+ continue;
3328
+ }
3329
+ themes.push(parseThemeBlocks(content));
3330
+ themeFiles.push(file);
3331
+ }
3332
+ state.autoThemeCssFiles = themeFiles;
3333
+ if (themes.length > 0) {
3334
+ state.parsedTheme = mergeThemes(themes);
3335
+ }
3336
+ }
3248
3337
  function isHardIgnored(id) {
3249
3338
  refreshCompileSourceDirs();
3250
3339
  return isHardIgnoredPath(id, compileSourceDirs);
@@ -4144,6 +4233,7 @@ ${transformedCode}`;
4144
4233
  prescanAndWriteClasses();
4145
4234
  }
4146
4235
  state.parsedTheme = runThemeScan(root, options.build?.scanCss) ?? state.parsedTheme;
4236
+ runAutoThemeScan(root);
4147
4237
  });
4148
4238
  if (options.build?.scanCss) {
4149
4239
  compiler.hooks.thisCompilation.tap("csszyx:theme-deps", (compilation) => {
@@ -4170,6 +4260,7 @@ ${transformedCode}`;
4170
4260
  evictTransformCacheOnce();
4171
4261
  prescanAndWriteClasses();
4172
4262
  state.parsedTheme = runThemeScan(root, options.build?.scanCss) ?? state.parsedTheme;
4263
+ runAutoThemeScan(root);
4173
4264
  },
4174
4265
  /**
4175
4266
  * Vite HMR hook: re-runs theme scan when a watched CSS file changes,
@@ -4179,17 +4270,23 @@ ${transformedCode}`;
4179
4270
  handleHotUpdate(ctx) {
4180
4271
  prescanResultHandoff.clear();
4181
4272
  const scanCss = options.build?.scanCss;
4273
+ const reloadThemeGroupsModule = () => {
4274
+ const themeGroupsModule = ctx.server.moduleGraph.getModuleById(
4275
+ RESOLVED_THEME_GROUPS_VIRTUAL_ID
4276
+ );
4277
+ if (themeGroupsModule) {
4278
+ ctx.server.moduleGraph.invalidateModule(themeGroupsModule);
4279
+ }
4280
+ };
4182
4281
  if (scanCss) {
4183
4282
  const root = ctx.server.config.root || process.cwd();
4184
4283
  if (matchesAnyPattern(ctx.file, scanCss, root)) {
4185
4284
  state.parsedTheme = runThemeScan(root, scanCss) ?? state.parsedTheme;
4186
- const themeGroupsModule = ctx.server.moduleGraph.getModuleById(
4187
- RESOLVED_THEME_GROUPS_VIRTUAL_ID
4188
- );
4189
- if (themeGroupsModule) {
4190
- ctx.server.moduleGraph.invalidateModule(themeGroupsModule);
4191
- }
4285
+ reloadThemeGroupsModule();
4192
4286
  }
4287
+ } else if (ctx.file.endsWith(".css")) {
4288
+ runAutoThemeScan(ctx.server.config.root || process.cwd());
4289
+ reloadThemeGroupsModule();
4193
4290
  }
4194
4291
  if (!shouldProcessSource(ctx.file)) {
4195
4292
  return;
@@ -5,7 +5,7 @@ const fs = require('node:fs');
5
5
  const node_crypto = require('node:crypto');
6
6
  const node_os = require('node:os');
7
7
  const lockfile = require('proper-lockfile');
8
- const htmlEscape = require('./unplugin.CcA7jP1r.cjs');
8
+ const htmlEscape = require('./unplugin.BkRah5Ot.cjs');
9
9
 
10
10
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
11
11
 
@@ -4,7 +4,7 @@ const fs = require('node:fs');
4
4
  const compiler = require('@csszyx/compiler');
5
5
  const transformCache = require('./unplugin.DVCQC5wq.cjs');
6
6
  const node_crypto = require('node:crypto');
7
- const htmlEscape = require('./unplugin.CcA7jP1r.cjs');
7
+ const htmlEscape = require('./unplugin.BkRah5Ot.cjs');
8
8
 
9
9
  function readPackageVersion(relativePackageJson, fromUrl) {
10
10
  try {
@@ -16,7 +16,7 @@ import { createUnplugin } from 'unplugin';
16
16
  import { mangleCSSSync } from '../css-mangler.mjs';
17
17
  import { i as importsRuntimeHelper, f as findRuntimeImportClause, a as insertAfterUseDirective } from './unplugin.nnsa7OVW.mjs';
18
18
  import { n as normalizePathSeparators, r as resolveTransformCacheDir, c as createTransformCacheKey, w as writeTransformCache, e as evictOldTransformCacheEntries, a as readTransformCache, b as evictMemoryCacheToBudget } from './unplugin.D-K57LNR.mjs';
19
- import { s as sortStrings, a as replaceEveryLiteral, u as unicodeEscape, b as escapeDoubleQuotedString, c as escapeSingleQuotedString, e as escapeHtmlAttribute, r as renderTailwindScannerCandidates } from './unplugin.TtmP77BS.mjs';
19
+ import { s as sortStrings, a as replaceEveryLiteral, u as unicodeEscape, b as escapeDoubleQuotedString, c as escapeSingleQuotedString, e as escapeHtmlAttribute, r as renderTailwindScannerCandidates } from './unplugin.B3XoSRB8.mjs';
20
20
  import postcss from 'postcss';
21
21
  import valueParser from 'postcss-value-parser';
22
22
 
@@ -1160,15 +1160,44 @@ function stripLayerWrappers(css) {
1160
1160
  }
1161
1161
  return result;
1162
1162
  }
1163
+ function themePreludeStart(css, at) {
1164
+ const cursor = at + "@theme".length;
1165
+ const next = css[cursor];
1166
+ const validBoundary = next === "{" || next === " " || next === " " || next === "\n" || next === "\r";
1167
+ return validBoundary ? cursor : null;
1168
+ }
1169
+ function readThemeBlock(css, start) {
1170
+ for (let cursor = start; cursor < css.length; cursor++) {
1171
+ const character = css[cursor];
1172
+ if (character === "{") {
1173
+ const close = findMatchingBrace(css, cursor);
1174
+ return {
1175
+ body: close === -1 ? null : css.slice(cursor + 1, close),
1176
+ end: close === -1 ? cursor : close
1177
+ };
1178
+ }
1179
+ if (character === ";" || character === "}" || character === "@") {
1180
+ return { body: null, end: cursor };
1181
+ }
1182
+ }
1183
+ return { body: null, end: css.length };
1184
+ }
1163
1185
  function extractThemeBlocks(css) {
1164
1186
  const blocks = [];
1165
- const themeStart = /@theme\s+(?:inline\s+)?\{|@theme\{/g;
1166
- for (const match of css.matchAll(themeStart)) {
1167
- const openPos = css.indexOf("{", match.index);
1168
- const closePos = findMatchingBrace(css, openPos);
1169
- if (closePos !== -1) {
1170
- blocks.push(css.slice(openPos + 1, closePos));
1187
+ let searchFrom = 0;
1188
+ for (; ; ) {
1189
+ const at = css.indexOf("@theme", searchFrom);
1190
+ if (at === -1) {
1191
+ break;
1171
1192
  }
1193
+ const preludeStart = themePreludeStart(css, at);
1194
+ if (preludeStart === null) {
1195
+ searchFrom = at + "@theme".length;
1196
+ continue;
1197
+ }
1198
+ const match = readThemeBlock(css, preludeStart);
1199
+ if (match.body !== null) blocks.push(match.body);
1200
+ searchFrom = Math.max(match.end, at + "@theme".length);
1172
1201
  }
1173
1202
  return blocks;
1174
1203
  }
@@ -1338,6 +1367,26 @@ const SIMPLE_ESCAPES = {
1338
1367
  v: "\v",
1339
1368
  "0": "\0"
1340
1369
  };
1370
+ function decodeBracedUnicodeEscape(value, cursor) {
1371
+ if (value[cursor] !== "u" || value[cursor + 1] !== "{") return null;
1372
+ const close = value.indexOf("}", cursor + 2);
1373
+ const hex = close === -1 ? "" : value.slice(cursor + 2, close);
1374
+ const codePoint = hex && /^[\dA-F]+$/i.test(hex) ? Number.parseInt(hex, 16) : -1;
1375
+ if (codePoint < 0 || codePoint > 1114111) return null;
1376
+ return { value: String.fromCodePoint(codePoint), cursor: close };
1377
+ }
1378
+ function decodeFixedWidthEscape(value, cursor) {
1379
+ const escaped = value[cursor];
1380
+ let width = 0;
1381
+ if (escaped === "x") width = 2;
1382
+ if (escaped === "u") width = 4;
1383
+ const hex = value.slice(cursor + 1, cursor + width + 1);
1384
+ if (width === 0 || !isFixedHex(hex, width)) return null;
1385
+ return {
1386
+ value: String.fromCodePoint(Number.parseInt(hex, 16)),
1387
+ cursor: cursor + width
1388
+ };
1389
+ }
1341
1390
  function isFixedHex(value, width) {
1342
1391
  if (value.length !== width) return false;
1343
1392
  for (const character of value) {
@@ -1353,24 +1402,10 @@ function decodeEscape(value, cursor) {
1353
1402
  if (escaped === "\r" && value[cursor + 1] === "\n") {
1354
1403
  return { value: "", cursor: cursor + 1 };
1355
1404
  }
1356
- if (escaped === "u" && value[cursor + 1] === "{") {
1357
- const close = value.indexOf("}", cursor + 2);
1358
- const hex2 = close === -1 ? "" : value.slice(cursor + 2, close);
1359
- const codePoint = hex2 && /^[\dA-F]+$/i.test(hex2) ? Number.parseInt(hex2, 16) : -1;
1360
- if (codePoint >= 0 && codePoint <= 1114111) {
1361
- return { value: String.fromCodePoint(codePoint), cursor: close };
1362
- }
1363
- }
1364
- let width = 0;
1365
- if (escaped === "x") width = 2;
1366
- else if (escaped === "u") width = 4;
1367
- const hex = value.slice(cursor + 1, cursor + width + 1);
1368
- if (width > 0 && isFixedHex(hex, width)) {
1369
- return {
1370
- value: String.fromCodePoint(Number.parseInt(hex, 16)),
1371
- cursor: cursor + width
1372
- };
1373
- }
1405
+ const bracedUnicode = decodeBracedUnicodeEscape(value, cursor);
1406
+ if (bracedUnicode) return bracedUnicode;
1407
+ const fixedWidth = decodeFixedWidthEscape(value, cursor);
1408
+ if (fixedWidth) return fixedWidth;
1374
1409
  const decoded = escaped === "\n" || escaped === "\r" ? "" : escaped;
1375
1410
  return { value: decoded, cursor };
1376
1411
  }
@@ -3125,6 +3160,7 @@ function createCsszyxPlugins(options = {}) {
3125
3160
  const state = {
3126
3161
  classes: /* @__PURE__ */ new Set(),
3127
3162
  parsedTheme: null,
3163
+ autoThemeCssFiles: [],
3128
3164
  sawTailwindEntry: false,
3129
3165
  sawAnyCss: false,
3130
3166
  tailwindWarningEmitted: false,
@@ -3225,6 +3261,59 @@ function createCsszyxPlugins(options = {}) {
3225
3261
  );
3226
3262
  }
3227
3263
  }
3264
+ function runAutoThemeScan(rootDir) {
3265
+ if (options.build?.scanCss) {
3266
+ return;
3267
+ }
3268
+ refreshCompileSourceDirs();
3269
+ const cssFiles = [];
3270
+ const walk = (dir) => {
3271
+ let entries;
3272
+ try {
3273
+ entries = fs.readdirSync(dir, { withFileTypes: true });
3274
+ } catch {
3275
+ return;
3276
+ }
3277
+ for (const entry of entries) {
3278
+ if (entry.isDirectory()) {
3279
+ if (!IGNORE_DIRS.has(entry.name) && !entry.name.startsWith(".")) {
3280
+ walk(path.join(dir, entry.name));
3281
+ }
3282
+ continue;
3283
+ }
3284
+ if (entry.name.endsWith(".css")) {
3285
+ cssFiles.push(path.join(dir, entry.name));
3286
+ }
3287
+ }
3288
+ };
3289
+ walk(rootDir);
3290
+ const normRoot = normalizeForMatch(rootDir);
3291
+ for (const sourceDir of compileSourceDirs) {
3292
+ if (sourceDir === normRoot || sourceDir.startsWith(`${normRoot}/`)) {
3293
+ continue;
3294
+ }
3295
+ walk(sourceDir);
3296
+ }
3297
+ const themes = [];
3298
+ const themeFiles = [];
3299
+ for (const file of cssFiles) {
3300
+ let content;
3301
+ try {
3302
+ content = fs.readFileSync(file, "utf-8");
3303
+ } catch {
3304
+ continue;
3305
+ }
3306
+ if (!content.includes("@theme")) {
3307
+ continue;
3308
+ }
3309
+ themes.push(parseThemeBlocks(content));
3310
+ themeFiles.push(file);
3311
+ }
3312
+ state.autoThemeCssFiles = themeFiles;
3313
+ if (themes.length > 0) {
3314
+ state.parsedTheme = mergeThemes(themes);
3315
+ }
3316
+ }
3228
3317
  function isHardIgnored(id) {
3229
3318
  refreshCompileSourceDirs();
3230
3319
  return isHardIgnoredPath(id, compileSourceDirs);
@@ -4124,6 +4213,7 @@ ${transformedCode}`;
4124
4213
  prescanAndWriteClasses();
4125
4214
  }
4126
4215
  state.parsedTheme = runThemeScan(root, options.build?.scanCss) ?? state.parsedTheme;
4216
+ runAutoThemeScan(root);
4127
4217
  });
4128
4218
  if (options.build?.scanCss) {
4129
4219
  compiler.hooks.thisCompilation.tap("csszyx:theme-deps", (compilation) => {
@@ -4150,6 +4240,7 @@ ${transformedCode}`;
4150
4240
  evictTransformCacheOnce();
4151
4241
  prescanAndWriteClasses();
4152
4242
  state.parsedTheme = runThemeScan(root, options.build?.scanCss) ?? state.parsedTheme;
4243
+ runAutoThemeScan(root);
4153
4244
  },
4154
4245
  /**
4155
4246
  * Vite HMR hook: re-runs theme scan when a watched CSS file changes,
@@ -4159,17 +4250,23 @@ ${transformedCode}`;
4159
4250
  handleHotUpdate(ctx) {
4160
4251
  prescanResultHandoff.clear();
4161
4252
  const scanCss = options.build?.scanCss;
4253
+ const reloadThemeGroupsModule = () => {
4254
+ const themeGroupsModule = ctx.server.moduleGraph.getModuleById(
4255
+ RESOLVED_THEME_GROUPS_VIRTUAL_ID
4256
+ );
4257
+ if (themeGroupsModule) {
4258
+ ctx.server.moduleGraph.invalidateModule(themeGroupsModule);
4259
+ }
4260
+ };
4162
4261
  if (scanCss) {
4163
4262
  const root = ctx.server.config.root || process.cwd();
4164
4263
  if (matchesAnyPattern(ctx.file, scanCss, root)) {
4165
4264
  state.parsedTheme = runThemeScan(root, scanCss) ?? state.parsedTheme;
4166
- const themeGroupsModule = ctx.server.moduleGraph.getModuleById(
4167
- RESOLVED_THEME_GROUPS_VIRTUAL_ID
4168
- );
4169
- if (themeGroupsModule) {
4170
- ctx.server.moduleGraph.invalidateModule(themeGroupsModule);
4171
- }
4265
+ reloadThemeGroupsModule();
4172
4266
  }
4267
+ } else if (ctx.file.endsWith(".css")) {
4268
+ runAutoThemeScan(ctx.server.config.root || process.cwd());
4269
+ reloadThemeGroupsModule();
4173
4270
  }
4174
4271
  if (!shouldProcessSource(ctx.file)) {
4175
4272
  return;
package/dist/vite.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.DtPQz8Kg.cjs');
5
+ const unplugin = require('./shared/unplugin.DUI48s3S.cjs');
6
6
  require('node:crypto');
7
7
  require('node:fs');
8
8
  require('node:module');
@@ -21,7 +21,7 @@ require('postcss');
21
21
  require('postcss-selector-parser');
22
22
  require('./shared/unplugin.DmuOKVS4.cjs');
23
23
  require('./shared/unplugin.DVCQC5wq.cjs');
24
- require('./shared/unplugin.CcA7jP1r.cjs');
24
+ require('./shared/unplugin.BkRah5Ot.cjs');
25
25
  require('postcss-value-parser');
26
26
 
27
27
 
package/dist/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { ae } from './shared/unplugin.CNwV3RrQ.cjs';
1
+ import { ae } from './shared/unplugin.CjCKWnoX.cjs';
2
2
  export = ae;
3
3
  import '@csszyx/compiler';
4
4
  import '@csszyx/types';
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { ae as default } from './shared/unplugin.CNwV3RrQ.mjs';
1
+ export { ae as default } from './shared/unplugin.CjCKWnoX.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { $ as default } from './shared/unplugin.DtYxS8M8.mjs';
1
+ export { $ as default } from './shared/unplugin.wx3cvxxX.mjs';
2
2
  import 'node:crypto';
3
3
  import 'node:fs';
4
4
  import 'node:module';
@@ -17,5 +17,5 @@ import 'postcss';
17
17
  import 'postcss-selector-parser';
18
18
  import './shared/unplugin.nnsa7OVW.mjs';
19
19
  import './shared/unplugin.D-K57LNR.mjs';
20
- import './shared/unplugin.TtmP77BS.mjs';
20
+ import './shared/unplugin.B3XoSRB8.mjs';
21
21
  import 'postcss-value-parser';
package/dist/webpack.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.DtPQz8Kg.cjs');
5
+ const unplugin = require('./shared/unplugin.DUI48s3S.cjs');
6
6
  require('node:crypto');
7
7
  require('node:fs');
8
8
  require('node:module');
@@ -21,7 +21,7 @@ require('postcss');
21
21
  require('postcss-selector-parser');
22
22
  require('./shared/unplugin.DmuOKVS4.cjs');
23
23
  require('./shared/unplugin.DVCQC5wq.cjs');
24
- require('./shared/unplugin.CcA7jP1r.cjs');
24
+ require('./shared/unplugin.BkRah5Ot.cjs');
25
25
  require('postcss-value-parser');
26
26
 
27
27
 
@@ -1,4 +1,4 @@
1
- import { af } from './shared/unplugin.CNwV3RrQ.cjs';
1
+ import { af } from './shared/unplugin.CjCKWnoX.cjs';
2
2
  export = af;
3
3
  import '@csszyx/compiler';
4
4
  import '@csszyx/types';
@@ -1,4 +1,4 @@
1
- export { af as default } from './shared/unplugin.CNwV3RrQ.mjs';
1
+ export { af as default } from './shared/unplugin.CjCKWnoX.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { a0 as default } from './shared/unplugin.DtYxS8M8.mjs';
1
+ export { a0 as default } from './shared/unplugin.wx3cvxxX.mjs';
2
2
  import 'node:crypto';
3
3
  import 'node:fs';
4
4
  import 'node:module';
@@ -17,5 +17,5 @@ import 'postcss';
17
17
  import 'postcss-selector-parser';
18
18
  import './shared/unplugin.nnsa7OVW.mjs';
19
19
  import './shared/unplugin.D-K57LNR.mjs';
20
- import './shared/unplugin.TtmP77BS.mjs';
20
+ import './shared/unplugin.B3XoSRB8.mjs';
21
21
  import 'postcss-value-parser';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.11.8",
3
+ "version": "0.11.9",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -117,14 +117,14 @@
117
117
  "postcss-value-parser": "^4.2.0",
118
118
  "proper-lockfile": "^4.1.2",
119
119
  "unplugin": "^1.10.1",
120
- "@csszyx/core": "0.11.8",
121
- "@csszyx/types": "0.11.8",
122
- "@csszyx/vue-adapter": "0.11.8",
123
- "@csszyx/compiler": "0.11.8",
124
- "@csszyx/svelte-adapter": "0.11.8"
120
+ "@csszyx/compiler": "0.11.9",
121
+ "@csszyx/core": "0.11.9",
122
+ "@csszyx/svelte-adapter": "0.11.9",
123
+ "@csszyx/types": "0.11.9",
124
+ "@csszyx/vue-adapter": "0.11.9"
125
125
  },
126
126
  "peerDependencies": {
127
- "@csszyx/runtime": "^0.11.8"
127
+ "@csszyx/runtime": "^0.11.9"
128
128
  },
129
129
  "devDependencies": {
130
130
  "@tailwindcss/node": "4.3.2",