Skip to content

Commit

Permalink
feat(elevation): preserve the alpha value of the provided color
Browse files Browse the repository at this point in the history
Ensure that if the elevation shadow color is overridden with a color that has an alpha value, that
value is propagated to the opacity of the shadow itself. This is useful for users who want to
"tone down" the default shadows without changing their color tone.
  • Loading branch information
benelliott committed Apr 16, 2018
1 parent 6a82c65 commit 10bae38
Showing 1 changed file with 75 additions and 75 deletions.
150 changes: 75 additions & 75 deletions src/lib/core/style/_elevation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,91 +33,91 @@

@function _get-umbra-map($color) {
@return (
0: '0px 0px 0px 0px #{rgba($color, 0.2)}',
1: '0px 2px 1px -1px #{rgba($color, 0.2)}',
2: '0px 3px 1px -2px #{rgba($color, 0.2)}',
3: '0px 3px 3px -2px #{rgba($color, 0.2)}',
4: '0px 2px 4px -1px #{rgba($color, 0.2)}',
5: '0px 3px 5px -1px #{rgba($color, 0.2)}',
6: '0px 3px 5px -1px #{rgba($color, 0.2)}',
7: '0px 4px 5px -2px #{rgba($color, 0.2)}',
8: '0px 5px 5px -3px #{rgba($color, 0.2)}',
9: '0px 5px 6px -3px #{rgba($color, 0.2)}',
10: '0px 6px 6px -3px #{rgba($color, 0.2)}',
11: '0px 6px 7px -4px #{rgba($color, 0.2)}',
12: '0px 7px 8px -4px #{rgba($color, 0.2)}',
13: '0px 7px 8px -4px #{rgba($color, 0.2)}',
14: '0px 7px 9px -4px #{rgba($color, 0.2)}',
15: '0px 8px 9px -5px #{rgba($color, 0.2)}',
16: '0px 8px 10px -5px #{rgba($color, 0.2)}',
17: '0px 8px 11px -5px #{rgba($color, 0.2)}',
18: '0px 9px 11px -5px #{rgba($color, 0.2)}',
19: '0px 9px 12px -6px #{rgba($color, 0.2)}',
20: '0px 10px 13px -6px #{rgba($color, 0.2)}',
21: '0px 10px 13px -6px #{rgba($color, 0.2)}',
22: '0px 10px 14px -6px #{rgba($color, 0.2)}',
23: '0px 11px 14px -7px #{rgba($color, 0.2)}',
24: '0px 11px 15px -7px #{rgba($color, 0.2)}'
0: '0px 0px 0px 0px #{rgba($color, opacity($color) * 0.2)}',
1: '0px 2px 1px -1px #{rgba($color, opacity($color) * 0.2)}',
2: '0px 3px 1px -2px #{rgba($color, opacity($color) * 0.2)}',
3: '0px 3px 3px -2px #{rgba($color, opacity($color) * 0.2)}',
4: '0px 2px 4px -1px #{rgba($color, opacity($color) * 0.2)}',
5: '0px 3px 5px -1px #{rgba($color, opacity($color) * 0.2)}',
6: '0px 3px 5px -1px #{rgba($color, opacity($color) * 0.2)}',
7: '0px 4px 5px -2px #{rgba($color, opacity($color) * 0.2)}',
8: '0px 5px 5px -3px #{rgba($color, opacity($color) * 0.2)}',
9: '0px 5px 6px -3px #{rgba($color, opacity($color) * 0.2)}',
10: '0px 6px 6px -3px #{rgba($color, opacity($color) * 0.2)}',
11: '0px 6px 7px -4px #{rgba($color, opacity($color) * 0.2)}',
12: '0px 7px 8px -4px #{rgba($color, opacity($color) * 0.2)}',
13: '0px 7px 8px -4px #{rgba($color, opacity($color) * 0.2)}',
14: '0px 7px 9px -4px #{rgba($color, opacity($color) * 0.2)}',
15: '0px 8px 9px -5px #{rgba($color, opacity($color) * 0.2)}',
16: '0px 8px 10px -5px #{rgba($color, opacity($color) * 0.2)}',
17: '0px 8px 11px -5px #{rgba($color, opacity($color) * 0.2)}',
18: '0px 9px 11px -5px #{rgba($color, opacity($color) * 0.2)}',
19: '0px 9px 12px -6px #{rgba($color, opacity($color) * 0.2)}',
20: '0px 10px 13px -6px #{rgba($color, opacity($color) * 0.2)}',
21: '0px 10px 13px -6px #{rgba($color, opacity($color) * 0.2)}',
22: '0px 10px 14px -6px #{rgba($color, opacity($color) * 0.2)}',
23: '0px 11px 14px -7px #{rgba($color, opacity($color) * 0.2)}',
24: '0px 11px 15px -7px #{rgba($color, opacity($color) * 0.2)}'
);
}

