// // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // @import "@material/animation/functions"; @import "@material/rtl/mixins"; @import "@material/theme/mixins"; @import "@material/typography/mixins"; @import "./variables"; /* postcss-bem-linter: define snackbar */ .mdc-snackbar { display: flex; position: fixed; bottom: 0; left: 50%; align-items: center; justify-content: flex-start; padding-right: 24px; padding-left: 24px; transform: translate(0, 100%); transition: mdc-animation-exit(transform, .25s); background-color: $mdc-snackbar-background-color; will-change: transform; pointer-events: none; @media (max-width: ($mdc-snackbar-tablet-breakpoint - 1)) { left: 0; width: calc(100% - 48px); } @media (min-width: $mdc-snackbar-tablet-breakpoint) { min-width: 288px; max-width: 568px; transform: translate(-50%, 100%); border-radius: 2px; } &--active { transform: translate(0, 0); pointer-events: auto; transition: mdc-animation-enter(transform, .25s); @media (min-width: $mdc-snackbar-tablet-breakpoint) { transform: translate(-50%, 0); } } &--action-on-bottom { flex-direction: column; } &--action-on-bottom &__text { margin-right: inherit; } &--action-on-bottom &__action-wrapper { flex-direction: column; justify-content: flex-start; margin-top: -12px; margin-bottom: 8px; @include mdc-rtl-reflexive-box(margin, left, auto); } &__text { @include mdc-typography(body1); @include mdc-rtl-reflexive-box(margin, right, auto, ".mdc-snackbar"); display: flex; align-items: center; height: 48px; transition: mdc-animation-exit(opacity, .3s); color: $mdc-snackbar-foreground-color; opacity: 0; } &--multiline &__text { height: 80px; } /* stylelint-disable plugin/selector-bem-pattern */ &--multiline#{&}--action-on-bottom &__text { margin: 0; } /* stylelint-enable plugin/selector-bem-pattern */ &__action-button { @include mdc-theme-prop(color, accent); @include mdc-rtl-reflexive-box(margin, right, -16px, ".mdc-snackbar"); min-width: auto; height: inherit; transition: mdc-animation-exit(opacity, .3s); opacity: 0; visibility: hidden; &::-moz-focus-inner { border: 0; } &:not([aria-hidden]) { visibility: inherit; } } &--active &__text, &--active &__action-button:not([aria-hidden]) { transition: mdc-animation-exit(opacity, .3s); opacity: 1; } } /* postcss-bem-linter: end */