Skip to main content

Field Sizing

Set how form fields size themselves based on content.

View as Markdown
baselinenewly
ClassCSS
fs:ffield-sizing: fixed;
fs:cfield-sizing: content;

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

a::fs:cOn ::after.
b::fs:cOn ::before.
p::fs:cOn ::placeholder.
s::fs:cOn ::selection.