Clone on GitHub
chevron_forward

Shadows

First Published On:
April 25, 2024
Last Updated:
July 25, 2024

Figure 1. Animation demonstrating state layer implementation.

No items found.

Overview

Shadows are used to show elevation, and their numbers should correspond roughly to their z-index. But this is just a guideline. General rules tell us shadows get larger and softer the higher up an element is raised. That means .shadow-xs basically looks like an outline, while .shadow-xl looks like a very dramatic drop shadow.

You can't use color variables with box shadows because you have to use rgba in order to control their opacity, and color variables are defined as hex codes.

Recommended Usage

Customization

Resources that mention this topic

No items found.
info

Get Help from a LiftKit Expert

arrow_forward
Book Quick Chat

Give Us Feedback

Click or tap to reveal form.
expand_more
check_circle
Success! An email has been sent to you with more details.
Please allow up to 5 minutes for it to arrive. Mailchimp can take a bit.
error
Error: Something went wrong. Email info@chainlift.io directly for assistance.
.shadow-sm {
  align-items: flex-start;
  box-shadow: 0 0 1px 0 var(--light__shadow_lkv);
  flex: 0 auto;
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
}

.shadow-md {
  align-items: flex-start;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.11),
    0 0 1px #727272;
  flex: 0 auto;
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
}

.shadow-lg {
  align-items: flex-start;
  box-shadow: 0 11px 15px -3px rgba(0, 0, 0, 0.11),
    0 2px 6px rgba(0, 0, 0, 0.07), 0 0 1px #727272;
  flex: 0 auto;
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  justify-content: flex-start;
  position: relative;
  z-index: 3;
}

.shadow-xl {
  align-items: flex-start;
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.09), 0 5px 11px rgba(0, 0, 0, 0.12),
    0 0 1px #727272;
  flex: 0 auto;
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  justify-content: flex-start;
  position: relative;
  z-index: 4;
}

.shadow-2xl {
  align-items: flex-start;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.23), 0 9px 18px rgba(0, 0, 0, 0.1),
    0 0 1px #727272;
  flex: 0 auto;
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  justify-content: flex-start;
  position: relative;
  z-index: 5;
}
content_copy
code snippets will appear here