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 reset ::first-letter in Preflight #13408

Merged
merged 2 commits into from
Mar 30, 2024
Merged

Conversation

adamwathan
Copy link
Member

Resolves #13405

Previously we were applying our global reset rules to the ::first-letter pseudo to ensure it interacted with utility classes the same way as other elements, but touching that pseudo has some unfortunate side effects, including causing ::selection styles to not apply to the first letter as well as showing the default mouse cursor when hovering over the first letter instead of the text selection cursor.

I don't think there's anything really lost by removing this, because ::first-letter already has no padding or margin applied and doesn't support box-sizing. The only place it would have mattered previously is border styles, but now that we don't actually rely on Preflight in order to set border-style when adding a border-* utility, this will work fine anyways. Even if it didn't, it would be a better trade off to have to add first-letter:border-solid when necessary vs. dealing with the side-effects I've mentioned of touching that pseudo-element.

@adamwathan adamwathan merged commit 4aefd26 into next Mar 30, 2024
1 check passed
@adamwathan adamwathan deleted the remove-first-letter-reset branch March 30, 2024 12:06
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.

[v4] ::first-letter reset causes inaccurate text selection
1 participant