UNPKG

@limetech/lime-elements

Version:
262 lines (254 loc) 9 kB
@charset "UTF-8"; /** * 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! */ /** * @prop --profile-picture-border-radius: Border radius of the profile picture. Defaults to `100vw` to render a circular shape. */ :host(limel-profile-picture) { position: relative; display: inline-flex; min-width: 1.5rem; min-height: 1.5rem; border-radius: var(--profile-picture-border-radius, 100vw); background-color: rgb(var(--contrast-400)); } * { box-sizing: border-box; } limel-file-dropzone, limel-file-input, button.avatar { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; } button { all: unset; display: block; } button:focus { outline: none; } button:focus-visible { outline: none; box-shadow: var(--shadow-depth-8-focused); } button.avatar { overflow: hidden; border-radius: var(--profile-picture-border-radius, 100vw); } :host(:not([disabled]):not([disabled=true])) button.avatar { 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: transparent; } :host(:not([disabled]):not([disabled=true])) button.avatar:hover, :host(:not([disabled]):not([disabled=true])) button.avatar:focus, :host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible { will-change: color, background-color, box-shadow, transform; } :host(:not([disabled]):not([disabled=true])) button.avatar:hover, :host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible { transform: translate3d(0, 0.01rem, 0); color: var(--limel-theme-on-surface-color); background-color: var(--lime-elevated-surface-background-color); } :host(:not([disabled]):not([disabled=true])) button.avatar:hover { box-shadow: var(--button-shadow-hovered); } :host(:not([disabled]):not([disabled=true])) button.avatar: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); } :host(:not([disabled]):not([disabled=true])) button.avatar:hover, :host(:not([disabled]):not([disabled=true])) button.avatar:active { --limel-clickable-transition-speed: 0.2s; --limel-clickable-transform-speed: 0.16s; } :host([invalid]:not([invalid=false])) button.avatar { box-shadow: var(--shadow-error-state); } button.remove { 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: rgb(var(--contrast-900)); } button.remove:hover, button.remove:focus, button.remove:focus-visible { will-change: color, background-color, box-shadow, transform; } button.remove:hover, button.remove:focus-visible { transform: translate3d(0, 0.01rem, 0); color: rgb(var(--color-white)); background-color: rgb(var(--color-red-default)); } button.remove:hover { box-shadow: var(--button-shadow-hovered); } button.remove: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.remove:hover, button.remove:active { --limel-clickable-transition-speed: 0.2s; --limel-clickable-transform-speed: 0.16s; } button.remove { cursor: pointer; height: 1.25rem; width: 1.25rem; border-radius: 50%; background-repeat: no-repeat; background-position: center; background-size: 0.75rem; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3E%3Cdefs/%3E%3Cpath%20fill='rgb(255,255,255)'%20d='M7.219%205.781L5.78%207.22%2014.563%2016%205.78%2024.781%207.22%2026.22%2016%2017.437l8.781%208.782%201.438-1.438L17.437%2016l8.782-8.781L24.78%205.78%2016%2014.563z'/%3E%3C/svg%3E"); position: absolute; top: 0; left: 0; opacity: 0; } :host(:hover) button.remove, :host(:focus) button.remove, :host(:focus-visible) button.remove, :host(:focus-within) button.remove, :host(:active) button.remove { animation: show 0.4s ease-in-out forwards; } @keyframes show { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } } button.avatar, img, limel-icon { border-radius: var(--profile-picture-border-radius, 100vw); } limel-icon { width: calc(100% - 1rem); min-width: 1rem; max-width: 4rem; color: var(--limel-theme-text-secondary-on-background-color); margin: auto; } img { object-fit: var(--limel-profile-picture-object-fit); width: 100%; height: 100%; } :host(.has-image-error) img { border: 1px dashed rgb(var(--contrast-600)); background: url("data:image/svg+xml;charset=utf-8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' style='fill-rule:evenodd;'><path fill='rgba(186,186,192,0.16)' d='M0 0h4v4H0zM4 4h4v4H4z'/></svg>"); background-size: 0.5rem; } limel-spinner { position: absolute; inset: 0; margin: auto; } limel-popover { position: absolute; inset: auto 0 0 auto; display: block; width: 2.25rem; height: 2.25rem; }