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

@Adammatthiesen
Copy link
Member

Hey! Sorry about the delay, i will be getting to this here soon! need to setup some automations first so that some things can be easier to maintain accross the board... as i initially copied this package for usage in my studiocms project but we recently moved away from UnoCSS all together. I know it has gotten a bit out of date as well 😅

@AerisG222
Copy link
Author

No worries and Happy New Year! I came across another project and plan to use that going forward (https://github.com/ameinhardt/unocss-preset-daisy). As such, if you aren't using this any more, please don't spend the time to work on it.

Thanks!

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.

2 participants