Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip calc() normalisation in nested theme() calls #11705

Merged
merged 3 commits into from
Jul 27, 2023
Merged

Conversation

RobinMalfait
Copy link
Contributor

This PR fixes an issue where the normalisation of whitespace around operators inside calc() wasn't working as expected if a nested theme() was used that happens to contain "operators" as well.

If you have the following utility:

top-[calc(1rem-theme(spacing.1-bar))]

Then it looks like there is a spacing value with a name of 1-bar, we don't want to format this to 1 - bar, but the result of this before this PR looked like this:

calc(1rem - theme(spacing.1 - bar))

After this PR, the result now looks like this:

calc(1rem - theme(spacing.1-bar))

Fixes: #11704

@RobinMalfait RobinMalfait merged commit a72d97c into master Jul 27, 2023
10 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-11704 branch July 27, 2023 15:50
thecrypticace pushed a commit that referenced this pull request Oct 23, 2023
* add `calc` normalisation test cases using `theme()`

* ignore formatting in some known functions, such as `theme`

* update changelog
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.

theme keys with dashes wrongly normalized in calc()
1 participant