Skip to main content

Opacity

Set the opacity for an element.

View as Markdown
baselinewidely
ClassCSS
o:0opacity: 0;
o:10opacity: .1;
o:20opacity: .2;
o:30opacity: .3;
o:40opacity: .4;
o:50opacity: .5;
o:60opacity: .6;
o:70opacity: .7;
o:80opacity: .8;
o:90opacity: .9;
o:100opacity: 1;

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

a::o:50On ::after.
b::o:50On ::before.
p::o:50On ::placeholder.
s::o:50On ::selection.