Skip to main content

Transition Property

Set which properties have a transition effect.

View as Markdown
baselinewidely
ClassCSS
tp:atransition-property: all;
tp:bstransition-property: box-shadow;
tp:ctransition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
tp:dtransition-property: height, width;
tp:htransition-property: height;
tp:nonetransition-property: none;
tp:otransition-property: opacity;
tp:ttransition-property: transform, translate, scale, rotate;
tp:wtransition-property: width;

Variants

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

Breakpoints

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

@xs:tp:hFrom 32rem up.
@sm:tp:hFrom 40rem up.
@md:tp:hFrom 48rem up.
@lg:tp:hFrom 64rem up.
@xl:tp:hFrom 80rem up.
@xxl:tp:hFrom 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:tp:hContainer from 32rem up.
@c:sm:tp:hContainer from 40rem up.
@c:md:tp:hContainer from 48rem up.
@c:lg:tp:hContainer from 64rem up.
@c:xl:tp:hContainer from 80rem up.
@c:xxl:tp:hContainer 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:tp:hOn a touch screen.
@prm:tp:hWith reduced motion on.
@st:tp:hOn the first frame.

States

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

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

Pseudo Elements

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

a::tp:hOn ::after.
b::tp:hOn ::before.
p::tp:hOn ::placeholder.
s::tp:hOn ::selection.