<div class="acl-demo__elevation-catalog">
    <div class="acl-demo__elevation-catalog-item acl-elevation--z0">0dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z1">1dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z2">2dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z3">3dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z4">4dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z5">5dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z6">6dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z7">7dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z8">8dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z9">9dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z10">10dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z11">11dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z12">12dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z13">13dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z14">14dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z15">15dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z16">16dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z17">17dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z18">18dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z19">19dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z20">20dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z21">21dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z22">22dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z23">23dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z24">24dp</div>
</div>
<div class="acl-demo__elevation-catalog">
    <div class="acl-demo__elevation-catalog-item acl-elevation--z0">0dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z1">1dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z2">2dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z3">3dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z4">4dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z5">5dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z6">6dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z7">7dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z8">8dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z9">9dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z10">10dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z11">11dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z12">12dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z13">13dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z14">14dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z15">15dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z16">16dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z17">17dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z18">18dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z19">19dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z20">20dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z21">21dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z22">22dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z23">23dp</div>
    <div class="acl-demo__elevation-catalog-item acl-elevation--z24">24dp</div>
</div>
/* No context defined. */
  • Content:
    # Change Log
    
    All notable changes to this project will be documented in this file.
    See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
    
    # [4.0.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0) (2019-11-02)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.062ade5c0.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.062ade5c0.0) (2019-10-17)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.735147131.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.735147131.0) (2019-10-16)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.5dc45b82a.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.5dc45b82a.0) (2019-10-16)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.22d7ad2fb.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.22d7ad2fb.0) (2019-10-15)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.199534d61.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.199534d61.0) (2019-09-27)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.905884690.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.905884690.0) (2019-09-16)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.e851d4f40.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.e851d4f40.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.e09c3b770.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.e09c3b770.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.b58076d4b.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.b58076d4b.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.22916a234.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.22916a234.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.c7e991001.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.c7e991001.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [5.0.0-canary.b8513889d.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v5.0.0-canary.b8513889d.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.0c808fb33.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.0c808fb33.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.e3497b3e6.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.e3497b3e6.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.79d881baf.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.79d881baf.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.79d881baf.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.79d881baf.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.79d881baf.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.79d881baf.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.eab7903af.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.eab7903af.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.eab7903af.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.eab7903af.0) (2019-09-13)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-edc72a4d7.0](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-edc72a4d7.0) (2019-09-09)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.1](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-canary.1) (2019-09-09)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.1](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-canary.1) (2019-09-09)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.0](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-canary.0) (2019-09-05)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.0](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-canary.0) (2019-09-05)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-canary.0](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-canary.0) (2019-09-05)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-a9e694931.0](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-a9e694931.0) (2019-09-05)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-snapshot.0](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-snapshot.0) (2019-09-05)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [4.0.0-alpha.0](https://github.com/material-components/material-components-web/compare/v3.1.0...v4.0.0-alpha.0) (2019-08-07)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [3.1.0](https://github.com/material-components/material-components-web/compare/v3.0.0...v3.1.0) (2019-07-22)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [3.1.0-alpha.0](https://github.com/material-components/material-components-web/compare/v3.0.0...v3.1.0-alpha.0) (2019-07-16)
    
    **Note:** Version bump only for package ..//elevation
    
    
    
    
    
    # [3.1.0](https://github.com/material-components/material-components-web/compare/v3.0.0...v3.1.0) (2019-07-16)
    
    **Note:** Version bump only for package ..//elevation
    
  • URL: /components/raw/elevation/CHANGELOG.md
  • Filesystem Path: src/components/elevation/CHANGELOG.md
  • Size: 6.5 KB
  • Content:
    //
    // Copyright 2017 Google Inc.
    //
    // Permission is hereby granted, free of charge, to any person obtaining a copy
    // of this software and associated documentation files (the "Software"), to deal
    // in the Software without restriction, including without limitation the rights
    // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    // copies of the Software, and to permit persons to whom the Software is
    // furnished to do so, subject to the following conditions:
    //
    // The above copyright notice and this permission notice shall be included in
    // all copies or substantial portions of the Software.
    //
    // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    // THE SOFTWARE.
    //
    
    @import '../feature-targeting/functions';
    @import '../feature-targeting/mixins';
    @import '../theme/variables';
    @import './variables';
    
    @mixin acl-elevation-core-styles($query: acl-feature-all()) {
        $feat-animation: acl-feature-create-target($query, animation);
        $feat-structure: acl-feature-create-target($query, structure);
    
        @for $z-value from 0 through 24 {
            .acl-elevation--z#{$z-value} {
                @include acl-elevation($z-value, $query: $query);
            }
        }
    
        .acl-elevation-transition {
            @include acl-feature-targets($feat-animation) {
                transition: acl-elevation-transition-value();
            }
    
            @include acl-feature-targets($feat-structure) {
                will-change: $acl-elevation-property;
            }
        }
    }
    
    // Applies the correct CSS rules to an element to give it the elevation specified by $z-value.
    // The $z-value must be between 0 and 24.
    // If $color has an alpha channel, it will be ignored and overridden. To increase the opacity of the shadow, use
    // $opacity-boost.
    @mixin acl-elevation($z-value, $color: $acl-elevation-baseline-color, $opacity-boost: 0, $query: acl-feature-all()) {
        @if type-of($z-value) != number or not unitless($z-value) {
            @error "$z-value must be a unitless number, but received '#{$z-value}'";
        }
    
        @if $z-value < 0 or $z-value > 24 {
            @error "$z-value must be between 0 and 24, but received '#{$z-value}'";
        }
    
        $feat-color: acl-feature-create-target($query, color);
    
        $color: acl-theme-prop-value($color);
    
        $umbra-z-value: map-get($acl-elevation-umbra-map, $z-value);
        $penumbra-z-value: map-get($acl-elevation-penumbra-map, $z-value);
        $ambient-z-value: map-get($acl-elevation-ambient-map, $z-value);
    
        $umbra-color: rgba($color, $acl-elevation-umbra-opacity + $opacity-boost);
        $penumbra-color: rgba($color, $acl-elevation-penumbra-opacity + $opacity-boost);
        $ambient-color: rgba($color, $acl-elevation-ambient-opacity + $opacity-boost);
    
        @include acl-feature-targets($feat-color) {
            box-shadow: #{'#{$umbra-z-value} #{$umbra-color}'}, #{'#{$penumbra-z-value} #{$penumbra-color}'},
                #{$ambient-z-value} $ambient-color;
        }
    }
    
    // Returns a string that can be used as the value for a `transition` property for elevation.
    // Calling this function directly is useful in situations where a component needs to transition
    // more than one property.
    //
    // ```scss
    // .foo {
    //   transition: acl-elevation-transition-value(), opacity 100ms ease;
    //   will-change: $acl-elevation-property, opacity;
    // }
    // ```
    @function acl-elevation-transition-value(
        $duration: $acl-elevation-transition-duration,
        $easing: $acl-elevation-transition-timing-function
    ) {
        @return #{$acl-elevation-property} #{$duration} #{$easing};
    }
    
  • URL: /components/raw/elevation/_mixins.scss
  • Filesystem Path: src/components/elevation/_mixins.scss
  • Size: 3.9 KB
  • Content:
    //
    // Copyright 2017 Google Inc.
    //
    // Permission is hereby granted, free of charge, to any person obtaining a copy
    // of this software and associated documentation files (the "Software"), to deal
    // in the Software without restriction, including without limitation the rights
    // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    // copies of the Software, and to permit persons to whom the Software is
    // furnished to do so, subject to the following conditions:
    //
    // The above copyright notice and this permission notice shall be included in
    // all copies or substantial portions of the Software.
    //
    // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    // THE SOFTWARE.
    //
    
    @import '../animation/variables';
    
    $acl-elevation-baseline-color: black !default;
    $acl-elevation-umbra-opacity: 0.2 !default;
    $acl-elevation-penumbra-opacity: 0.14 !default;
    $acl-elevation-ambient-opacity: 0.12 !default;
    
    $acl-elevation-umbra-map: (
        0: '0px 0px 0px 0px',
        1: '0px 2px 1px -1px',
        2: '0px 3px 1px -2px',
        3: '0px 3px 3px -2px',
        4: '0px 2px 4px -1px',
        5: '0px 3px 5px -1px',
        6: '0px 3px 5px -1px',
        7: '0px 4px 5px -2px',
        8: '0px 5px 5px -3px',
        9: '0px 5px 6px -3px',
        10: '0px 6px 6px -3px',
        11: '0px 6px 7px -4px',
        12: '0px 7px 8px -4px',
        13: '0px 7px 8px -4px',
        14: '0px 7px 9px -4px',
        15: '0px 8px 9px -5px',
        16: '0px 8px 10px -5px',
        17: '0px 8px 11px -5px',
        18: '0px 9px 11px -5px',
        19: '0px 9px 12px -6px',
        20: '0px 10px 13px -6px',
        21: '0px 10px 13px -6px',
        22: '0px 10px 14px -6px',
        23: '0px 11px 14px -7px',
        24: '0px 11px 15px -7px',
    ) !default;
    
    $acl-elevation-penumbra-map: (
        0: '0px 0px 0px 0px',
        1: '0px 1px 1px 0px',
        2: '0px 2px 2px 0px',
        3: '0px 3px 4px 0px',
        4: '0px 4px 5px 0px',
        5: '0px 5px 8px 0px',
        6: '0px 6px 10px 0px',
        7: '0px 7px 10px 1px',
        8: '0px 8px 10px 1px',
        9: '0px 9px 12px 1px',
        10: '0px 10px 14px 1px',
        11: '0px 11px 15px 1px',
        12: '0px 12px 17px 2px',
        13: '0px 13px 19px 2px',
        14: '0px 14px 21px 2px',
        15: '0px 15px 22px 2px',
        16: '0px 16px 24px 2px',
        17: '0px 17px 26px 2px',
        18: '0px 18px 28px 2px',
        19: '0px 19px 29px 2px',
        20: '0px 20px 31px 3px',
        21: '0px 21px 33px 3px',
        22: '0px 22px 35px 3px',
        23: '0px 23px 36px 3px',
        24: '0px 24px 38px 3px',
    ) !default;
    
    $acl-elevation-ambient-map: (
        0: '0px 0px 0px 0px',
        1: '0px 1px 3px 0px',
        2: '0px 1px 5px 0px',
        3: '0px 1px 8px 0px',
        4: '0px 1px 10px 0px',
        5: '0px 1px 14px 0px',
        6: '0px 1px 18px 0px',
        7: '0px 2px 16px 1px',
        8: '0px 3px 14px 2px',
        9: '0px 3px 16px 2px',
        10: '0px 4px 18px 3px',
        11: '0px 4px 20px 3px',
        12: '0px 5px 22px 4px',
        13: '0px 5px 24px 4px',
        14: '0px 5px 26px 4px',
        15: '0px 6px 28px 5px',
        16: '0px 6px 30px 5px',
        17: '0px 6px 32px 5px',
        18: '0px 7px 34px 6px',
        19: '0px 7px 36px 6px',
        20: '0px 8px 38px 7px',
        21: '0px 8px 40px 7px',
        22: '0px 8px 42px 7px',
        23: '0px 9px 44px 8px',
        24: '0px 9px 46px 8px',
    ) !default;
    
    // The css property used for elevation. In most cases this should not be changed. It is exposed
    // as a variable for abstraction / easy use when needing to reference the property directly, for
    // example in a `will-change` rule.
    $acl-elevation-property: box-shadow !default;
    
    // The default duration value for elevation transitions.
    $acl-elevation-transition-duration: 280ms !default;
    
    // The default easing value for elevation transitions.
    $acl-elevation-transition-timing-function: $acl-animation-standard-curve-timing-function !default;
    
  • URL: /components/raw/elevation/_variables.scss
  • Filesystem Path: src/components/elevation/_variables.scss
  • Size: 4.1 KB
  • Content:
    {
      "_from": "..//elevation",
      "_id": "..//elevation@4.0.0",
      "_inBundle": false,
      "_integrity": "sha512-wKffoZcqkwAMWYbfGJJ95RDeOFz/IMvF7ye4VamjUwLb1iPiKxUZKUcd40XpuEvsn794HSIEWfGDsRq7BxJAMQ==",
      "_location": "/..//elevation",
      "_phantomChildren": {},
      "_requested": {
        "type": "tag",
        "registry": true,
        "raw": "..//elevation",
        "name": "..//elevation",
        "escapedName": "../%2felevation",
        "scope": "../",
        "rawSpec": "",
        "saveSpec": null,
        "fetchSpec": "latest"
      },
      "_requiredBy": [
        "#USER",
        "/",
        "/..//button",
        "/..//card",
        "/..//chips",
        "/..//data-table",
        "/..//dialog",
        "/..//drawer",
        "/..//fab",
        "/..//menu-surface",
        "/..//switch",
        "/..//tab-bar",
        "/..//top-app-bar",
        "/material-components-web"
      ],
      "_resolved": "https://registry.npmjs.org/..//elevation/-/elevation-4.0.0.tgz",
      "_shasum": "58ba81c8c9efd0b5d3bfed7fa915d4930d814b97",
      "_spec": "..//elevation",
      "_where": "/Users/robcarvill/Development/component-library",
      "bugs": {
        "url": "https://github.com/material-components/material-components-web/issues"
      },
      "bundleDependencies": false,
      "dependencies": {
        "..//animation": "^4.0.0",
        "..//feature-targeting": "^4.0.0",
        "..//theme": "^4.0.0"
      },
      "deprecated": false,
      "description": "Material Components for the web mixins + CSS Classes for Material Design elevation",
      "gitHead": "8fcbb009cd3b5cc004b302613dd55ab4b5d6ef72",
      "homepage": "https://github.com/material-components/material-components-web#readme",
      "keywords": [
        "material components",
        "material design",
        "elevation"
      ],
      "license": "MIT",
      "name": "..//elevation",
      "repository": {
        "type": "git",
        "url": "git+https://github.com/material-components/material-components-web.git",
        "directory": "packages/acl-elevation"
      },
      "version": "4.0.0"
    }
    
  • URL: /components/raw/elevation/package.json
  • Filesystem Path: src/components/elevation/package.json
  • Size: 1.9 KB

