different behaviour on pseudo :before :after
See original GitHub issuefor 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" />
for windicss:
<div className="relative w-4 h-4 bg-red-400 after:(absolute top-4 w-full h-full bg-blue-400)" />
According to tailwindcss
We set content: “” automatically any time you use a before or after variant to make sure the elements are rendered
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
On the other hand, give a pseudo usage demo on the website please.
Same problem. If Windi CSS does not provide a default
content: ""
, then the pseudo likeafter
orbefore
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 triedcontent-
,content-' '
,content-[' ']
, none of them works.