How to deal with "duplicate" @variant-s? #18470
Unanswered
verheyenkoen
asked this question in
Help
Replies: 1 comment
-
Good thought. On the same note, just attaching that nested doesn't work either: #18152 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have implemented some code to also apply hover effects for links when they are tapped on touch devices. Long story short, I add a data-attribute "touched" during the
ontouchstart
event (which is removed again after a few seconds).In some places where I use Tailwind classnames I have to duplicate them, eg:
class="hover:underline data-touched:underline"
.Wherever I use custom CSS files, I use the
@variant
construct with@apply
rules, like this:I'd prefer to be able to do something like:
but that doesn't seem to be possible.
This example is quite maintainable but in practice the rules are much more advanced. Are there any ways to simplify this without duplicity?
Beta Was this translation helpful? Give feedback.
All reactions