UNPKG

@limetech/lime-elements

Version:
298 lines (283 loc) 8.7 kB
@charset "UTF-8"; @keyframes reduced-presence { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.7); } } :host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) { animation: reduced-presence 0.3s ease forwards; transition: padding 0.3s ease, min-width 0.3s ease; transition-delay: 0.3s; padding: 0; min-width: 0; } :host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .label { transition: font-size 0.8s ease; transition-delay: 0.3s; font-size: 0; opacity: 0; } :host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-icon, :host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-spinner, :host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) svg, :host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .icon { transition: all 0.3s ease; transition-delay: 0.3s; opacity: 0; width: 0; height: 0; } /* * This file is imported into every component! * * Nothing in this file may output any CSS * without being explicitly called by outside code. */ /** * Note! This file is forwarded via `src/style/exports.scss` * and exposed to consumers through the root `index.scss`. * * Consumers import it using: * `@use '@limetech/lime-elements' as lime-elements;` * * Legacy import paths (`dist/scss/mixins`) are maintained * for backward compatibility via copy rules in the Stencil config. */ /** * 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. */ /** * Drag to reorder mixins */ /** * 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! */ :host { display: inline-block; } :host([hidden]) { display: none; } :host([aria-expanded=true]) button, :host([aria-expanded]:not([aria-expanded=false])) button { box-shadow: var(--button-shadow-inset-pressed) !important; } button.mdc-button { font-family: inherit; } button { display: flex; align-items: center; justify-content: center; gap: 0.125rem; border: none; border-radius: 0.4rem; padding-top: 0; padding-right: var(--button-padding-right, 0.5rem); padding-bottom: 0; padding-left: var(--button-padding-left, 0.5rem); min-height: 2.25rem; width: 100%; } button:disabled { cursor: not-allowed; } button:disabled.outlined { border-color: rgba(var(--contrast-1700), 0.2); } 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); } button:not(:disabled):hover, button:not(:disabled):focus, button:not(:disabled):focus-visible { will-change: color, background-color, box-shadow, transform; } button:not(:disabled):hover, 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); } 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); } button:not(:disabled):hover, button:not(:disabled):active { --limel-clickable-transition-speed: 0.2s; --limel-clickable-transform-speed: 0.16s; } button:not(:disabled):focus { outline: none; } button:not(:disabled):focus-visible { outline: none; box-shadow: var(--shadow-depth-8-focused); } :host(limel-button[primary]) button:not(:disabled) { color: var(--lime-on-primary-color, var(--limel-theme-on-primary-color)); background-color: var(--lime-primary-color, var(--limel-theme-primary-color)); } :host(limel-button[primary]) button:disabled { background-color: rgba(var(--contrast-1700), 0.15); } :host(limel-button:not([primary])) button:not(:disabled) { color: var(--lime-primary-color, var(--limel-theme-primary-color)); } :host(limel-button:not([primary])) button:disabled { color: rgba(var(--contrast-1600), 0.37); background-color: rgba(var(--contrast-1600), 0.1); } .label { font-size: var(--limel-theme-default-font-size); font-weight: 600; letter-spacing: 0.03125rem; padding: 0 0.25rem; } limel-spinner { position: absolute; } limel-icon { width: 1.25rem; flex-shrink: 0; vertical-align: top; } svg { height: 1.875rem; opacity: 0; pointer-events: none; position: absolute; width: 1.875rem; } svg line { stroke: rgb(var(--contrast-600)); stroke-width: 2; } limel-icon, .label, limel-spinner, svg { transition: opacity 300ms ease-in-out; } .loading limel-icon, .loading .label { opacity: 0; } .loading limel-spinner { opacity: 1; } .just-loaded limel-icon, .just-loaded .label, .just-failed limel-icon, .just-failed .label { opacity: 0; } .just-loaded svg, .just-failed svg { opacity: 1; } .just-failed { background-color: var(--limel-theme-error-color) !important; animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } .outlined { border: 1px solid; border-color: var(--lime-primary-color, var(--limel-theme-primary-color)); } @keyframes shake { 10%, 90% { transform: translate3d(-0.0625rem, 0, 0); } 20%, 80% { transform: translate3d(0.125rem, 0, 0); } 30%, 50%, 70% { transform: translate3d(-0.1875rem, 0, 0); } 40%, 60% { transform: translate3d(0.1875rem, 0, 0); } }