Skip to content

[v4] ::first-letter reset causes inaccurate text selection #13405

Closed
@mdillgen

Description

@mdillgen

What version of Tailwind CSS are you using?

v4.0.0-alpha.11

What build tool (or framework if it abstracts the build tool) are you using?

Next.js v14.1.4

What version of Node.js are you using?

v20.9.0

What browser are you using?

Chrome, Safari

What operating system are you using?

macOS

Reproduction URL

https://github.com/mdillgen/tw4-test.git

Describe your issue

In this Tailwind version, some rules of the preflight (or CSS reset) have been extended by the ::first-letter pseudo-element. This leads to the – in my opinion undesirable – side effect, that rules for the ::selection pseudo-element (formatting of selected text) are not applied to the first character of text elements. The character is handled separately, somewhat out of the flow.

See the attached screen recording, which illustrates this issue.

Please note that the problem occurs at least in Chrome and Safari and does not occur in Firefox (MacOS).

tw4-first-letter-issue.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions