Skip to main content

Grid Auto Rows

Set the size of implicitly-created grid rows.

View as Markdown
baselinewidely
ClassCSS
gar:autogrid-auto-rows: auto;
gar:maxgrid-auto-rows: max-content;
gar:mingrid-auto-rows: min-content;

Variants

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

Breakpoints

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

@xs:gar:maxFrom 32rem up.
@sm:gar:maxFrom 40rem up.
@md:gar:maxFrom 48rem up.
@lg:gar:maxFrom 64rem up.
@xl:gar:maxFrom 80rem up.
@xxl:gar:maxFrom 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:gar:maxContainer from 32rem up.
@c:sm:gar:maxContainer from 40rem up.
@c:md:gar:maxContainer from 48rem up.
@c:lg:gar:maxContainer from 64rem up.
@c:xl:gar:maxContainer from 80rem up.
@c:xxl:gar:maxContainer 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:gar:maxOn a touch screen.
@prm:gar:maxWith reduced motion on.
@st:gar:maxOn the first frame.

States

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

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

Pseudo Elements

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

a::gar:maxOn ::after.
b::gar:maxOn ::before.
p::gar:maxOn ::placeholder.
s::gar:maxOn ::selection.