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

handle additional cases where rules were getting dropped #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AerisG222
Copy link

First off, thanks for keeping this preset updated and publishing to npm!

I've been using this in a project and was having difficulty when trying to use tabs where the input element could control showing/hiding the active content. After digging into this, there are some rules/styles from daisy that seem to be slipping through the cracks as they have a token type of 'type' and resulted in a base defined as an empty string, so they would not get matched by unocss.

The proposed fix is to check for this case and try to define a reasonable base to use, which the implementation finds by scanning the selector for the last class, with the assumption that is the most specific. The specific case I was running into was for the following:

input.tab:checked + .tab-content

When testing, I also noticed that there was another variation of the 'type' case where base was still not getting set, for the drawer component, so i added a check for that as well.

Both of these seem to be handled properly by the test / demo file now.

Thanks again!
-mike

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.

1 participant