Skip to main content

Visibility

Set whether an element is visible or hidden.

View as Markdown
baselinewidely
ClassCSS
v:cvisibility: collapse;
v:hvisibility: hidden;
v:vvisibility: visible;

Variants

Prefix any class with a variant to apply it only under that condition. Variants stack, as in @md:h:v:h.

Breakpoints

Apply a class from a viewport width up. Each breakpoint covers its width & every width above it.

@xs:v:hFrom 32rem up.
@sm:v:hFrom 40rem up.
@md:v:hFrom 48rem up.
@lg:v:hFrom 64rem up.
@xl:v:hFrom 80rem up.
@xxl:v:hFrom 96rem up.

Containers

Apply a class from a container's width up, not the viewport's. Mark the parent with ct:is first.

@c:xs:v:hContainer from 32rem up.
@c:sm:v:hContainer from 40rem up.
@c:md:v:hContainer from 48rem up.
@c:lg:v:hContainer from 64rem up.
@c:xl:v:hContainer from 80rem up.
@c:xxl:v:hContainer from 96rem up.

Media

Apply a class when the device or the page matches a condition, or on the first frame an element renders.

@pc:v:hOn a touch screen.
@prm:v:hWith reduced motion on.
@st:v:hOn the first frame.

States

Apply a class only while the element is in a state, such as hovered, focused or checked.

h:v:hOn :hover.
f:v:hOn :focus.
fv:v:hOn :focus-visible.
a:v:hOn :active.
d:v:hOn :disabled.
fc:v:hOn :first-child.
c:v:hOn :checked.
e:v:hOn :empty.
fw:v:hOn :focus-within.
i:v:hOn :invalid.
in:v:hOn :indeterminate.
lc:v:hOn :last-child.
nc:v:hOn :nth-child.
r:v:hOn :required.
ro:v:hOn :read-only.
v:v:hOn :valid.

Pseudo Elements

Style a part of the element rather than the element itself, such as its placeholder or the selected text.

a::v:hOn ::after.
b::v:hOn ::before.
p::v:hOn ::placeholder.
s::v:hOn ::selection.