question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

different behaviour on pseudo :before :after

See original GitHub issue

for tailwindcss:

<div className="relative w-4 h-4 bg-red-400 after:absolute after:top-4 after:w-full after:h-full after:bg-blue-400" />

image for windicss:

<div className="relative w-4 h-4 bg-red-400 after:(absolute top-4 w-full h-full bg-blue-400)" />

image According to tailwindcss

We set content: “” automatically any time you use a before or after variant to make sure the elements are rendered

reproduce repository

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
yunsiicommented, Jan 21, 2022

On the other hand, give a pseudo usage demo on the website please.

4reactions
hengstchoncommented, Jan 13, 2022

Same problem. If Windi CSS does not provide a default content: "", then the pseudo like after or before will not show up as we expect.

However, if we manually set content like after:(content-TEXT), it works, but I just don’t know how to set an empty content. Have tried content-&nbsp;, content-' ', content-[' '], none of them works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the correct behavior of ::before and ::after pseudo ...
::after represents a styleable child pseudo-element immediately after the originating element's actual content.
Read more >
::before / ::after | CSS-Tricks - CSS-Tricks
It is pretty confusing, but there is indeed a difference. Both ::before and ::after are called pseudo-elements because they elements in and of ......
Read more >
before - CSS: Cascading Style Sheets - MDN Web Docs
In CSS, ::before creates a pseudo-element that is the first child of the selected element. It is often used to add cosmetic content...
Read more >
Before and After pseudo elements explained - part one
The before and after pseudo elements are super useful part of CSS, but are often misunderstood. This is part of a three-part series...
Read more >
Understanding CSS Before and After Pseudo-elements
The after pseudo element is quite similar to the before , the only difference is its positioning which is after the last child...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found