Cleaner syntax for applying multiple utilities to pseudo-elements (before:, after:, first-letter:, etc.) #18913
mdtaufiquekhan
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
There have been suggestions about adding such a feature. The maintainers have addressed this request before, that you may wish to read up on if you have not already done so: |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi Tailwind team and community 👋,
I’d like to start a discussion about how we handle pseudo-elements (::before, ::after, ::first-letter, etc.) in Tailwind.
When styling pseudo-elements in Tailwind, we currently repeat the prefix for every single utility.
For example:
This works well, but it feels verbose compared to standard CSS, where we write all styles in a single selector:
🔹 Discussion Idea
Would it make sense to explore a more concise syntax for applying multiple utilities to the same pseudo-element?
For example:
This could:
🔹 Why Start This Conversation
Pseudo-elements (::before, ::after, ::first-letter, ::selection, etc.) are widely used.
Has anyone else felt this pain point?
Would this kind of syntax fit Tailwind’s philosophy, or is explicit repetition better?
Thanks for reading! Excited to hear the community’s thoughts! 🙌
Beta Was this translation helpful? Give feedback.
All reactions