Skip to main content

Flex Shrink

Set how flex items shrink to fit the container.

View as Markdown
baselinewidely
ClassCSS
fs:0flex-shrink: 0;
fs:1flex-shrink: 1;
fs:2flex-shrink: 2;
fs:3flex-shrink: 3;
fs:4flex-shrink: 4;
fs:5flex-shrink: 5;
fs:6flex-shrink: 6;
fs:7flex-shrink: 7;
fs:8flex-shrink: 8;

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

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