UNPKG

@limetech/lime-elements

Version:
428 lines (413 loc) 13.4 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! */ .limel-form-row--layout { --limel-form-row-border-radius: 0.375rem; --limel-form-row-icon-size: 1.75rem; --limel-form-row-main-information-gap: 0.5rem; display: flex; flex-direction: column; } .limel-form-row--layout .row { display: flex; gap: 0.5rem; flex-direction: column; padding: 0.5rem 1rem; } .limel-form-row--layout .row:nth-child(odd) { background-color: var(--form-background-color-of-odd-rows, rgb(var(--contrast-200))); } .limel-form-row--layout .row:nth-child(even) { background-color: var(--form-background-color-of-even-rows, transparent); } .limel-form-row--layout .row:first-child { border-radius: var(--limel-form-row-border-radius) var(--limel-form-row-border-radius) 0 0; } .limel-form-row--layout .row:last-child { border-radius: 0 0 var(--limel-form-row-border-radius) var(--limel-form-row-border-radius); } .limel-form-row--layout .main-information { position: relative; display: flex; flex-direction: row; align-items: center; gap: var(--limel-form-row-main-information-gap); min-width: 0; } .limel-form-row--layout .main-information { position: relative; } .limel-form-row--layout .main-information > .form-group.field { position: unset; } .limel-form-row--layout .main-information > .form-group.field limel-help { top: 0; } .limel-form-row--layout limel-icon { color: rgb(var(--contrast-1200)); width: var(--limel-form-row-icon-size); flex-shrink: 0; min-width: 0; } .limel-form-row--layout .title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: 0; font-weight: normal; flex-grow: 1; color: var(--limel-theme-on-surface-color); font-size: 0.875rem; } .limel-form-row--layout .description { margin: 0; color: var(--limel-theme-text-secondary-on-background-color); font-size: var(--limel-theme-default-small-font-size); line-height: 1.5; } .limel-form-row--layout .has-icon .description { padding-left: calc(var(--limel-form-row-icon-size) + var(--limel-form-row-main-information-gap)); } .limel-form-row--layout .form-group.field { flex-shrink: 0; display: flex; align-content: center; } .limel-form-row--layout .form-group.field limel-slider { min-width: 8rem; display: block; } /* * This file is imported into every component! * * Nothing in this file may output any CSS * without being explicitly called by outside code. */ /** * @prop --form-body-padding: space around content of the form. Defaults to `1rem`. * @prop --form-column-gap: defines the vertical space between elements of the form with `grid` and `default` layouts. Defaults to `1rem`. * @prop --form-row-gap: defines the horizontal space between elements of the form with `grid` and `default` layouts. Defaults to `1rem`. * @prop --form-gap: defines the space between elements of the form with `grid` and `default` layouts. Defaults to `1rem`. * @prop --form-background-color-of-even-rows: Background of even rows in the form, when layout type is `row`. Defaults to `transparent`. * @prop --form-background-color-of-odd-rows:Background of odd rows in the form, when layout type is `row`. Defaults to `--contrast-200`. */ *, *::after, *::before { box-sizing: border-box; } .form-group { min-width: 0; } .limel-form-array-item--simple { display: flex; align-items: center; padding: 0.25rem; } .limel-form-array-item--simple > *:first-child { flex: 1; min-width: 0; } .array-items { isolation: isolate; display: flex; flex-direction: column; row-gap: var(--form-row-gap, 0.5rem); margin-top: 1rem; } .array-items.has-an-item-which-is-being-dragged limel-collapsible-section { --limel-cs-grid-template-rows: 0fr; --limel-cs-opacity-transition-speed: 0.2s; --limel-cs-grid-template-rows-transition-speed: 0.2s; --limel-cs-open-header-bottom-border-radius: 0.75rem; } .array-item:has(limel-drag-handle:hover), .array-item:has(limel-drag-handle:focus-within), .array-item.is-elevated, .array-item.sortable-chosen { will-change: transform, box-shadow, border-radius, background-color; } .array-item.sortable-ghost { border-radius: 0.5rem; box-shadow: var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3); } .array-item.sortable-chosen { border-radius: 0.5rem; background-color: var(--lime-elevated-surface-background-color); } .array-item.is-elevated[draggable=false] { animation: sit-here 0.8s forwards; } @keyframes sit-here { 0% { border-radius: 0.5rem; background-color: var(--lime-elevated-surface-background-color); box-shadow: var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3); } 100% { box-shadow: none; } } limel-drag-handle { order: 10; } limel-collapsible-section.is-being-dragged { border-radius: 0.75rem !important; } .limel-form-layout--default { display: grid; column-gap: var(--form-column-gap, 1rem); row-gap: var(--form-row-gap, 1rem); padding: var(--form-body-padding, 1rem); } .limel-form-layout--grid { --min-height-of-one-row: 2.5rem; display: grid; column-gap: var(--form-column-gap, 1rem); row-gap: var(--form-row-gap, 1rem); padding: var(--form-body-padding, 1rem); grid-template-columns: repeat(var(--number-of-columns), minmax(0, 1fr)); } .limel-form-layout--grid.auto-reorder-to-avoid-empty-cells { grid-auto-flow: dense; } .limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--1, .limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--2, .limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--3, .limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--4, .limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--5 { grid-column: span 1; } .limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--1 { grid-column: span 1; } .limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--2, .limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--3, .limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--4, .limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--5 { grid-column: span 2; } .limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--1 { grid-column: span 1; } .limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--2 { grid-column: span 2; } .limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--3, .limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--4, .limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--5 { grid-column: span 3; } .limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--1 { grid-column: span 1; } .limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--2 { grid-column: span 2; } .limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--3 { grid-column: span 3; } .limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--4, .limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--5 { grid-column: span 4; } .limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--1 { grid-column: span 1; } .limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--2 { grid-column: span 2; } .limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--3 { grid-column: span 3; } .limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--4 { grid-column: span 4; } .limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--5 { grid-column: span 5; } .limel-form-layout--grid .limel-form-layout-colspan--all { grid-column: 1/-1; } .limel-form-layout--grid limel-checkbox, .limel-form-layout--grid limel-switch { min-height: var(--min-height-of-one-row); } .limel-form-layout--grid limel-checkbox { display: block; } .limel-form-layout--grid limel-switch { margin-left: 0.5rem; } .form-error { color: var(--limel-theme-error-color); font-size: 0.6875rem; line-height: 1.5; visibility: inherit; padding-right: 1rem; padding-left: 1rem; padding-top: 0.25rem; } .button-add-new { margin-top: 0.5rem; width: 100%; } h1 { position: relative; margin-top: 0; margin-bottom: 0; word-break: break-word; hyphens: auto; -webkit-hyphens: auto; text-wrap: balance; font-size: var(--limel-form-h1-font-size); line-height: calc(var(--limel-form-h1-font-size) * 1.42857); letter-spacing: -0.01rem; font-weight: 500; } limel-markdown { display: block; margin-bottom: 0.5rem; } .form-group { position: relative; } .form-group limel-help { position: absolute; top: calc(var(--form-row-gap, 1rem) * -0.5); left: calc(var(--form-column-gap, 1rem) * -0.5); } .form-group h1 { color: rgb(var(--contrast-1400), 0.8); } .form-group h1 { --limel-form-h1-font-size: 1.476rem; font-weight: 800; } .form-group .form-group h1 { --limel-form-h1-font-size: 1.383rem; font-weight: 700; } .form-group .form-group h1:before { content: ""; display: block; position: absolute; top: 0; bottom: 0; margin: auto; left: -0.75rem; background-color: var(--lime-primary-color, var(--limel-theme-primary-color)); width: 0.125rem; height: 1.5rem; border-radius: 0.125rem; opacity: 0.6; } .form-group .form-group .form-group h1 { --limel-form-h1-font-size: 1.296rem; font-weight: 600; } .form-group .form-group .form-group h1:before { display: none; } .form-group .form-group .form-group .form-group h1 { --limel-form-h1-font-size: 1.215rem; } .form-group .form-group .form-group .form-group h1:before { display: none; } .form-group .form-group .form-group .form-group .form-group h1 { --limel-form-h1-font-size: 1.138rem; } .form-group .form-group .form-group .form-group .form-group h1:before { display: none; } .form-group .form-group .form-group .form-group .form-group .form-group h1 { --limel-form-h1-font-size: 1.067rem; } .form-group .form-group .form-group .form-group .form-group .form-group h1:before { display: none; }