EffectsBox Shadow

Box Shadow

Controls the box shadow of an element.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari
ClassStyle
bs-nonebox-shadow: none;
bs-xsbox-shadow: 1px 3px 5px -3px #0000001a;
bs-smbox-shadow: 1px 3px 5px -2px #0000001a;
bs-mdbox-shadow: 1px 3px 5px -1px #0000001a;
bs-lgbox-shadow: 1px 3px 5px 1px #0000001a;
bs-xlbox-shadow: 1px 3px 5px 2px #0000001a;

This example showcases various box-shadow utilities:

  • The bs-xs box shadow utility applies an extra small shadow to an element.
  • The bs-sm box shadow utility applies a small shadow to an element.
  • The bs-md box shadow utility applies a medium shadow to an element.
  • Finally, bs-lg box shadow utility applies a large to an element.
xs
sm
md
lg
<div class="d-g g-16 gtc-1 sm:gtc-4">
<div class="ai-c bg-white bs-xs d-f d-18 jc-c tc-slate">xs</div>
<div class="ai-c bg-white bs-sm d-f d-18 jc-c tc-slate">sm</div>
<div class="ai-c bg-white bs-md d-f d-18 jc-c tc-slate">md</div>
<div class="ai-c bg-white bs-lg d-f d-18 jc-c tc-slate">lg</div>
</div>

Using utility variants

Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.

Targeting different viewports

You can combine responsive breakpoints like sm:bs-*, md:bs-*, lg:bs-*, and xxl:bs-* to allow targeting specific utilities in different viewports.

Targeting hover states

Alternatively, you can apply :hover by using h:bs-* utility to override elements and change their values when hovering over them.