Add shadow-xs, increase alpha of shadow-sm to 0.05 #1333
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
shadow-xs
utility that adds a very subtle 1px solid shadow with no vertical offset. It can be very useful when applying another shadow to an element that has the same background color as the canvas beneath it and you feel like you need a border to add extra separation, but a border is sort of the wrong solution because it's a solid color and really you just want to increase the distinction between two elements by sharpening the shadow.Here's an example of where it's useful...
No border/distinction shadow:
Border, notice how weird it looks at the edge that crosses into the dark background:

Using

shadow-xs
to add a tiny bit of distinction without introduce a true solid border:Since shadows aren't easily composable in CSS, the code I've used for that example involves two nested
divs
, each with their own shadow so they stack:The reason I don't think it makes sense to just add this little 1px distinction border directly to
shadow-lg
and other large shadows is that it's not necessary when the card has a different color from the background already.