@function _get-penumbra-map($color) {
@return (
0: '0px 0px 0px 0px #{rgba($color, 0.14)}',
1: '0px 1px 1px 0px #{rgba($color, 0.14)}',
2: '0px 2px 2px 0px #{rgba($color, 0.14)}',
3: '0px 3px 4px 0px #{rgba($color, 0.14)}',
4: '0px 4px 5px 0px #{rgba($color, 0.14)}',
5: '0px 5px 8px 0px #{rgba($color, 0.14)}',
6: '0px 6px 10px 0px #{rgba($color, 0.14)}',
7: '0px 7px 10px 1px #{rgba($color, 0.14)}',
8: '0px 8px 10px 1px #{rgba($color, 0.14)}',
9: '0px 9px 12px 1px #{rgba($color, 0.14)}',
10: '0px 10px 14px 1px #{rgba($color, 0.14)}',
11: '0px 11px 15px 1px #{rgba($color, 0.14)}',
12: '0px 12px 17px 2px #{rgba($color, 0.14)}',
13: '0px 13px 19px 2px #{rgba($color, 0.14)}',
14: '0px 14px 21px 2px #{rgba($color, 0.14)}',
15: '0px 15px 22px 2px #{rgba($color, 0.14)}',
16: '0px 16px 24px 2px #{rgba($color, 0.14)}',
17: '0px 17px 26px 2px #{rgba($color, 0.14)}',
18: '0px 18px 28px 2px #{rgba($color, 0.14)}',
19: '0px 19px 29px 2px #{rgba($color, 0.14)}',
20: '0px 20px 31px 3px #{rgba($color, 0.14)}',
21: '0px 21px 33px 3px #{rgba($color, 0.14)}',
22: '0px 22px 35px 3px #{rgba($color, 0.14)}',
23: '0px 23px 36px 3px #{rgba($color, 0.14)}',
24: '0px 24px 38px 3px #{rgba($color, 0.14)}'
0: '0px 0px 0px 0px #{rgba($color, opacity($color) * 0.14)}',
1: '0px 1px 1px 0px #{rgba($color, opacity($color) * 0.14)}',
2: '0px 2px 2px 0px #{rgba($color, opacity($color) * 0.14)}',
3: '0px 3px 4px 0px #{rgba($color, opacity($color) * 0.14)}',
4: '0px 4px 5px 0px #{rgba($color, opacity($color) * 0.14)}',
5: '0px 5px 8px 0px #{rgba($color, opacity($color) * 0.14)}',
6: '0px 6px 10px 0px #{rgba($color, opacity($color) * 0.14)}',
7: '0px 7px 10px 1px #{rgba($color, opacity($color) * 0.14)}',
8: '0px 8px 10px 1px #{rgba($color, opacity($color) * 0.14)}',
9: '0px 9px 12px 1px #{rgba($color, opacity($color) * 0.14)}',
10: '0px 10px 14px 1px #{rgba($color, opacity($color) * 0.14)}',
11: '0px 11px 15px 1px #{rgba($color, opacity($color) * 0.14)}',
12: '0px 12px 17px 2px #{rgba($color, opacity($color) * 0.14)}',
13: '0px 13px 19px 2px #{rgba($color, opacity($color) * 0.14)}',
14: '0px 14px 21px 2px #{rgba($color, opacity($color) * 0.14)}',
15: '0px 15px 22px 2px #{rgba($color, opacity($color) * 0.14)}',
16: '0px 16px 24px 2px #{rgba($color, opacity($color) * 0.14)}',
17: '0px 17px 26px 2px #{rgba($color, opacity($color) * 0.14)}',
18: '0px 18px 28px 2px #{rgba($color, opacity($color) * 0.14)}',
19: '0px 19px 29px 2px #{rgba($color, opacity($color) * 0.14)}',
20: '0px 20px 31px 3px #{rgba($color, opacity($color) * 0.14)}',
21: '0px 21px 33px 3px #{rgba($color, opacity($color) * 0.14)}',
22: '0px 22px 35px 3px #{rgba($color, opacity($color) * 0.14)}',
23: '0px 23px 36px 3px #{rgba($color, opacity($color) * 0.14)}',
24: '0px 24px 38px 3px #{rgba($color, opacity($color) * 0.14)}'
);
}

