-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(elevation): add initial implementation of the elevation
- Loading branch information
1 parent
1115578
commit f3091c1
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@import "@material/elevation/mixins"; | ||
@import "./variables"; | ||
|
||
@mixin mk-elevation($z-value) { | ||
@if type-of($z-value) != number or not unitless($z-value) { | ||
@error "$z-value must be a unitless number"; | ||
} | ||
|
||
@if $z-value < 0 or $z-value > 24 { | ||
@error "$z-value must be between 0 and 24"; | ||
} | ||
|
||
#{$mdc-elevation-property}: #{"#{map-get($mdc-elevation-umbra-map, $z-value)} #{$mk-elevation-umbra-color}"}, #{"#{map-get($mdc-elevation-penumbra-map, $z-value)} #{$mk-elevation-penumbra-color}"}, #{map-get($mdc-elevation-ambient-map, $z-value)} $mk-elevation-ambient-color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import "../theme/variables"; | ||
|
||
$mk-elevation-umbra-color: rgba($mk-theme-black, .2) !default; | ||
$mk-elevation-penumbra-color: rgba($mk-theme-black, .14) !default; | ||
$mk-elevation-ambient-color: rgba($mk-theme-black, .12) !default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@import "@material/elevation/mdc-elevation"; | ||
@import "./mixins"; | ||
|
||
@for $z-value from 0 through 24 { | ||
.mdc-elevation--z#{$z-value} { | ||
@include mk-elevation($z-value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters