// // 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(-50%, 100%); transition: mdc-animation-exit-permanent(transform, .25s); background-color: $mdc-snackbar-background-color; pointer-events: none; will-change: transform; @include mdc-theme-dark(".mdc-snackbar") { background-color: $mdc-snackbar-background-color-on-dark; } @media (max-width: ($mdc-snackbar-tablet-breakpoint - 1)) { left: 0; width: calc(100% - 48px); transform: translate(0, 100%); } @media (min-width: $mdc-snackbar-tablet-breakpoint) { min-width: 288px; max-width: 568px; border-radius: 2px; } &--align-start { @media (min-width: $mdc-snackbar-tablet-breakpoint) { @include mdc-rtl-reflexive-position(left, 24px); bottom: 24px; transform: translate(0, 200%); } @media (max-width: ($mdc-snackbar-tablet-breakpoint - 1)) { bottom: 0; left: 0; width: calc(100% - 48px); transform: translate(0, 100%); } } &--active { transform: translate(0); transition: mdc-animation-enter(transform, .25s); pointer-events: auto; &:not(.mdc-snackbar--align-start) { transform: translate(-50%, 0); @media (max-width: ($mdc-snackbar-tablet-breakpoint - 1)) { bottom: 0; left: 0; width: calc(100% - 48px); transform: translate(0); } } } &--action-on-bottom { flex-direction: column; } &--action-on-bottom &__text { margin-right: inherit; } &--action-on-bottom &__action-wrapper { @include mdc-rtl-reflexive-box(margin, left, auto); flex-direction: column; justify-content: flex-start; margin-top: -12px; margin-bottom: 8px; } &__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-permanent(opacity, .3s); opacity: 0; color: $mdc-snackbar-foreground-color; @include mdc-theme-dark(".mdc-snackbar") { @include mdc-theme-prop(color, text-primary-on-light); } } &--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-typography(button); @include mdc-theme-prop(color, secondary); @include mdc-theme-dark(".mdc-snackbar") { @include mdc-theme-prop(color, primary); } padding: 0; transition: mdc-animation-exit-permanent(opacity, .3s); border: none; outline: none; background-color: transparent; opacity: 0; user-select: none; -webkit-appearance: none; visibility: hidden; &:hover { cursor: pointer; } &::-moz-focus-inner { border: 0; } &:not([aria-hidden]) { visibility: inherit; } } &--active &__text, &--active &__action-button:not([aria-hidden]) { transition: mdc-animation-exit-permanent(opacity, .3s); opacity: 1; } } /* postcss-bem-linter: end */