-
-
Notifications
You must be signed in to change notification settings - Fork 9
Fix Data Attributes Selectors #12
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
Fix Data Attributes Selectors #12
Conversation
Hi @Publicker thanks for PR, I have been taking some time to look at the new features in tailwinds, and found some CSS classes that don't obfuscate for many reasons but mainly due to: the regex used to parse CSS selectors. {/* Solved */}
{/* only removes CSS [attribute*=value] selectors when the `[` is not preceded by `-\`.
thus it avoids tailwind`s arbitrary values, & data attributes */}
{/*
.totest[href="value"] {
...
}
*/}
<span class="totest">1</span>
<span class="pt-[100px]">2</span>
<span class="data-[size=large]:p-8">3</span>
<span class="data-[href='active']:bg-green-100">4</span>
<span class="data-[size=large]:p-8">5</span>
<span class="group-data-[status='active']:text-green-700">6</span>
{/* Not yet solved */}
{/* problem with parsing . as a new class */}
<span class="group-[.is-published]:block">8</span>
<span class="peer-[.is-dirty]:peer-required:block">10</span>
{/* prblm with (*) beign removed */}
<span class="group-[:nth-of-type(3)_&]:block">9</span>
<span class="[@supports(display:grid)]:grid">7</span>
<span class="[@media(any-hover:hover){&:hover}]:opacity-100">12</span> As per your commits unfortunately your solution only works for your situation & won't work for CSS [attribute*=value]. So ill make a commit for you in a minute to test my new solution, and ill open issue/issues for the rest |
@Publicker plz check the solution : a71e8b7 |
@n4j1Br4ch1D Thanks for the explanation. I just tested the solution in the mentioned commit and seems to be working for data attributes 👍🏻. |
@Publicker glad it does: only #14 is left it will be solved soon, and all fixes will be released on the next version soon. |
@n4j1Br4ch1D I'm sure that will be ready sooner than I expect! Keep the good work going! |
This pull request addresses an issue (#11) where data attributes were not functioning as expected.
The selectors for data attributes have been fixed and now operate correctly. This has been tested with TailwindCSS data attributes, and the functionality has been confirmed.
Please review these changes to ensure that the data attributes are now functioning as intended.