@limetech/lime-elements
Version:
252 lines (248 loc) • 10 kB
CSS
@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.
*/
/**
* @prop --limel-notched-outline-z-index: Defines the `z-index` of the outlines & the label, since they are absolutely positioned. Useful if there are other elements with z-indexes in the consumer.
*/
*,
*:before,
*:after {
box-sizing: border-box;
}
limel-notched-outline {
--limel-notched-outline-border-color: rgba(var(--contrast-700), 0.65);
--limel-notched-outline-background-color: rgba(var(--contrast-200), 0.5);
display: block;
width: 100%;
height: fit-content;
}
.limel-notched-outline {
position: relative;
width: 100%;
height: 100%;
}
.limel-notched-outline [slot=content] {
background-color: var(--limel-notched-outline-background-color);
border-radius: var(--limel-notched-outline-border-radius, 0.25rem);
}
.limel-notched-outline--outlines {
pointer-events: none;
position: absolute;
inset: 0;
z-index: var(--limel-notched-outline-z-index, 0);
display: flex;
}
.limel-notched-outline--leading-outline, .limel-notched-outline--notch, .limel-notched-outline--trailing-outline {
transition: border-color 0.2s ease;
border-width: 1px;
border-style: solid;
border-color: var(--limel-notched-outline-border-color);
}
.limel-notched-outline--leading-outline {
flex-shrink: 0;
width: 0.75rem;
border-right-width: 0;
border-top-left-radius: var(--limel-notched-outline-border-radius, 0.25rem);
border-bottom-left-radius: var(--limel-notched-outline-border-radius, 0.25rem);
}
.limel-notched-outline--notch {
flex-shrink: 0;
position: relative;
z-index: 2;
border-top-color: var(--limel-notched-outline-notch-border-top-color, var(--limel-notched-outline-border-color));
border-right-width: 0;
border-left-width: 0;
max-width: calc(100% - 1.5rem);
}
.limel-notched-outline--notch label {
all: unset;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: relative;
transition: color 0.2s ease, font-size 0.2s ease, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);
transform: translate3d(var(--limel-notched-outline-label-transform-x, 0), var(--limel-notched-outline-label-transform-y, 0.62rem), 0);
display: block;
padding: 0 0.25rem;
color: var(--limel-notched-outline-label-color, rgba(var(--contrast-1200), 1));
font-size: var(--limel-notched-outline-label-font-size, var(--limel-theme-default-font-size));
letter-spacing: var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);
line-height: normal;
}
.limel-notched-outline--notch label:after {
position: absolute;
right: 0;
padding: 0 0.25rem;
}
.limel-notched-outline--trailing-outline {
flex-grow: 1;
border-left-width: 0;
border-top-right-radius: var(--limel-notched-outline-border-radius, 0.25rem);
border-bottom-right-radius: var(--limel-notched-outline-border-radius, 0.25rem);
}
.limel-notched-outline--empty-readonly-value {
position: absolute;
top: 0.62rem;
left: 1rem;
}
.limel-notched-outline--empty-readonly-value .lime-looks-like-input-value {
line-height: 1.75rem;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
color: rgba(var(--contrast-1400), 1);
font-size: var(--limel-theme-default-font-size);
font-weight: 400;
font-family: inherit;
letter-spacing: 0.009375em;
}
.mdc-text-field--disabled .limel-notched-outline--empty-readonly-value .lime-looks-like-input-value {
cursor: not-allowed;
opacity: 0.4;
}
limel-notched-outline:not([disabled]:not([disabled=false])):hover {
--limel-notched-outline-border-color: rgba(var(--contrast-700), 1);
--limel-notched-outline-background-color: rgba(var(--contrast-200), 1);
}
limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-visible), limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-within) {
--limel-notched-outline-border-color: var(--lime-primary-color, var(--limel-theme-primary-color));
--limel-notched-outline-background-color: rgba(var(--contrast-100), 0.8);
}
limel-notched-outline[disabled]:not([disabled=false]) {
--limel-notched-outline-label-color: rgba(var(--contrast-1200), 0.5);
}
limel-notched-outline[required]:not([required=false]) .limel-notched-outline--notch label {
padding-right: 0.75rem;
}
limel-notched-outline[required]:not([required=false]) .limel-notched-outline--notch label:after {
content: "*";
scale: 1.3;
}
limel-notched-outline[invalid]:not([invalid=false]):not([disabled]:not([disabled=false])) {
--limel-notched-outline-border-color: var(
--limel-theme-error-text-color
);
}
limel-notched-outline[invalid]:not([invalid=false]):not([disabled]:not([disabled=false])):hover {
--limel-notched-outline-border-color: var(
--limel-theme-error-color
);
}
limel-notched-outline[invalid]:not([invalid=false]) .limel-notched-outline--notch label:after {
color: var(--limel-theme-error-text-color);
}
limel-notched-outline[readonly]:not([readonly=false]) {
--limel-notched-outline-border-color: transparent ;
--limel-notched-outline-background-color: transparent ;
}
limel-notched-outline[readonly]:not([readonly=false]) .limel-notched-outline--notch label {
transition-duration: 0s;
}
limel-notched-outline[has-leading-icon]:not([has-leading-icon=false]):not([has-floating-label]):not([has-value]) {
--limel-notched-outline-label-transform-x: 1.25rem;
}
limel-notched-outline[has-leading-icon] .limel-notched-outline--empty-readonly-value {
left: 2.25rem;
}
limel-notched-outline:not([disabled]:not([disabled=false])):hover label, limel-notched-outline:not([disabled]:not([disabled=false])):focus label, limel-notched-outline:not([disabled]:not([disabled=false])):focus-within label {
will-change: color, transform, font-size;
}
limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-visible), limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-within) {
--limel-notched-outline-label-font-size: 0.65rem;
--limel-notched-outline-label-transform-x: 0;
--limel-notched-outline-label-transform-y: calc(-50% - 0.09375rem);
--limel-notched-outline-notch-border-top-color: transparent;
}
limel-notched-outline[has-floating-label], limel-notched-outline[has-value]:not([has-value=false]), limel-notched-outline[readonly]:not([has-value]:not([has-value=true])) {
--limel-notched-outline-label-font-size: 0.65rem;
--limel-notched-outline-label-transform-x: 0;
--limel-notched-outline-label-transform-y: calc(-50% - 0.09375rem);
--limel-notched-outline-notch-border-top-color: transparent;
}