preact-material-components
Version:
preact wrapper for "Material Components for the web"
263 lines (241 loc) • 8.9 kB
CSS
/*!
Material Components for the Web
Copyright (c) 2018 Google Inc.
License: MIT
*/
@-webkit-keyframes mdc-ripple-fg-radius-in {
from {
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-webkit-transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1);
transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1); }
to {
-webkit-transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1)); } }
@keyframes mdc-ripple-fg-radius-in {
from {
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-webkit-transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1);
transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1); }
to {
-webkit-transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1)); } }
@-webkit-keyframes mdc-ripple-fg-opacity-in {
from {
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
opacity: 0; }
to {
opacity: var(--mdc-ripple-fg-opacity, 0); } }
@keyframes mdc-ripple-fg-opacity-in {
from {
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
opacity: 0; }
to {
opacity: var(--mdc-ripple-fg-opacity, 0); } }
@-webkit-keyframes mdc-ripple-fg-opacity-out {
from {
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
opacity: var(--mdc-ripple-fg-opacity, 0); }
to {
opacity: 0; } }
@keyframes mdc-ripple-fg-opacity-out {
from {
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
opacity: var(--mdc-ripple-fg-opacity, 0); }
to {
opacity: 0; } }
.mdc-ripple-surface--test-edge-var-bug {
--mdc-ripple-surface-test-edge-var: 1px solid #000;
visibility: hidden; }
.mdc-ripple-surface--test-edge-var-bug::before {
border: var(--mdc-ripple-surface-test-edge-var); }
/**
* @license
* Copyright 2018 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.
*/
.mdc-tab {
position: relative;
font-family: Roboto, sans-serif;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-size: 0.875rem;
line-height: 2.25rem;
font-weight: 500;
letter-spacing: 0.08929em;
text-decoration: none;
text-transform: uppercase;
display: flex;
flex: 1 0 auto;
justify-content: center;
box-sizing: border-box;
height: 48px;
padding: 0 24px;
border: none;
outline: none;
background: none;
text-align: center;
text-decoration: none;
text-transform: uppercase;
white-space: nowrap;
cursor: pointer;
-webkit-appearance: none;
z-index: 1; }
.mdc-tab .mdc-tab__text-label {
color: #000;
/* @alternate */
color: var(--mdc-theme-on-surface, #000); }
.mdc-tab .mdc-tab__icon {
color: #000;
/* @alternate */
color: var(--mdc-theme-on-surface, #000); }
.mdc-tab--min-width {
flex: 0 1 auto; }
.mdc-tab__ripple {
--mdc-ripple-fg-size: 0;
--mdc-ripple-left: 0;
--mdc-ripple-top: 0;
--mdc-ripple-fg-scale: 1;
--mdc-ripple-fg-translate-end: 0;
--mdc-ripple-fg-translate-start: 0;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
will-change: transform, opacity;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden; }
.mdc-tab__ripple::before, .mdc-tab__ripple::after {
position: absolute;
border-radius: 50%;
opacity: 0;
pointer-events: none;
content: ""; }
.mdc-tab__ripple::before {
transition: opacity 15ms linear;
z-index: 1; }
.mdc-tab__ripple.mdc-ripple-upgraded::before {
-webkit-transform: scale(var(--mdc-ripple-fg-scale, 1));
transform: scale(var(--mdc-ripple-fg-scale, 1)); }
.mdc-tab__ripple.mdc-ripple-upgraded::after {
top: 0;
/* @noflip */
left: 0;
-webkit-transform: scale(0);
transform: scale(0);
-webkit-transform-origin: center center;
transform-origin: center center; }
.mdc-tab__ripple.mdc-ripple-upgraded--unbounded::after {
top: var(--mdc-ripple-top, 0);
/* @noflip */
left: var(--mdc-ripple-left, 0); }
.mdc-tab__ripple.mdc-ripple-upgraded--foreground-activation::after {
-webkit-animation: 225ms mdc-ripple-fg-radius-in forwards, 75ms mdc-ripple-fg-opacity-in forwards;
animation: 225ms mdc-ripple-fg-radius-in forwards, 75ms mdc-ripple-fg-opacity-in forwards; }
.mdc-tab__ripple.mdc-ripple-upgraded--foreground-deactivation::after {
-webkit-animation: 150ms mdc-ripple-fg-opacity-out;
animation: 150ms mdc-ripple-fg-opacity-out;
-webkit-transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1)); }
.mdc-tab__ripple::before, .mdc-tab__ripple::after {
top: calc(50% - 100%);
/* @noflip */
left: calc(50% - 100%);
width: 200%;
height: 200%; }
.mdc-tab__ripple.mdc-ripple-upgraded::after {
width: var(--mdc-ripple-fg-size, 100%);
height: var(--mdc-ripple-fg-size, 100%); }
.mdc-tab__ripple::before, .mdc-tab__ripple::after {
background-color: #6200ee; }
@supports not (-ms-ime-align: auto) {
.mdc-tab__ripple::before, .mdc-tab__ripple::after {
/* @alternate */
background-color: var(--mdc-theme-primary, #6200ee); } }
.mdc-tab__ripple:hover::before {
opacity: 0.04; }
.mdc-tab__ripple:not(.mdc-ripple-upgraded):focus::before, .mdc-tab__ripple.mdc-ripple-upgraded--background-focused::before {
transition-duration: 75ms;
opacity: 0.12; }
.mdc-tab__ripple:not(.mdc-ripple-upgraded)::after {
transition: opacity 150ms linear; }
.mdc-tab__ripple:not(.mdc-ripple-upgraded):active::after {
transition-duration: 75ms;
opacity: 0.16; }
.mdc-tab__ripple.mdc-ripple-upgraded {
--mdc-ripple-fg-opacity: 0.16; }
.mdc-tab__content {
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: inherit;
pointer-events: none; }
.mdc-tab__text-label,
.mdc-tab__icon {
transition: 150ms color linear, 150ms opacity linear;
z-index: 2; }
.mdc-tab__text-label {
display: inline-block;
opacity: 0.6;
line-height: 1; }
.mdc-tab__icon {
width: 24px;
height: 24px;
opacity: 0.54; }
.mdc-tab--stacked {
height: 72px; }
.mdc-tab--stacked .mdc-tab__content {
flex-direction: column;
align-items: center;
justify-content: space-between; }
.mdc-tab--stacked .mdc-tab__icon {
padding-top: 12px; }
.mdc-tab--stacked .mdc-tab__text-label {
padding-bottom: 16px; }
.mdc-tab--active .mdc-tab__text-label {
color: #6200ee;
/* @alternate */
color: var(--mdc-theme-primary, #6200ee); }
.mdc-tab--active .mdc-tab__icon {
color: #6200ee;
/* @alternate */
color: var(--mdc-theme-primary, #6200ee); }
.mdc-tab--active .mdc-tab__text-label,
.mdc-tab--active .mdc-tab__icon {
transition-delay: 100ms;
opacity: 1; }
.mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon + .mdc-tab__text-label {
/* @noflip */
padding-left: 8px;
/* @noflip */
padding-right: 0; }
[dir="rtl"] .mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon + .mdc-tab__text-label, .mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon + .mdc-tab__text-label[dir="rtl"] {
/* @noflip */
padding-left: 0;
/* @noflip */
padding-right: 8px; }
/*# sourceMappingURL=mdc.tab.css.map*/