Fix minified CSS variable extraction, add build integration tests#34
Merged
Fix minified CSS variable extraction, add build integration tests#34
Conversation
The regex patterns for extracting --color-*, --font-*, --text-*, and
--radius-* variables included a trailing [;}]? that consumed the
delimiter. In minified CSS (single line), this starved the next match's
(?:^|[;{}]) anchor, causing every other variable to be skipped — e.g.
only 6 of 11 color shades were extracted.
Drop the trailing [;}]? since [^;}]+ already stops before the delimiter.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Works around npm optional dependency resolution bug (npm/cli#4828) that causes @tailwindcss/oxide platform binaries to be missing when installing without a lock file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Node 18 is unsupported by Tailwind v4. Adding @tailwindcss/oxide as an explicit devDependency ensures npm installs the platform-specific native binaries (works around npm/cli#4828). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[;}]?trailing each CSS variable extraction pattern consumed the delimiter that the next match needed for its(?:^|[;{}])anchor. In minified CSS (single line), this caused every other variable to be skipped — e.g. only 6 of 11 color shades extracted. Affects--color-*,--font-*,--text-*, and--radius-*patterns.tests/build.test.ts) that runs a realvite buildwith Tailwind against a minimal theme fixture (tests/fixture/) and verifies the generated theme.json output. Covers color palette completeness, color families, font families, font sizes, border radius, and disable flags.Regression
Introduced in v1.3.0 via #33 when the regex patterns were updated to filter out namespace wildcard resets. The
(?:^|[;{}])prefix was added correctly, but the existing[;}]?suffix became a problem — in minified CSS it consumes the;separator, starving the next match's anchor.Test plan
npx vitest run— all 64 tests pass (58 existing unit tests + 6 new integration tests)🤖 Generated with Claude Code