Skip to main content

Background Clip

Set the background image extent within an element.

View as Markdown
baselinewidely
ClassCSS
bc:bbbackground-clip: border-box;
bc:cbbackground-clip: content-box;
bc:pbbackground-clip: padding-box;
bc:tbackground-clip: text;

Variants

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

Breakpoints

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

@xs:bc:pbFrom 32rem up.
@sm:bc:pbFrom 40rem up.
@md:bc:pbFrom 48rem up.
@lg:bc:pbFrom 64rem up.
@xl:bc:pbFrom 80rem up.
@xxl:bc:pbFrom 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:bc:pbContainer from 32rem up.
@c:sm:bc:pbContainer from 40rem up.
@c:md:bc:pbContainer from 48rem up.
@c:lg:bc:pbContainer from 64rem up.
@c:xl:bc:pbContainer from 80rem up.
@c:xxl:bc:pbContainer 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:bc:pbOn a touch screen.
@prm:bc:pbWith reduced motion on.
@st:bc:pbOn the first frame.

States

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

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

Pseudo Elements

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

a::bc:pbOn ::after.
b::bc:pbOn ::before.
p::bc:pbOn ::placeholder.
s::bc:pbOn ::selection.