Skip to main content

Flex

Set how flex items grow & shrink.

View as Markdown
baselinewidely
ClassCSS
f:1flex: 1;
f:2flex: 2;
f:3flex: 3;
f:4flex: 4;
f:5flex: 5;
f:6flex: 6;
f:autoflex: auto;
f:noneflex: none;

Variants

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

Breakpoints

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

@xs:f:4From 32rem up.
@sm:f:4From 40rem up.
@md:f:4From 48rem up.
@lg:f:4From 64rem up.
@xl:f:4From 80rem up.
@xxl:f:4From 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:f:4Container from 32rem up.
@c:sm:f:4Container from 40rem up.
@c:md:f:4Container from 48rem up.
@c:lg:f:4Container from 64rem up.
@c:xl:f:4Container from 80rem up.
@c:xxl:f:4Container 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:f:4On a touch screen.
@prm:f:4With reduced motion on.
@st:f:4On the first frame.

States

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

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

Pseudo Elements

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

a::f:4On ::after.
b::f:4On ::before.
p::f:4On ::placeholder.
s::f:4On ::selection.