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

[Feature]: Tailwind will automatically add content: ''. #405

Closed
hastebrot opened this issue Dec 5, 2022 · 1 comment · Fixed by #417
Closed

[Feature]: Tailwind will automatically add content: ''. #405

hastebrot opened this issue Dec 5, 2022 · 1 comment · Fixed by #417
Labels
✨ Feature Request Something should be added preset:tailwind Affects @twind/preset-tailwind 🌬 Tailwind CSS compatibility Some feature of Tailwind CSS is missing or not working as expected

Comments

@hastebrot
Copy link

Describe the problem

Tailwind's preflight base styles will include content-[''] any time you use the before and after modifiers.

Documentation: https://tailwindcss.com/docs/hover-focus-and-other-states#before-and-after

play tailwindcss com_MGVcBctNEX

Describe the proposed solution

It should detect when I use before:.. and after:... classes and generate content: "".

Tailwind does something like:

.before\:absolute::before {
  content: var(--tw-content);
  position: absolute;
}

Twind already has

::before,
::after {
	--tw-content: "";
}

But does no futher things it seems.

Alternatives considered

Define it explicitly: <div class="before:content-[''] before:block ...">

Importance

nice to have

Additional Information

No response

@hastebrot hastebrot added the ✨ Feature Request Something should be added label Dec 5, 2022
@sastan
Copy link
Collaborator

sastan commented Dec 6, 2022

Thanks for reporting this issue. Tailwindcss v3.2 support is still missing (https://twind.style/preset-tailwind#-compatibility). I have hoped to implement it this week but my family needs me right now.

@sastan sastan added 🌬 Tailwind CSS compatibility Some feature of Tailwind CSS is missing or not working as expected preset:tailwind Affects @twind/preset-tailwind labels Dec 6, 2022
@sastan sastan closed this as completed in 58c8700 Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Request Something should be added preset:tailwind Affects @twind/preset-tailwind 🌬 Tailwind CSS compatibility Some feature of Tailwind CSS is missing or not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants