tailwind-styled-v4 5.0.20 → 5.0.22

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/shared.mjs CHANGED
@@ -3506,7 +3506,13 @@ function extractStaticStateCss(srcDir, options = {}) {
3506
3506
  cssBlocks.push(`/* ${componentName} */`);
3507
3507
  for (const rule of rules) {
3508
3508
  cssBlocks.push(`/* state: ${rule.stateName} */`);
3509
- cssBlocks.push(rule.cssRule);
3509
+ const isUnresolved = rule.declarations.trim().length > 0 && !rule.declarations.includes(":");
3510
+ if (isUnresolved) {
3511
+ const applyClasses = rule.declarations.trim().split(/\s+/).join(" ");
3512
+ cssBlocks.push(`${rule.selector} { @apply ${applyClasses}; }`);
3513
+ } else {
3514
+ cssBlocks.push(rule.cssRule);
3515
+ }
3510
3516
  }
3511
3517
  cssBlocks.push("");
3512
3518
  }
@@ -3523,7 +3529,11 @@ function extractStaticStateCss(srcDir, options = {}) {
3523
3529
  return result;
3524
3530
  }
3525
3531
  function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
3526
- const result = extractStaticStateCss(srcDir, options);
3532
+ const result = extractStaticStateCss(srcDir, {
3533
+ verbose: options.verbose,
3534
+ resolvedCss: options.resolvedCss || ""
3535
+ // ← ensure always passed
3536
+ });
3527
3537
  const twClassesDir = path__default.join(path__default.dirname(safelistPath), "tw-classes");
3528
3538
  fs3__default.mkdirSync(twClassesDir, { recursive: true });
3529
3539
  const stateFilePath = path__default.join(twClassesDir, TW_STATE_STATIC_FILENAME);