Skip to content

Commit

Permalink
Making shadow declarations consistent between elevations 0 and 24.
Browse files Browse the repository at this point in the history
Also adds missing elevations.
  • Loading branch information
Sérgio Gomes committed Feb 16, 2016
1 parent cbb118a commit 88111f3
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 23 deletions.
132 changes: 109 additions & 23 deletions src/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -228,42 +228,128 @@
box-shadow: 0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);
}

@mixin shadow-0dp() {
box-shadow: none;
}
@mixin shadow-1dp() {
box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 1px 1px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 1px 3px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-2dp() {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0 3px 1px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0 1px 5px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 2px 2px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 1px 5px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-3dp() {
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0 3px 3px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0 1px 8px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
box-shadow: 0px 3px 3px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 3px 4px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 1px 8px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-4dp() {
box-shadow: 0 4px 5px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0 1px 10px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity),
0 2px 4px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity);
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 4px 5px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 1px 10px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-5dp() {
box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 5px 8px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 1px 14px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-6dp() {
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0 1px 18px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity),
0 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity);
box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 6px 10px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 1px 18px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-7dp() {
box-shadow: 0px 4px 5px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 7px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 2px 16px 1px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-8dp() {
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0 3px 14px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity),
0 5px 5px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity);
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 8px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 3px 14px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-9dp() {
box-shadow: 0px 5px 6px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 9px 12px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 3px 16px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-10dp() {
box-shadow: 0px 6px 6px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 10px 14px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 4px 18px 3px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-11dp() {
box-shadow: 0px 6px 7px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 11px 15px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 4px 20px 3px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-12dp() {
box-shadow: 0px 7px 8px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 12px 17px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 5px 22px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-13dp() {
box-shadow: 0px 7px 8px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 13px 19px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 5px 24px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-14dp() {
box-shadow: 0px 7px 9px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 14px 21px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 5px 26px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-15dp() {
box-shadow: 0px 8px 9px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 15px 22px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 6px 28px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}

@mixin shadow-16dp() {
box-shadow: 0 16px 24px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0 6px 30px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity),
0 8px 10px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity);
box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 16px 24px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 6px 30px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-17dp() {
box-shadow: 0px 8px 11px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 17px 26px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 6px 32px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-18dp() {
box-shadow: 0px 9px 11px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 18px 28px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 7px 34px 6px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-19dp() {
box-shadow: 0px 9px 12px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 19px 29px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 7px 36px 6px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-20dp() {
box-shadow: 0px 10px 13px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 20px 31px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 8px 38px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-21dp() {
box-shadow: 0px 10px 13px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 21px 33px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 8px 40px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-22dp() {
box-shadow: 0px 10px 14px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 22px 35px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 8px 42px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}
@mixin shadow-23dp() {
box-shadow: 0px 11px 14px -7px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 23px 36px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 9px 44px 8px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}

@mixin shadow-24dp() {
box-shadow: 0 9px 46px 8px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0 11px 15px -7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity),
0 24px 38px 3px rgba(0, 0, 0, $shadow-key-umbra-opacity);
box-shadow: 0px 11px 15px -7px rgba(0, 0, 0, $shadow-key-umbra-opacity),
0px 24px 38px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity),
0px 9px 46px 8px rgba(0, 0, 0, $shadow-ambient-shadow-opacity);
}

/* Animations */
Expand Down
72 changes: 72 additions & 0 deletions src/shadow/_shadow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
@import "../variables";
@import "../mixins";

.mdl-shadow--0dp {
@include shadow-0dp();
}

.mdl-shadow--1dp {
@include shadow-1dp();
}

.mdl-shadow--2dp {
@include shadow-2dp();
}
Expand All @@ -29,18 +37,82 @@
@include shadow-4dp();
}

.mdl-shadow--5dp {
@include shadow-5dp();
}

.mdl-shadow--6dp {
@include shadow-6dp();
}

.mdl-shadow--7dp {
@include shadow-7dp();
}

.mdl-shadow--8dp {
@include shadow-8dp();
}

.mdl-shadow--9dp {
@include shadow-9dp();
}

.mdl-shadow--10dp {
@include shadow-10dp();
}

.mdl-shadow--11dp {
@include shadow-11dp();
}

.mdl-shadow--12dp {
@include shadow-12dp();
}

.mdl-shadow--13dp {
@include shadow-13dp();
}

.mdl-shadow--14dp {
@include shadow-14dp();
}

.mdl-shadow--15dp {
@include shadow-15dp();
}

.mdl-shadow--16dp {
@include shadow-16dp();
}

.mdl-shadow--17dp {
@include shadow-17dp();
}

.mdl-shadow--18dp {
@include shadow-18dp();
}

.mdl-shadow--19dp {
@include shadow-19dp();
}

.mdl-shadow--20dp {
@include shadow-20dp();
}

.mdl-shadow--21dp {
@include shadow-21dp();
}

.mdl-shadow--22dp {
@include shadow-22dp();
}

.mdl-shadow--23dp {
@include shadow-23dp();
}

.mdl-shadow--24dp {
@include shadow-24dp();
}

0 comments on commit 88111f3

Please sign in to comment.