@limetech/lime-elements
Version:
245 lines (232 loc) • 8.55 kB
CSS
@charset "UTF-8";
/*
* This file is imported into every component!
*
* Nothing in this file may output any CSS
* without being explicitly called by outside code.
*/
/**
* 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 --text-editor-max-height: the tallest height the text editor can become when auto-resizing itself. Defaults to `calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem)`.
* @prop --text-editor-fade-out-background-color: the color of the fade-out effect at the top and bottom of the text editor, when the text-editor is in readonly state. Defaults to rgb(var(--contrast-100)).
*/
* {
box-sizing: border-box;
}
:host(limel-text-editor) {
--limel-notched-outline-z-index: 2;
--limel-prosemirror-adapter-toolbar-opacity: 0.6;
--limel-text-editor-padding: 0.25rem 1rem 0.75rem 1rem;
--limel-prosemirror-adapter-toolbar-grid-template-rows: 1fr;
--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration: 0.3s;
--limel-prosemirror-adapter-toolbar-transition-timing-function: cubic-bezier(
0.19,
0.23,
0.26,
0.89
);
position: relative;
isolation: isolate;
display: flex;
flex-direction: column;
width: 100%;
min-width: 5rem;
min-height: 5rem;
height: 100%;
max-height: var(--text-editor-max-height, calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem));
padding: 1px;
}
:host(limel-text-editor) limel-notched-outline {
height: 100%;
}
:host(limel-text-editor:focus-within),
:host(limel-text-editor:not([ui=minimal]):hover) {
--limel-prosemirror-adapter-toolbar-opacity: 1;
}
:host(limel-text-editor[ui=minimal]:not(:focus-within)) {
--limel-prosemirror-adapter-toolbar-grid-template-rows: 0fr;
--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration: 0.46s;
--limel-prosemirror-adapter-action-bar-padding-top-bottom: 0;
--limel-prosemirror-adapter-toolbar-opacity: 0;
}
:host(limel-text-editor[ui=minimal]:not(:focus-within)),
:host(limel-text-editor[ui=no-toolbar]) {
--limel-text-editor-padding: 0.75rem 1rem 0.75rem 1rem;
--limel-text-editor-placeholder-top: 0;
min-height: 2.5rem;
}
:host(limel-text-editor[ui=minimal]:not(:focus-within)) limel-prosemirror-adapter,
:host(limel-text-editor[ui=no-toolbar]) limel-prosemirror-adapter {
min-height: 2.5rem;
}
:host(limel-text-editor:focus-within) .placeholder,
:host(limel-text-editor:focus) .placeholder {
opacity: 0;
}
:host(limel-text-editor[disabled]:not([disabled=false])) limel-prosemirror-adapter {
cursor: not-allowed;
opacity: 0.4;
pointer-events: none;
}
:host(limel-text-editor[readonly]:not([readonly=false])) {
--limel-text-editor-padding: 0.75rem 1rem 0.75rem 1rem;
--limel-text-editor-placeholder-top: 0;
}
:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown {
display: block;
padding: var(--limel-text-editor-padding);
overflow-y: auto;
-webkit-overflow-scrolling: touch;
height: 100%;
}
:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before, :host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after {
z-index: 1;
pointer-events: none;
content: "";
display: block;
position: absolute;
width: 100%;
}
:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after {
height: 1.75rem;
top: 0;
background: linear-gradient(var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))), transparent);
}
:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before {
height: 2rem;
bottom: -0.25rem;
background: linear-gradient(transparent, var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))));
}
.placeholder {
transition-property: top;
transition-duration: var(--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration);
transition-timing-function: var(--limel-prosemirror-adapter-toolbar-transition-timing-function);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
pointer-events: none;
position: absolute;
top: var(--limel-text-editor-placeholder-top, 2.25rem);
left: 0;
right: 0;
padding: var(--limel-text-editor-padding);
font-style: italic;
font-size: var(--limel-theme-default-font-size);
color: rgb(var(--contrast-900));
}
limel-prosemirror-adapter {
flex-grow: 1;
min-width: 0;
min-height: 5rem;
height: 100%;
max-height: 100%;
overflow: hidden auto;
-webkit-overflow-scrolling: touch;
}
:host(limel-text-editor:focus),
:host(limel-text-editor:focus-visible),
:host(limel-text-editor:focus-within) {
--limel-h-l-grid-template-rows-transition-speed: 0.46s;
--limel-h-l-grid-template-rows: 1fr;
}
:host(limel-text-editor) {
--limel-h-l-grid-template-rows-transition-speed: 0.3s;
--limel-h-l-grid-template-rows: 0fr;
}
:host(limel-text-editor:focus) limel-helper-line,
:host(limel-text-editor:focus-visible) limel-helper-line,
:host(limel-text-editor:focus-within) limel-helper-line,
:host(limel-text-editor:hover) limel-helper-line {
will-change: grid-template-rows;
}
:host(limel-text-editor[allow-resize]) limel-prosemirror-adapter {
resize: vertical;
}