#Box Shadow
Utility classes to apply a box shadow around any element.
Class | Styles |
---|---|
u-shadow-none |
|
u-shadow-xs |
|
u-shadow-sm |
|
u-shadow-md |
|
u-shadow-lg |
|
u-shadow-xl |
|
u-shadow-inset |
|
Utility classes to apply a box shadow around any element.
Class | Styles |
---|---|
u-shadow-none |
|
u-shadow-xs |
|
u-shadow-sm |
|
u-shadow-md |
|
u-shadow-lg |
|
u-shadow-xl |
|
u-shadow-inset |
|
Easily add a box shadow to any element using the box shadow utility classes to add extra depth. The utility classes for outer shadows generally follow this form: u-shadow-[xs|sm|md|lg|xl]
.
<div class="bg-gray-000 u-round-xs row u-gap-2 p-4 u-justify-center">
<div class="bg-gray-200 u-round-xs p-4 u-shadow-none u-text-center"><span class="font-bold">none</span></div>
<div class="bg-gray-200 u-round-xs p-4 u-shadow-xs u-text-center"><span class="font-bold">xs</span></div>
<div class="bg-gray-200 u-round-xs p-4 u-shadow-sm u-text-center"><span class="font-bold">sm</span></div>
<div class="bg-gray-200 u-round-xs p-4 u-shadow-md u-text-center"><span class="font-bold">md</span></div>
<div class="bg-gray-200 u-round-xs p-4 u-shadow-lg u-text-center"><span class="font-bold">lg</span></div>
<div class="bg-gray-200 u-round-xs p-4 u-shadow-xl u-text-center"><span class="font-bold">xl</span></div>
</div>
To add an inner shadow, you can use the u-shadow-inset
class.
<div class="bg-gray-000 u-round-xs row u-gap-2 p-4 u-justify-center">
<div class="bg-gray-200 u-round-xs p-4 u-shadow-inset u-text-center"><span class="font-bold">inset</span></div>
</div>
To remove all shadows, use the u-shadow-none
class.
<div class="bg-gray-000 u-round-xs row u-gap-2 p-4 u-justify-center">
<div class="bg-gray-200 u-round-xs p-4 u-shadow-none u-text-center"><span class="font-bold">none</span></div>
</div>
The classes specified above are the default utility classes for setting box shadows. You can add, change, or remove classes within the _config.scss
file of Cirrus.
// _config.scss
$config: (
extend: (
shadows: (
'2xl': (
--cirrus-shadow: (0 25px 30px -10px rgba(0, 0, 0, 0.1),
0 15px 15px -10px rgba(0, 0, 0, 0.04))
)
)
)
) !default;
This would generate the following additonal classes.
.u-shadow-2xl {
--cirrus-shadow: (0 25px 30px -10px rgba(0, 0, 0, 0.1),
0 15px 15px -10px rgba(0, 0, 0, 0.04))
box-shadow: var(--cirrus-shadow);
}
Learn more about how to extend Cirrus to support your use cases in the Configuration documentation.