FoundationsPseudo Elements

Pseudo-elements

Apply utilities to specific parts of elements using pseudo-elements.

Pseudo-element variants allow you to style ::before, ::after, ::selection, and ::placeholder elements using simple prefixes.

Before

Creates a pseudo-element that is the first child of the selected element.

Pseudo-elements require content to be visible. Make sure to set content via CSS or inline styles when using ::before.
<div class="p-r b::p-a b::i-0 b::bg-indigo/10 p-8">
Styled content
</div>

After

Creates a pseudo-element that is the last child of the selected element.

Like ::before, the ::after pseudo-element requires content to be visible.
<div class="p-r a::p-a a::c-indigo">
Styled content
</div>

Selection

Applies styles to highlighted/selected text.

Try selecting the text below to see the custom selection styling.

Select this text to see custom selection colors!

<p class="s::bg-indigo c-black">Select this text to see custom selection colors!</p>

Placeholder

Styles the placeholder text for input or textarea elements.

Try focusing on the input to see the placeholder styling.
<input class="p::c-silver bw-1 bc-silver p-3 w-full" placeholder="Enter your email..." />

Here's a reference for all the pseudo-element variants available in Yumma CSS:

Pseudo-elementPrefixDescription
::aftera::*Styles the last child pseudo-element
::beforeb::*Styles the first child pseudo-element
::selections::*Styles the portion of text that is selected
::placeholderp::*Styles placeholder text in inputs and textareas