UNPKG

@limetech/lime-elements

Version:
773 lines (721 loc) 22.6 kB
@charset "UTF-8"; /** * @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-bar { width: 100%; } .mdc-tab { height: 48px; } .mdc-tab--stacked { height: 72px; } /** * @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-scroller { overflow-y: hidden; } .mdc-tab-scroller.mdc-tab-scroller--animating .mdc-tab-scroller__scroll-content { transition: 250ms transform cubic-bezier(0.4, 0, 0.2, 1); } .mdc-tab-scroller__test { position: absolute; top: -9999px; width: 100px; height: 100px; overflow-x: scroll; } .mdc-tab-scroller__scroll-area { -webkit-overflow-scrolling: touch; display: flex; overflow-x: hidden; } .mdc-tab-scroller__scroll-area::-webkit-scrollbar, .mdc-tab-scroller__test::-webkit-scrollbar { display: none; } .mdc-tab-scroller__scroll-area--scroll { overflow-x: scroll; } .mdc-tab-scroller__scroll-content { position: relative; display: flex; flex: 1 0 auto; transform: none; will-change: transform; } .mdc-tab-scroller--align-start .mdc-tab-scroller__scroll-content { justify-content: flex-start; } .mdc-tab-scroller--align-end .mdc-tab-scroller__scroll-content { justify-content: flex-end; } .mdc-tab-scroller--align-center .mdc-tab-scroller__scroll-content { justify-content: center; } .mdc-tab-scroller--animating .mdc-tab-scroller__scroll-area { -webkit-overflow-scrolling: auto; } /** * @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-indicator .mdc-tab-indicator__content--underline { border-color: #6200ee; /* @alternate */ border-color: var(--mdc-theme-primary, #6200ee); } .mdc-tab-indicator .mdc-tab-indicator__content--icon { color: #018786; /* @alternate */ color: var(--mdc-theme-secondary, #018786); } .mdc-tab-indicator .mdc-tab-indicator__content--underline { border-top-width: 2px; } .mdc-tab-indicator .mdc-tab-indicator__content--icon { height: 34px; font-size: 34px; } .mdc-tab-indicator { display: flex; position: absolute; top: 0; left: 0; justify-content: center; width: 100%; height: 100%; pointer-events: none; z-index: 1; } .mdc-tab-indicator__content { transform-origin: left; opacity: 0; } .mdc-tab-indicator__content--underline { align-self: flex-end; box-sizing: border-box; width: 100%; border-top-style: solid; } .mdc-tab-indicator__content--icon { align-self: center; margin: 0 auto; } .mdc-tab-indicator--active .mdc-tab-indicator__content { opacity: 1; } .mdc-tab-indicator .mdc-tab-indicator__content { transition: 250ms transform cubic-bezier(0.4, 0, 0.2, 1); } .mdc-tab-indicator--no-transition .mdc-tab-indicator__content { transition: none; } .mdc-tab-indicator--fade .mdc-tab-indicator__content { transition: 150ms opacity linear; } .mdc-tab-indicator--active.mdc-tab-indicator--fade .mdc-tab-indicator__content { transition-delay: 100ms; } .mdc-tab { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-family: Roboto, sans-serif; /* @alternate */ font-family: var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif)); font-size: 0.875rem; /* @alternate */ font-size: var(--mdc-typography-button-font-size, 0.875rem); line-height: 2.25rem; /* @alternate */ line-height: var(--mdc-typography-button-line-height, 2.25rem); font-weight: 500; /* @alternate */ font-weight: var(--mdc-typography-button-font-weight, 500); letter-spacing: 0.0892857143em; /* @alternate */ letter-spacing: var(--mdc-typography-button-letter-spacing, 0.0892857143em); text-decoration: none; /* @alternate */ text-decoration: var(--mdc-typography-button-text-decoration, none); text-transform: uppercase; /* @alternate */ text-transform: var(--mdc-typography-button-text-transform, uppercase); position: relative; } .mdc-tab .mdc-tab__text-label { color: rgba(0, 0, 0, 0.6); } .mdc-tab .mdc-tab__icon { color: rgba(0, 0, 0, 0.54); fill: currentColor; } .mdc-tab__content { position: relative; } .mdc-tab__icon { width: 24px; height: 24px; font-size: 24px; } .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); fill: currentColor; } .mdc-tab { background: none; } .mdc-tab { min-width: 90px; padding-right: 24px; padding-left: 24px; display: flex; flex: 1 0 auto; justify-content: center; box-sizing: border-box; margin: 0; padding-top: 0; padding-bottom: 0; border: none; outline: none; text-align: center; white-space: nowrap; cursor: pointer; -webkit-appearance: none; z-index: 1; } .mdc-tab::-moz-focus-inner { padding: 0; border: 0; } .mdc-tab--min-width { flex: 0 1 auto; } .mdc-tab__content { display: flex; align-items: center; justify-content: center; height: inherit; pointer-events: none; } .mdc-tab__text-label { transition: 150ms color linear; display: inline-block; line-height: 1; z-index: 2; } .mdc-tab__icon { transition: 150ms color linear; z-index: 2; } .mdc-tab--stacked .mdc-tab__content { flex-direction: column; align-items: center; justify-content: center; } .mdc-tab--stacked .mdc-tab__text-label { padding-top: 6px; padding-bottom: 4px; } .mdc-tab--active .mdc-tab__text-label, .mdc-tab--active .mdc-tab__icon { transition-delay: 100ms; } .mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon + .mdc-tab__text-label { /* @noflip */ /*rtl:ignore*/ padding-left: 8px; /* @noflip */ /*rtl:ignore*/ 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] { /*rtl:begin:ignore*/ /* @noflip */ /*rtl:ignore*/ padding-left: 0; /* @noflip */ /*rtl:ignore*/ padding-right: 8px; /*rtl:end:ignore*/ } @keyframes mdc-ripple-fg-radius-in { from { animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1); } to { transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1)); } } @keyframes mdc-ripple-fg-opacity-in { from { animation-timing-function: linear; opacity: 0; } to { opacity: var(--mdc-ripple-fg-opacity, 0); } } @keyframes mdc-ripple-fg-opacity-out { from { animation-timing-function: linear; opacity: var(--mdc-ripple-fg-opacity, 0); } to { opacity: 0; } } .mdc-tab { --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); } .mdc-tab .mdc-tab__ripple::before, .mdc-tab .mdc-tab__ripple::after { position: absolute; border-radius: 50%; opacity: 0; pointer-events: none; content: ""; } .mdc-tab .mdc-tab__ripple::before { transition: opacity 15ms linear, background-color 15ms linear; z-index: 1; /* @alternate */ z-index: var(--mdc-ripple-z-index, 1); } .mdc-tab .mdc-tab__ripple::after { z-index: 0; /* @alternate */ z-index: var(--mdc-ripple-z-index, 0); } .mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::before { transform: scale(var(--mdc-ripple-fg-scale, 1)); } .mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::after { top: 0; /* @noflip */ /*rtl:ignore*/ left: 0; transform: scale(0); transform-origin: center center; } .mdc-tab.mdc-ripple-upgraded--unbounded .mdc-tab__ripple::after { top: var(--mdc-ripple-top, 0); /* @noflip */ /*rtl:ignore*/ left: var(--mdc-ripple-left, 0); } .mdc-tab.mdc-ripple-upgraded--foreground-activation .mdc-tab__ripple::after { animation: mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards; } .mdc-tab.mdc-ripple-upgraded--foreground-deactivation .mdc-tab__ripple::after { animation: mdc-ripple-fg-opacity-out 150ms; transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1)); } .mdc-tab .mdc-tab__ripple::before, .mdc-tab .mdc-tab__ripple::after { top: calc(50% - 100%); /* @noflip */ /*rtl:ignore*/ left: calc(50% - 100%); width: 200%; height: 200%; } .mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::after { width: var(--mdc-ripple-fg-size, 100%); height: var(--mdc-ripple-fg-size, 100%); } .mdc-tab .mdc-tab__ripple::before, .mdc-tab .mdc-tab__ripple::after { background-color: #6200ee; /* @alternate */ background-color: var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee)); } .mdc-tab:hover .mdc-tab__ripple::before, .mdc-tab.mdc-ripple-surface--hover .mdc-tab__ripple::before { opacity: 0.04; /* @alternate */ opacity: var(--mdc-ripple-hover-opacity, 0.04); } .mdc-tab.mdc-ripple-upgraded--background-focused .mdc-tab__ripple::before, .mdc-tab:not(.mdc-ripple-upgraded):focus .mdc-tab__ripple::before { transition-duration: 75ms; opacity: 0.12; /* @alternate */ opacity: var(--mdc-ripple-focus-opacity, 0.12); } .mdc-tab:not(.mdc-ripple-upgraded) .mdc-tab__ripple::after { transition: opacity 150ms linear; } .mdc-tab:not(.mdc-ripple-upgraded):active .mdc-tab__ripple::after { transition-duration: 75ms; opacity: 0.12; /* @alternate */ opacity: var(--mdc-ripple-press-opacity, 0.12); } .mdc-tab.mdc-ripple-upgraded { --mdc-ripple-fg-opacity: var(--mdc-ripple-press-opacity, 0.12); } .mdc-tab__ripple { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; will-change: transform, opacity; } /** * Note! This file is exported to `dist/scss/` in the published * node module, for consumer projects to import. * That means this file cannot import from any file that isn't * also exported, keeping the same relative path. * * Or, just don't import anything, that works too. */ /** * This can be used on a trigger element that opens a dropdown menu or a popover. */ /** * This mixin will mask out the content that is close to * the edges of a scrollable area. * - If the scrollable content has `overflow-y`, use `vertically` * as an argument for `$direction`. - If the scrollable content has `overflow-x`, use `horizontally` * as an argument for `$direction`. * * For the visual effect to work smoothly, we need to make sure that * the size of the fade-out edge effect is the same as the * internal paddings of the scrollable area. Otherwise, content of a * scrollable area that does not have a padding will fade out before * any scrolling has been done. * This is why this mixin already adds paddings, which automatically * default to the size of the fade-out effect. * This size defaults to `1rem`, but to override the size use * `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height` * when `vertically` argument is set, and use * `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width` * when `horizontally` argument is set. * Of course you can also programmatically increase and decrease the * size of these variables for each edge, based on the amount of * scrolling that has been done by the user. In this case, make sure * to add a custom padding where the mixin is used, to override * the paddings that are automatically added by the mixin in the * compiled CSS code. */ /** * This mixin will add an animated underline to the bottom of an `a` elements. * Note that you may need to add `all: unset;` –depending on your use case– * before using this mixin. */ /** * This mixin creates a cross-browser font stack. * - `sans-serif` can be used for the UI of the components. * - `monospace` can be used for code. * * ⚠️ If we change the font stacks, we need to update * 1. the consumer documentation in `README.md`, and * 2. the CSS variables of `--kompendium-example-font-family` * in the `<style>` tag of `index.html`. */ /** * This mixin is a hack, using old CSS syntax * to enable you to truncate a piece of text, * after a certain number of lines. */ /** * This mixin will add a chessboard background pattern, * typically used to visualize transparency. */ /** * Make a container resizable by the user. * This is used in the documentations and examples * of some components, to demonstrate how the component * behaves in a resizable container. */ /** * The breakpoints below are used to create responsive designs * in Lime's products. Therefore, they are here to get distributed * to all components in other private repos, which rely on this `mixins` * file, to create consistent styles. * * :::important * In very rare cases you should used media queries! * Nowadays, there are many better ways of achieving responsive design * without media queries. For example, using CSS Grid, Flexbox, and their features. * ::: */ /** * Media query mixins for responsive design based on screen width. * Note that these mixins do not detect the device type! */ .scroll-fade, .scroll-button { position: absolute; transition-property: transform; transition-duration: 0.3s; transition-timing-function: ease-out; } .scroll-fade { top: 0; height: 100%; width: 4rem; pointer-events: none; } .scroll-fade.left { transform: translate3d(-4rem, 0, 0); left: 0; background: linear-gradient(270deg, rgba(var(--contrast-300), 0) 0%, rgba(var(--contrast-300), 0.8) 40%, rgba(var(--contrast-300), 0.8) 100%); } .scroll-fade.right { transform: translate3d(4rem, 0, 0); right: 0; background: linear-gradient(90deg, rgba(var(--contrast-300), 0) 0%, rgba(var(--contrast-300), 0.8) 40%, rgba(var(--contrast-300), 0.8) 100%); } .scroll-button { display: flex; align-items: center; top: 0; bottom: 0; } .scroll-button.left { transform: translate3d(-4rem, 0, 0); left: 0.25rem; } .scroll-button.right { transform: translate3d(4rem, 0, 0); right: 0.25rem; } .scroll-button:hover { transform: translate3d(0, 0, 0); } .scroll-button button { all: unset; display: flex; align-items: center; justify-content: center; width: 1.25rem; height: calc(100% - (0.25rem * 2)); border-radius: 0.25rem; } .scroll-button button:not(:disabled) { transition: color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease); cursor: pointer; color: var(--limel-theme-on-surface-color); background-color: var(--lime-elevated-surface-background-color); box-shadow: var(--button-shadow-normal); } .scroll-button button:not(:disabled):hover, .scroll-button button:not(:disabled):focus, .scroll-button button:not(:disabled):focus-visible { will-change: color, background-color, box-shadow, transform; } .scroll-button button:not(:disabled):hover, .scroll-button button:not(:disabled):focus-visible { transform: translate3d(0, -0.04rem, 0); color: var(--limel-theme-on-surface-color); background-color: var(--lime-elevated-surface-background-color); box-shadow: var(--button-shadow-hovered); } .scroll-button button:not(:disabled):active { --limel-clickable-transform-timing-function: cubic-bezier( 0.83, -0.15, 0.49, 1.16 ); transform: translate3d(0, 0.05rem, 0); box-shadow: var(--button-shadow-pressed); } .scroll-button button:not(:disabled):hover, .scroll-button button:not(:disabled):active { --limel-clickable-transition-speed: 0.2s; --limel-clickable-transform-speed: 0.16s; } .scroll-button limel-icon { width: 1rem; } .mdc-tab-scroller { position: relative; overflow: hidden; } .mdc-tab-scroller.can-scroll-left .scroll-fade.left, .mdc-tab-scroller.can-scroll-left .scroll-button.left, .mdc-tab-scroller.can-scroll-right .scroll-fade.right, .mdc-tab-scroller.can-scroll-right .scroll-button.right { transform: translate3d(0, 0, 0); } .mdc-tab-scroller.can-scroll-left:not(.can-scroll-right) .scroll-button.right, .mdc-tab-scroller.can-scroll-right:not(.can-scroll-left) .scroll-button.left { opacity: 0.5; transition-delay: 0.5s; } .lime-hide-scrollbars { scrollbar-width: none; -ms-overflow-style: none; } .mdc-tab-scroller__scroll-content { padding: 0.25rem 0.75rem 0 0.75rem; background-color: rgb(var(--contrast-300)); } :host(limel-tab-bar) { --limel-active-tab-background-color: var( --tab-panel-background-color, rgb(var(--contrast-100)) ); isolation: isolate; display: block; position: relative; } :host(.has-tabs-with-equal-width) .mdc-tab { flex: 1 0 auto; } .mdc-tab { font-family: inherit; font-weight: 400; letter-spacing: normal; font-size: var(--limel-theme-default-font-size); text-transform: none; } .mdc-tab-indicator .mdc-tab-indicator__content { border: none; } .mdc-tab__ripple { box-sizing: border-box; border-radius: 0.625rem; border-style: solid; border-color: transparent; border-width: 0.25rem; opacity: 0.7; } .mdc-tab__ripple:before, .mdc-tab__ripple:after { transition: background-color 0.5s ease; } .mdc-tab { border-radius: 0; padding-right: 1rem; padding-left: 1rem; min-width: 2.5rem; background-color: transparent; flex: 0 0 auto; height: 2.5rem; } .mdc-tab:not(.mdc-tab--active) { --badge-background-color: rgb(var(--contrast-600)); } .mdc-tab:not(.mdc-tab--active):after { content: ""; display: block; background-color: rgb(var(--contrast-600)); width: 0.125rem; height: 1rem; margin: auto; position: absolute; top: 0; bottom: 0; border-radius: 1rem; right: -0.125rem; } .mdc-tab:not(.mdc-tab--active):last-of-type:after { display: none; } .mdc-tab .mdc-tab__icon { margin-left: -0.25rem; } .mdc-tab limel-badge { margin-right: -0.25rem; } .mdc-tab--active { border-radius: 0.625rem 0.625rem 0 0; background-color: var(--limel-active-tab-background-color); z-index: 2; } .mdc-tab--active:before, .mdc-tab--active:after { content: ""; display: block; width: 0.75rem; height: 0.75rem; position: absolute; bottom: 0; background-color: var(--limel-active-tab-background-color); -webkit-mask-image: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' clip-rule='evenodd' viewBox='0 0 50 50'><defs/><path d='M0 0c0 27.594 22.406 50 50 50H0V0z'/></svg>"); mask-image: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' clip-rule='evenodd' viewBox='0 0 50 50'><defs/><path d='M0 0c0 27.594 22.406 50 50 50H0V0z'/></svg>"); } .mdc-tab--active:before { left: -0.75rem; transform: rotateY(180deg); } .mdc-tab--active:after { right: -0.75rem; } .mdc-tab--active .mdc-ripple-upgraded--background-focused:before { background-color: transparent; transition: background-color 1s ease; } .mdc-tab__content { gap: 0.375rem; } .mdc-tab .mdc-tab__text-label { transition: color 0.2s ease; padding-left: 0 !important; color: var(--limel-theme-on-surface-color); } .mdc-tab:hover .mdc-tab__text-label { color: var(--limel-theme-text-primary-on-background-color); } .mdc-tab.mdc-tab--active .mdc-tab__text-label { color: var(--lime-primary-color, var(--limel-theme-primary-color)); }