Adding nth-child functional notation utility classes #1890
im-ironclad
started this conversation in
Ideas
Replies: 2 comments
-
Still nothing on this, should I just open a PR instead? |
Beta Was this translation helpful? Give feedback.
0 replies
-
No plans to add this in core right now but I would recommend authoring it as a plugin, and if the plugin gets a lot of traction we can definitely revisit adding it to core 👍 |
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.
-
Hello,
One of the things that have kept me from fully adopting tailwind in the past were a lack of utilities for things I felt I needed. For a while that was transitions and since those have been added and work well i noticed there is no support for these pseudo classes such as
nth-child(2n+2)
. While cloning and dabbling with the tailwind repo I figured out how to create functional notation selectors up to X amount with around 30 lines of code excluding tests. I decided in my initial approach to name the utility classes something like this "nth3n2:bg-black" which are used the same way as the even and odd utilities. I also verified the selectors worked locally. The "3" and "2" are dynamic up to X. Of course my solution doesn't have to be the final solution I'd just like to verify that it's possible without too much bloat.I opened this discussion to first discuss and see what the reception of the idea to add them would be before I try to make it any more official.
Beta Was this translation helpful? Give feedback.
All reactions