Simple material shadow scss function

Simple material shadow
30.11.2017

In material design one of the most important thing is shadow that determines how far raised or close is element on page. Almost every panel, button, form have a shadow.
In this tutorial you can see"material-shadow" function in sass which you can use easly use on your website. There is 5 level of shadow, from the lowest ($level 1) to the highest ($level 5).

@mixin material-shadow($level: 1) {
  @if $level == 1 {
    box-shadow: 0 1px 3px rgba(0,0,0, 0.14), 0 1px 2px rgba(0,0,0,0.24);
  }
  @if $level == 2 {
    box-shadow: 0 3px 6px rgba(0,0,0, 0.16), 0 3px 6px rgba(0,0,0, 0.23);
  }  
  @if $level == 3 {
    box-shadow: 0 10px 20px rgba(0,0,0, 0.19), 0 6px 6px rgba(0,0,0, 0.23);
  }    
  @if $level == 4 {
    box-shadow: 0 15px 30px rgba(0,0,0, 0.25), 0 10px 10px rgba(0,0,0, 0.22);    
  }
  @if $level == 5{
    box-shadow: 0 20px 40px rgba(0,0,0, 0.30), 0 15px 12px rgba(0,0,0, 0.22);   
  }
}