Skip to content
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

Don't include .prose in :where pseudos #352

Closed
wants to merge 2 commits into from
Closed

Don't include .prose in :where pseudos #352

wants to merge 2 commits into from

Conversation

adamwathan
Copy link
Member

Fixes #351.

This PR changes the way we generate CSS for parts of the selector that start with a direct child combinator (>).

Previously we'd generate a selector like this:

.prose :where(.prose > :first-child) { ... }

The problem is the .prose within the :where() isn't replace if you @apply prose, so the class where you're doing the @apply doesn't actually behave the same as using prose directly in your markup.

My instinct is that people just shouldn't do that but it's a fairly easy fix so whatever:

.prose > :where(:first-child) { ... }

I'm somewhat suspicious that we didn't do this in the first place, so there might be a reason this doesn't actually work. Curious if @thecrypticace or @RobinMalfait can think of any reason this would be an issue.

Copy link

vercel bot commented Apr 24, 2024

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

Name Status Preview Comments Updated (UTC)
tailwindcss-typography ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2024 0:42am

@thecrypticace
Copy link
Contributor

thecrypticace commented Apr 24, 2024

See #266 and #268

tl;dr the selectors aren't equivalent

@adamwathan
Copy link
Member Author

Closing because terrible! Not sure this one can really be made to work with the v3 architecture unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@apply prose is failing the first- and last-child selectors
2 participants