Skip to content

Ensure first argument to var(…) still unescapes \_#16206

Merged
philipp-spiess merged 5 commits into
mainfrom
fix/var-unescape-underlines
Feb 4, 2025
Merged

Ensure first argument to var(…) still unescapes \_#16206
philipp-spiess merged 5 commits into
mainfrom
fix/var-unescape-underlines

Conversation

@philipp-spiess

Copy link
Copy Markdown
Contributor

Resolves #16170

This PR fixes an issue where the previously opted-out escaping of the first argument for the var(…) function was not unescaped at all. This was introduced in #14776 where the intention was to not require escaping of underscores in the var function (e.g. ml-[var(--spacing-1_5)]). However, I do think it still makes sense to unescape an eventually escaped underline for consistency.

Test plan

The example from #1670 now parses as expected:

Screenshot 2025-02-03 at 13 51 35

@philipp-spiess philipp-spiess requested a review from a team as a code owner February 3, 2025 12:51
Comment thread packages/tailwindcss/src/candidate.test.ts Outdated
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
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.

[v4] Inconsistent underscore

2 participants