Skip to main content

Backdrop Grayscale

Apply a grayscale filter to the area behind an element.

View as Markdown
baselinenewly
ClassCSS
bf-g:0backdrop-filter: grayscale(0%);
bf-g:10backdrop-filter: grayscale(10%);
bf-g:20backdrop-filter: grayscale(20%);
bf-g:30backdrop-filter: grayscale(30%);
bf-g:40backdrop-filter: grayscale(40%);
bf-g:50backdrop-filter: grayscale(50%);
bf-g:60backdrop-filter: grayscale(60%);
bf-g:70backdrop-filter: grayscale(70%);
bf-g:80backdrop-filter: grayscale(80%);
bf-g:90backdrop-filter: grayscale(90%);
bf-g:100backdrop-filter: grayscale();

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

a::bf-g:50On ::after.
b::bf-g:50On ::before.
p::bf-g:50On ::placeholder.
s::bf-g:50On ::selection.