You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: packages/mdc-elevation/README.md
+16-111
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,7 @@ path: /catalog/elevation/
16
16
</a>
17
17
</div>-->
18
18
19
-
MDC Elevation provides Sass mixins and CSS classes which are used to provide [shadows and
20
-
elevation](https://material.io/guidelines/what-is-material/elevation-shadows.html) to our material
21
-
components.
22
-
23
-
The elevation values are mapped out in a "z-space" and range from `0` to `24`.
24
-
Our implementation is based on [Scott Hyndman's work](http://codepen.io/shyndman/full/ojxmdY/),
25
-
which was created in collaboration with the designers on the Material Design team.
19
+
Shadows provide important visual cues about objects’ depth and directional movement. They are the only visual cue indicating the amount of separation between surfaces. An object’s elevation determines the appearance of its shadow. The elevation values are mapped out in a "z-space" and range from `0` to `24`.
26
20
27
21
> **A note about "z-space"**: Within the spec, elevation is normally referred to as having a `dp`
28
22
> value. In other words, how many "pixels" above the base material is a piece of material elevated.
MDC Elevation exports an `mdc-elevation` mixin which can be used to set the elevation on a selector.
56
-
It works by assigning the correct elevation value to a selector's `box-shadow` property.
47
+
### Sass Mixins, Variables, and Functions
57
48
58
-
`mdc-elevation` takes one `$z-value` argument which represents the z-space for that given elevation. For example, [cards](https://material.io/guidelines/components/cards.html) have a resting elevation of `2dp`. Implementing that using MDC Elevation looks like the following:
If you need more configurability over your transitions, you can easily accomplish this by using
143
-
the `mdc-elevation-transition-rule` function in conjunctions with the exported sass variables that
144
-
mdc-elevation exposes for purposes of transitioning.
59
+
If you need more configurability over your transitions, use the `mdc-elevation-transition-rule` function in conjunction with the exported sass variables.
145
60
146
61
```scss
147
62
.my-component-with-custom-transitions {
148
-
@includemdc-elevation(2);
149
63
150
64
transition:
151
65
mdc-elevation-transition-rule(),
152
66
/* Configure opacity to use same duration and easing values as elevation */
0 commit comments