Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add box-shadow utilities #25758

Merged
merged 5 commits into from
Apr 1, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _data/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
- title: Image replacement
- title: Position
- title: Screenreaders
- title: Shadows
- title: Sizing
- title: Spacing
- title: Text
Expand Down
17 changes: 17 additions & 0 deletions docs/4.0/utilities/shadows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
layout: docs
title: Shadows
description: Add shadows to elements with `box-shadow` utilities.
group: utilities
toc: true
---

## Examples

Three sizes of shadows are available via utility classes.

{% example html %}
<div class="shadow-sm p-3 mb-5 bg-white rounded">Small shadow</div>
<div class="shadow p-3 mb-5 bg-white rounded">Regular shadow</div>
<div class="shadow-lg p-3 mb-5 bg-white rounded">Larger shadow</div>
{% endexample %}
1 change: 1 addition & 0 deletions scss/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@import "utilities/float";
@import "utilities/position";
@import "utilities/screenreaders";
@import "utilities/shadows";
@import "utilities/sizing";
@import "utilities/spacing";
@import "utilities/text";
Expand Down
4 changes: 4 additions & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ $border-radius: .25rem !default;
$border-radius-lg: .3rem !default;
$border-radius-sm: .2rem !default;

$box-shadow-sm: 0 .125rem .25rem rgba($black, .075) !default;
$box-shadow: 0 .5rem 1rem rgba($black, .15) !default;
$box-shadow-lg: 0 1rem 3rem rgba($black, .175) !default;

$component-active-color: $white !default;
$component-active-bg: theme-color("primary") !default;

Expand Down
5 changes: 5 additions & 0 deletions scss/utilities/_shadows.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@if $enable-shadows {
.shadow-sm { box-shadow: $box-shadow-sm; }
.shadow { box-shadow: $box-shadow; }
.shadow-lg { box-shadow: $box-shadow-lg; }
}