Skip to content

Commit 8983be0

Browse files
sophie721Sophie Suhannoeru
authored
feat: add pseudo element content examples in docs (#180)
Co-authored-by: Sophie Su <[email protected]> Co-authored-by: ハン / Han <[email protected]>
1 parent 7b51475 commit 8983be0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

utilities/general/variants.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ For example, you could then use `print:hidden` to hide elements when styling for
135135
| marker | `.{utility} *::marker, {utility}::marker` | Targets the marker pseudo-element. Can be used inheritable. |
136136
| selection | `.{utility}::selection { ... }` | Targets the selection pseudo-element. |
137137

138+
#### Pseudo Element Content
139+
140+
The content utilities generate the corresponding content css, such as `content: ""`, which can be very helpful in many cases.
141+
142+
<PlaygroundWithVariants
143+
variant='[&quot;&quot;]'
144+
:variants="['DEFAULT', '[&quot;&quot;]', '👍', 'open-quote', '\[attr(after)\]']"
145+
prefix='after:content'
146+
fixed='after:text-red-500 after:pl-2 after:inline-block'
147+
html='&lt;div class="{class}" after="after text"&gt;Element&lt;/div&gt;'
148+
/>
149+
138150
### Parent Selectors
139151

140152
| Variant | Rule | Description |

0 commit comments

Comments
 (0)