Skip to content

[v3] Reject invalid hyphen-prefixed arbitrary property names - #20656

Open
akasakariko wants to merge 1 commit into
tailwindlabs:v3from
akasakariko:fix/invalid-arbitrary-properties-20654
Open

akasakariko wants to merge 1 commit into
tailwindlabs:v3from
akasakariko:fix/invalid-arbitrary-properties-20654

Conversation

@akasakariko

@akasakariko akasakariko commented Nov 2, 2026 •

Copy link
Copy Markdown

Summary

Fixes #20654

  • Require a leading hyphen in an arbitrary property name to be followed by a letter, underscore, or another hyphen
  • Ignore invalid candidates such as [-:T] extracted from /[-:T]/g and [-1:foo] before generating CSS
  • Preserve vendor-prefixed properties and custom properties without making the extractor language-aware
  • Extend the existing arbitrary property tests to cover the regression and a valid vendor-prefixed property

Reproduction

  • Confirmed the regression test fails before the fix and passes afterward
  • Ran npm run build-only in the issue reproduction project with Vite 8.3.5 and Lightning CSS 1.33.0
  • Published Tailwind CSS 3.4.19 fails with Unexpected token Semicolon at -: T;
  • Linking the local build with this fix makes the same production build succeed

Validation

  • npm test -- --runInBand tests/arbitrary-properties.test.js tests/default-extractor.test.js tests/arbitrary-values.test.js — 91 tests passed
  • npm run build — passed
  • npm test -- --runInBand on Node 24.19.0 — 86 suites, 1062 tests and 4 snapshots passed, 1 existing todo
  • node node_modules/jest/bin/jest.js --runInBand on Node 14.21.3 and Node 18.20.8 — the same full suite passed on both versions, with Node 14 running as x64 under Rosetta
  • npm run test --prefix ./integrations/vite — 7 integration tests passed
  • npm run style — passed
  • npx --no-install prettier --check src/lib/generateRules.js tests/arbitrary-properties.test.js — passed
  • git diff --check — passed

GitHub CI

  • Stable CI and integration workflows are waiting for maintainer approval with action_required and no jobs started
  • The results above are local verification, not GitHub CI results

@akasakariko
akasakariko requested a review from a team as a code owner November 2, 2026 16:12
@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Reviews (1) · Last reviewed commit: "Reject invalid hyphen-prefixed arbitrary..." · Reviewed by Greptile

@RobinMalfait RobinMalfait added the v3 label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants