tailwindcss-typography icon indicating copy to clipboard operation
tailwindcss-typography copied to clipboard

Move common, trailing pseudo elements when generating selectors

Open thecrypticace opened this issue 3 years ago • 1 comments

Fixes #280

There are some bugs in Tailwind's own selector rewriting for variants but also some bugs in our own selector rewriting. Use postcss-selector-parser to more properly handle selector rewriting of trailing pseudo elements.

This fixes the selector rewriting to check all simple selector sequences in each of the keys in theme.typography.*.css and extracts ::before, ::after, ::marker, and any other pseudo element only when they're the same across each of the selectors — including order. The reason for this is that it's possible in the future stacked pseudo elements could become a thing (there's a note in the CSS spec somewhere — but I forget where) meaning ::marker::before could mean something different from ::before::marker (even though both don't make sense or do anything right now).

thecrypticace avatar Aug 16 '22 03:08 thecrypticace

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
tailwindcss-typography ✅ Ready (Inspect) Visit Preview Aug 17, 2022 at 5:40PM (UTC)

vercel[bot] avatar Aug 16 '22 03:08 vercel[bot]