@limetech/lime-elements
Version:
247 lines (232 loc) • 9.71 kB
CSS
@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!
*/
:host(.has-striped-rows) .mdc-deprecated-list {
border: 1px solid rgb(var(--contrast-400));
}
:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even),
:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even) {
background-color: var(--list-background-color-of-odd-interactive-items, rgb(var(--contrast-200)));
}
:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd),
:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd) {
background-color: var(--list-background-color-of-even-interactive-items, rgb(var(--contrast-100)));
}
:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]) {
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(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover, :host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus, :host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible {
will-change: color, background-color, box-shadow, transform;
}
:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover, :host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible {
transform: translate3d(0, 0.01rem, 0);
color: var(--limel-theme-on-surface-color);
background-color: var(--lime-elevated-surface-background-color);
}
:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover {
box-shadow: var(--button-shadow-hovered);
}
:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):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(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover, :host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active {
--limel-clickable-transition-speed: 0.2s;
--limel-clickable-transform-speed: 0.16s;
}
/*
* This file is imported into every component!
*
* Nothing in this file may output any CSS
* without being explicitly called by outside code.
*/
:host(.has-grid-layout) {
--gap: var(--list-grid-gap, 0.5rem);
padding: var(--gap);
/* prettier-ignore */
}
:host(.has-grid-layout) .mdc-deprecated-list {
display: grid;
gap: var(--gap);
grid-template-columns: repeat(auto-fit, minmax(min(100%, max(var(--list-grid-item-max-width, 10rem) - var(--gap), var(--list-grid-item-min-width, 7.5rem))), 1fr));
max-width: var(--list-grid-max-width, 100%);
}
:host(.has-grid-layout) .mdc-deprecated-list limel-list-item {
border-radius: var(--limel-list-border-radius) ;
}
:host(.has-grid-layout) .mdc-deprecated-list-divider {
grid-column: 1/-1;
}
:host(.static-actions-list) {
z-index: 1;
background-color: var(--limel-theme-surface-background-color);
}
:host(.has-position-sticky) {
position: sticky;
box-shadow: 0 0 0.75rem 0.5rem var(--limel-theme-surface-background-color);
}
:host(.has-position-sticky.is-on-top) {
top: 0;
}
:host(.has-position-sticky.is-at-bottom) {
bottom: 0;
}
:host(.is-on-top) {
border-bottom: 1px solid rgb(var(--contrast-400));
margin-bottom: 0.5rem;
padding-bottom: 0.25rem;
}
:host(.is-at-bottom) {
border-top: 1px solid rgb(var(--contrast-400));
margin-top: 0.5rem;
padding-top: 0.25rem;
}
/**
* @prop --icon-background-color: Color to use for icon background when `badgeIcons=true`.
* @prop --icon-color: Color to use for icon. Defaults to grey when `badgeIcons=false`. Defaults to white when `badgeIcons=true`.
* @prop --list-grid-max-width: Maximum width of a list that has `has-grid-layout` class. Defaults to `100%`.
* @prop --list-grid-item-max-width: Maximum width of items in a list that has `has-grid-layout` class. Defaults to `10rem`.
* @prop --list-grid-item-min-width: Minimum width of items in a list that has `has-grid-layout` class. Defaults to `7.5rem`.
* @prop --list-grid-gap: Distance between items in a list that has `has-grid-layout` class. Defaults to `0.75rem`.
* @prop --list-background-color-of-odd-interactive-items: Background color of odd list items, when `has-striped-rows` class is applied to the component. Defaults to `--contrast-200`.
* @prop --list-background-color-of-even-interactive-items: Background color of even list items, when `has-striped-rows` class is applied to the component. Defaults to `transparent`.
* @prop --list-margin: Space around the list. Defaults to `0.25rem`, which visualizes keyboard-focused items in a better way, as it adds some space for the outline effect.
* @prop --list-item-image-border-radius: Defines the border radius of the list item image. Defaults to `50%`.
*/
:host(limel-list) {
--limel-list-border-radius: 0.5rem;
display: block;
isolation: isolate;
}
:host([hidden]) {
display: none;
}
ul {
--mdc-theme-text-icon-on-background: var(
--icon-color,
rgb(var(--contrast-900))
);
margin: var(--list-margin, 0.25rem);
border-radius: var(--limel-list-border-radius);
padding: 0;
list-style: none;
}
.mdc-deprecated-list-divider {
border-bottom-color: transparent;
display: flex;
align-items: center;
gap: 0.75rem;
height: auto;
padding: 0 0.5rem;
}
.limel-list-divider-line {
background-color: rgb(var(--contrast-400));
height: 0.125rem;
border-radius: 1rem;
min-width: 1rem;
flex-grow: 1;
}
.limel-list-divider-title {
all: unset;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: rgb(var(--contrast-900));
font-size: var(--limel-theme-default-small-font-size);
}