Update the materialize mixins to accept a base colour (allows preventing transparency for things like nav-bars; closes #160)
This commit is contained in:
parent
11d2a2a10f
commit
194068c22c
2 changed files with 24 additions and 5 deletions
|
|
@ -1,12 +1,31 @@
|
|||
@mixin elevate($height) {
|
||||
background-color: var(--elevation-#{$height}dp-bg);
|
||||
@use "sass:map";
|
||||
|
||||
$elevations: (
|
||||
0: 0%,
|
||||
1: 5%,
|
||||
2: 7%,
|
||||
3: 8%,
|
||||
4: 9%,
|
||||
6: 11%,
|
||||
8: 12%,
|
||||
12: 14%,
|
||||
16: 15%,
|
||||
24: 16%,
|
||||
);
|
||||
|
||||
@mixin elevate($height, $base: transparent) {
|
||||
background-color: color-mix(
|
||||
in lab,
|
||||
#{$base},
|
||||
white map.get($elevations, $height)
|
||||
);
|
||||
-webkit-box-shadow: 0px 0px #{$height * 1.75}px 0px rgba(0,0,0,0.75);
|
||||
-moz-box-shadow: 0px 0px #{$height * 1.75}px 0px rgba(0,0,0,0.75);
|
||||
box-shadow: 0px 0px #{$height * 1.75}px 0px rgba(0,0,0,0.75);
|
||||
}
|
||||
|
||||
@mixin undo {
|
||||
background-color: transparent;
|
||||
@mixin undo($base: transparent) {
|
||||
background-color: #{$base};
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue