Spirit provides a systematic language for conveying depth using shadows. To invite interaction or increase prominence, animate a component along the Z axis to simulate depth.
Spirit provides six levels of elevation, from $spirit-elevation-0
(flat) to $spirit-elevation-5
. These can be accessed via the spirit-elevation
scss mixin.
@include spirit-elevation(0); |
@include spirit-elevation(1); |
@include spirit-elevation(2); |
@include spirit-elevation(3); |
@include spirit-elevation(4); |
@include spirit-elevation(5); |
elevation
1, 2, and 3.transform: translateY(-1px);
on hover.$spirit-transition-timing-default;
Use the following elevation recommendations:
Scenario | At Rest | Hover | Activate |
---|---|---|---|
A Small Interactive e.g. Button |
Flat or spirit-elevation(1) |
spirit-elevation(3) |
spirit-elevation(2) |
A Container e.g. Card |
Flat or spirit-elevation(1) |
spirit-elevation(4) |
spirit-elevation(3) |
Use shadow color to accent or compliment the color of the component. Shadow dimensions are determined by elevation, described above.
@include spirit-elevation(1); |
@include spirit-elevation(2); |
@include spirit-elevation(3); |
@include spirit-elevation(4); |
@include spirit-elevation(5); |
Pass 'blue'
as the second argument to the spirit-elevation
scss mixin.
@include spirit-elevation(3, 'blue');
@include spirit-elevation(1, 'blue'); |
@include spirit-elevation(2, 'blue'); |
@include spirit-elevation(3, 'blue'); |
@include spirit-elevation(4, 'blue'); |
@include spirit-elevation(5, 'blue'); |