Skip to main content

Box Shadow

Set the box shadow for an element.

View as Markdown
baselinewidely
ClassCSS
bs-o:nonebox-shadow: none;
bs-o:xsbox-shadow: 0 1px 2px #0000000d;
bs-o:smbox-shadow: 0 1px 3px #0000001a, 0 1px 2px -1px #0000001a;
bs-o:mdbox-shadow: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
bs-o:lgbox-shadow: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
bs-o:xlbox-shadow: 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;
bs-o:xxlbox-shadow: 0 25px 50px -12px #00000040;
bs-o:3xlbox-shadow: 0 35px 60px -15px #0000004d;
ClassCSS
bs-i:nonebox-shadow: none;
bs-i:xsbox-shadow: inset 0 1px 2px #0000000d;
bs-i:smbox-shadow: inset 0 2px 4px #0000000f;
bs-i:mdbox-shadow: inset 0 2px 4px #0000001a;
bs-i:lgbox-shadow: inset 0 4px 6px #0000001a;
bs-i:xlbox-shadow: inset 0 6px 10px #0000001f;
bs-i:xxlbox-shadow: inset 0 8px 16px #00000026;
bs-i:3xlbox-shadow: inset 0 12px 24px #00000033;

Variants

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

Breakpoints

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

@xs:bs-o:lgFrom 32rem up.
@sm:bs-o:lgFrom 40rem up.
@md:bs-o:lgFrom 48rem up.
@lg:bs-o:lgFrom 64rem up.
@xl:bs-o:lgFrom 80rem up.
@xxl:bs-o:lgFrom 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:bs-o:lgContainer from 32rem up.
@c:sm:bs-o:lgContainer from 40rem up.
@c:md:bs-o:lgContainer from 48rem up.
@c:lg:bs-o:lgContainer from 64rem up.
@c:xl:bs-o:lgContainer from 80rem up.
@c:xxl:bs-o:lgContainer 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:bs-o:lgOn a touch screen.
@prm:bs-o:lgWith reduced motion on.
@st:bs-o:lgOn the first frame.

States

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

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

Pseudo Elements

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

a::bs-o:lgOn ::after.
b::bs-o:lgOn ::before.
p::bs-o:lgOn ::placeholder.
s::bs-o:lgOn ::selection.