tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Handle utilities with `1` keys in a JS config

Open thecrypticace opened this issue 1 month ago • 1 comments

Fixes #19250

When converting a JS config to a series of theme keys we special case a key of 1, treat it as if it were tuple access, and turn that into nested theme keys.

This isn't 100% correct though because a user can use 1 in an object instead of an array — in which case we should generate normal theme keys with a 1 in the variable name instead of one with a nested theme key separator (--).

Because the conversion works based on key paths we need to treat a path like colors.a.1.b as both --color-a-1-b and --color-a--b. This ensures a utility like text-a-1-b works as expected.

thecrypticace avatar Nov 03 '25 17:11 thecrypticace