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

Show pixel equivalents in completions and hovers of the theme() helper #935

Merged
merged 6 commits into from
Mar 26, 2024

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Mar 25, 2024

When using the theme() helper we didn't transform values as Tailwind itself would when emitting into the CSS file. Now we do and also show pixel equivalents for rem values.

Before:

["1.125rem", {lineHeight: "1.75rem"}] // fontSize.xl
"0.5rem" // spacing.2

After:

1.125rem/* 18px */ // fontSize.xl
0.5rem/* 8px */ // spacing.2

Fixes #927

Copy link
Member

@RobinMalfait RobinMalfait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I think only thing that comes to mind is that it's rather complex right now (but we can clean that up in separate PRs)

The other thing is that it would be nice to have a space between the value and the comment:

- 1.125rem/* 18px */
- 0.5rem/* 8px */
+ 1.125rem /* 18px */
+ 0.5rem /* 8px */

Copy link
Member

@RobinMalfait RobinMalfait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the whitespace 😍

@thecrypticace thecrypticace merged commit 37c4b96 into master Mar 26, 2024
@thecrypticace thecrypticace deleted the fix/theme-pixel-equivalents branch March 26, 2024 14:44
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.

showPixelEquivalents not working with theme()
2 participants