@function _get-ambient-map($color) {
@return (
0: '0px 0px 0px 0px #{rgba($color, 0.12)}',
1: '0px 1px 3px 0px #{rgba($color, 0.12)}',
2: '0px 1px 5px 0px #{rgba($color, 0.12)}',
3: '0px 1px 8px 0px #{rgba($color, 0.12)}',
4: '0px 1px 10px 0px #{rgba($color, 0.12)}',
5: '0px 1px 14px 0px #{rgba($color, 0.12)}',
6: '0px 1px 18px 0px #{rgba($color, 0.12)}',
7: '0px 2px 16px 1px #{rgba($color, 0.12)}',
8: '0px 3px 14px 2px #{rgba($color, 0.12)}',
9: '0px 3px 16px 2px #{rgba($color, 0.12)}',
10: '0px 4px 18px 3px #{rgba($color, 0.12)}',
11: '0px 4px 20px 3px #{rgba($color, 0.12)}',
12: '0px 5px 22px 4px #{rgba($color, 0.12)}',
13: '0px 5px 24px 4px #{rgba($color, 0.12)}',
14: '0px 5px 26px 4px #{rgba($color, 0.12)}',
15: '0px 6px 28px 5px #{rgba($color, 0.12)}',
16: '0px 6px 30px 5px #{rgba($color, 0.12)}',
17: '0px 6px 32px 5px #{rgba($color, 0.12)}',
18: '0px 7px 34px 6px #{rgba($color, 0.12)}',
19: '0px 7px 36px 6px #{rgba($color, 0.12)}',
20: '0px 8px 38px 7px #{rgba($color, 0.12)}',
21: '0px 8px 40px 7px #{rgba($color, 0.12)}',
22: '0px 8px 42px 7px #{rgba($color, 0.12)}',
23: '0px 9px 44px 8px #{rgba($color, 0.12)}',
24: '0px 9px 46px 8px #{rgba($color, 0.12)}'
0: '0px 0px 0px 0px #{rgba($color, opacity($color) * 0.12)}',
1: '0px 1px 3px 0px #{rgba($color, opacity($color) * 0.12)}',
2: '0px 1px 5px 0px #{rgba($color, opacity($color) * 0.12)}',
3: '0px 1px 8px 0px #{rgba($color, opacity($color) * 0.12)}',
4: '0px 1px 10px 0px #{rgba($color, opacity($color) * 0.12)}',
5: '0px 1px 14px 0px #{rgba($color, opacity($color) * 0.12)}',
6: '0px 1px 18px 0px #{rgba($color, opacity($color) * 0.12)}',
7: '0px 2px 16px 1px #{rgba($color, opacity($color) * 0.12)}',
8: '0px 3px 14px 2px #{rgba($color, opacity($color) * 0.12)}',
9: '0px 3px 16px 2px #{rgba($color, opacity($color) * 0.12)}',
10: '0px 4px 18px 3px #{rgba($color, opacity($color) * 0.12)}',
11: '0px 4px 20px 3px #{rgba($color, opacity($color) * 0.12)}',
12: '0px 5px 22px 4px #{rgba($color, opacity($color) * 0.12)}',
13: '0px 5px 24px 4px #{rgba($color, opacity($color) * 0.12)}',
14: '0px 5px 26px 4px #{rgba($color, opacity($color) * 0.12)}',
15: '0px 6px 28px 5px #{rgba($color, opacity($color) * 0.12)}',
16: '0px 6px 30px 5px #{rgba($color, opacity($color) * 0.12)}',
17: '0px 6px 32px 5px #{rgba($color, opacity($color) * 0.12)}',
18: '0px 7px 34px 6px #{rgba($color, opacity($color) * 0.12)}',
19: '0px 7px 36px 6px #{rgba($color, opacity($color) * 0.12)}',
20: '0px 8px 38px 7px #{rgba($color, opacity($color) * 0.12)}',
21: '0px 8px 40px 7px #{rgba($color, opacity($color) * 0.12)}',
22: '0px 8px 42px 7px #{rgba($color, opacity($color) * 0.12)}',
23: '0px 9px 44px 8px #{rgba($color, opacity($color) * 0.12)}',
24: '0px 9px 46px 8px #{rgba($color, opacity($color) * 0.12)}'
);
}

Expand Down

0 comments on commit 10bae38

Please sign in to comment.