Skip to main content

Grid Auto Columns

Set the size of implicitly-created grid columns.

View as Markdown
baselinewidely
ClassCSS
gac:autogrid-auto-columns: auto;
gac:maxgrid-auto-columns: max-content;
gac:mingrid-auto-columns: min-content;

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

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