Skip to content

Commit

Permalink
feat(elevation): add initial implementation of the elevation
Browse files Browse the repository at this point in the history
  • Loading branch information
rustemgareev committed Oct 2, 2017
1 parent 1115578 commit f3091c1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions components/elevation/_mixins.scss
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;
}
5 changes: 5 additions & 0 deletions components/elevation/_variables.scss
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;
8 changes: 8 additions & 0 deletions components/elevation/elevation.scss
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);
}
}
1 change: 1 addition & 0 deletions material-kit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
@import "./components/checkbox/checkbox";
@import "./components/dialog/dialog";
@import "./components/drawer/drawer";
@import "./components/elevation/elevation";

0 comments on commit f3091c1

Please sign in to comment.