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

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

Closed
mdillgen opened this issue Mar 30, 2024 · 2 comments · Fixed by #13408
Closed

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

mdillgen opened this issue Mar 30, 2024 · 2 comments · Fixed by #13408

Comments

@mdillgen
Copy link

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
@adamwathan
Copy link
Member

Thanks! Fixed here: #13408

@mdillgen
Copy link
Author

Hey @adamwathan , thanks for your quick response and quick fix. Unfortunately, after the update, when I try to run the app, it throws an error:

Failed to compile.

src/app/layout.tsx
An error occured in `next/font`.

Error: Cannot find module '@tailwindcss/oxide-darwin-x64'
Require stack:
- /Users/md/Desktop/tw4-test/node_modules/@tailwindcss/oxide/index.js
- /Users/md/Desktop/tw4-test/node_modules/@tailwindcss/postcss/dist/index.js
- /Users/md/Desktop/tw4-test/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
- /Users/md/Desktop/tw4-test/node_modules/next/dist/build/webpack/config/blocks/css/index.js
- /Users/md/Desktop/tw4-test/node_modules/next/dist/build/webpack/config/index.js
- /Users/md/Desktop/tw4-test/node_modules/next/dist/build/webpack-config.js
- /Users/md/Desktop/tw4-test/node_modules/next/dist/build/webpack-build/impl.js
- /Users/md/Desktop/tw4-test/node_modules/next/dist/compiled/jest-worker/processChild.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at /Users/md/Desktop/tw4-test/node_modules/next/dist/server/require-hook.js:55:36
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at mod.require (/Users/md/Desktop/tw4-test/node_modules/next/dist/server/require-hook.js:65:28)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/Users/md/Desktop/tw4-test/node_modules/@tailwindcss/oxide/index.js:127:29)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)


> Build failed because of webpack errors

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 a pull request may close this issue.

2 participants