UNPKG

@limetech/lime-elements

Version:
224 lines (217 loc) 7.03 kB
@charset "UTF-8"; /** * 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! */ /* * This file is imported into every component! * * Nothing in this file may output any CSS * without being explicitly called by outside code. */ limel-action-bar-item { transition: opacity 0.2s ease-in-out; position: relative; display: flex; align-items: center; } limel-action-bar-item:not([is-visible]) { opacity: 0; pointer-events: none; } button { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 0.25rem; width: 100%; min-width: var(--action-bar-item-height); max-width: var(--action-bar-item-max-width, 10rem); height: var(--action-bar-item-height); color: var(--limel-action-bar-item-text-color); border-radius: var(--action-bar-item-height); font-size: var(--limel-theme-default-font-size); padding: 0 0.25rem; } 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-action-bar-item-text-color); background-color: var(--action-bar-background-color); } 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-action-bar-item-text-color); background-color: var(--action-bar-background-color); } button:not([disabled]):hover { 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); background-color: var(--action-bar-background-color); box-shadow: var(--button-shadow-inset-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); } button:has(.text) { padding: 0 0.5rem; } button[disabled] { opacity: 0.4; } button.is-selected { color: var(--lime-primary-color, var(--limel-theme-primary-color)) !important; } button.is-selected:not(:hover) { box-shadow: var(--button-shadow-inset); } .text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 0.25rem; } limel-icon { flex-shrink: 0; width: calc(var(--action-bar-item-height) - 0.75rem); height: calc(var(--action-bar-item-height) - 0.75rem); color: var(--action-bar-item-icon-color, var(--limel-action-bar-item-text-color)); } hr { all: unset; width: 1px; height: 1.5rem; border-radius: var(--action-bar-item-height); background-color: var(--limel-action-bar-item-text-color); opacity: 0.2; } @media (pointer: fine) { hr { margin-right: 0.5rem; margin-left: 0.5rem; } } limel-menu { --notification-badge-background-color: rgb(var(--contrast-600)); --notification-badge-text-color: rgb(var(--contrast-1200)); } limel-menu[open] button { box-shadow: var(--button-shadow-inset); } button[slot=trigger] { animation: fade-in ease-out 0.25s; font-size: 0.75rem; font-weight: bold; transform: translate3d(0, 0, 0); } @keyframes fade-in { 0% { scale: 0.8; opacity: 0; } 100% { scale: 1; opacity: 1; } }