Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix compoundSlots with boolean variants #119

Merged
merged 2 commits into from
Oct 27, 2023
Merged

Conversation

mskelton
Copy link
Collaborator

@mskelton mskelton commented Oct 26, 2023

PR #118 broke compoundSlots when using boolean variants. This PR fixes that by checking if the slot value is an array and then either doing .includes() or full equality checking.

I also updated the tests to do length checks on the class names to ensure that no extra class names slip in, as this was the issue that this PR fixes. I noticed in our usage of tailwind-variants with boolean variants that we were always getting the true value, even when false. The length checks should help prevent false positives.

@mskelton mskelton requested a review from jrgarciadev October 26, 2023 15:39
Copy link
Member

@jrgarciadev jrgarciadev left a comment

Choose a reason for hiding this comment

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

Good catch, thank you! @mskelton 🙏🏻

@jrgarciadev jrgarciadev merged commit 6e1ba30 into main Oct 27, 2023
@mskelton mskelton deleted the fix-compound-slots branch October 28, 2023 18:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants