Skip to main content

Grid Template Columns

Set the columns for a grid layout.

View as Markdown
baselinewidely

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

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