Elevation

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.

A note about “z-space”: Within the spec, elevation is normally referred to as having a dp value. In other words, how many “pixels” above the base material is a piece of material elevated. On a computer, this is normally represented by a 3-d coordinate system. We like z-space (or just “z” for short) because it aligns with the technical definition of, and nomenclature for, a 3-d coordinate system. Therefore, we feel it makes more sense than dp. However, when we refer to z-space (or z), that can be used interchangeably with the spec’s dp.

Design & API Documentation

Installation

npm install ..//elevation

Basic Usage

HTML

Elevation is often already included within the baseline styles of other components (e.g. raised buttons, elevated cards).

However, you can also apply elevation to specific components using acl-elevation--z<N> classes:

  <div class="acl-elevation--z1">
    <!-- ... content ... -->
  </div>

Styles

@import "../elevation/acl-elevation";

Style Customization

CSS Classes

Some components have a set elevation. For example, a raised MDC Button has elevation 2.

If you want to set the elevation of an element, which is not a Material Design component, you can apply the following CSS classes.

CSS Class Description
acl-elevation--z<N> Sets the elevation to the (N)dp, where 1 <= N <= 24
acl-elevation-transition Applies the correct css rules to transition an element between elevations

Sass Mixins, Variables, and Functions

Mixin Description
acl-elevation($z-value, $color, $opacity-boost) Sets the elevation to the z-space for that given elevation, and optionally sets the color and/or boosts the opacity of the shadow
Function Description
acl-elevation-transition-value($duration, $easing) Returns a value for the transition property to transition an element between elevations
Variable Description
$acl-elevation-property Default property for elevation transitions
$acl-elevation-transition-duration Default duration value for elevation transitions
$acl-elevation-transition-timing-function Default easing value for elevation transitions

If you need more configurability over your transitions, use the acl-elevation-transition-value function in conjunction with the exported sass variables.

.my-component-with-custom-transitions {

  transition:
    acl-elevation-transition-value(),
    /* Configure opacity to use same duration and easing values as elevation */
    opacity $acl-elevation-transition-duration $acl-elevation-transition-timing-function;
  opacity: .7;
  will-change: $acl-elevation-property, opacity;
}