Skip to content

fix: preserve page custom theme variables#981

Merged
sonofmagic merged 3 commits into
mainfrom
codex/issue-978
Jul 9, 2026
Merged

fix: preserve page custom theme variables#981
sonofmagic merged 3 commits into
mainfrom
codex/issue-978

Conversation

@sonofmagic

Copy link
Copy Markdown
Owner

Summary

  • Narrow Tailwind v4 generated theme-scope cleanup so user-defined page/:host,page custom properties are preserved.
  • Add regression coverage for --color-* and --font-* variables declared in global page styles.
  • Add a patch changeset for the user-visible bug fix.

Fixes #978

Verification

  • pnpm --filter weapp-tailwindcss exec vitest run test/bundlers/shared/generator-css/user-css.test.ts test/bundlers/generator-css.unit.test.ts
  • pnpm --filter @weapp-tailwindcss/postcss exec vitest run test/mini-program-generated-css.test.ts
  • pnpm --filter @weapp-tailwindcss/postcss test
  • git diff --check

Notes

pnpm --filter weapp-tailwindcss test was also attempted in the fresh worktree, but the full package suite failed on existing environment/snapshot issues unrelated to this change, including missing weapp-style-injector/vite built exports and Tailwind v4.3.2 output snapshot differences. The targeted generator/PostCSS suites covering this fix passed.

@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e061b75

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
weapp-tailwindcss Patch
@weapp-tailwindcss/build-all Patch
@weapp-tailwindcss/website Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sonofmagic sonofmagic merged commit c860fdc into main Jul 9, 2026
46 checks passed
@sonofmagic sonofmagic mentioned this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 自定义 CSS 变量因为冲突被丢弃

1 participant