@limetech/lime-elements
Version:
225 lines (217 loc) • 7.08 kB
CSS
@charset "UTF-8";
/**
* @prop --shortcut-border-radius: defines the radius of corners of the shortcut. Defaults to `1rem`
* @prop --shortcut-icon-color: defines the fill color of the shortcut icon. Defaults to `--contrast-1000`
* @prop --shortcut-label-color: defines the color of the shortcut label. Defaults to `--contrast-1100`
* @prop --shortcut-background-color: defines the backgrounds color of the shortcut icon. Defaults to `--lime-elevated-surface-background-color`
* @prop --shortcut-badge-text-color: Text color of the notification badge. Defaults to `--color-white`
* @prop --shortcut-badge-background-color: Background color of the notification badge. Defaults to `--color-red-default`
*/
/**
* 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(limel-shortcut) {
--badge-text-color: var(
--shortcut-badge-text-color,
rgb(var(--color-white))
);
--badge-background-color: var(
--shortcut-badge-background-color,
rgb(var(--color-red-default))
);
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
row-gap: 0.0625rem;
}
:host(limel-shortcut) * {
box-sizing: border-box;
}
:host(limel-shortcut[disabled]) a {
opacity: 0.5;
box-shadow: unset;
cursor: not-allowed;
}
a {
all: unset;
text-align: center;
height: calc(100% - 1rem);
width: calc(100% - 1rem);
padding: 0.5rem;
border-radius: var(--shortcut-border-radius, 1rem);
background-color: var(--shortcut-background-color, var(--lime-elevated-surface-background-color));
}
limel-icon {
display: flex;
height: 100%;
width: 100%;
justify-content: center;
color: var(--shortcut-icon-color, rgb(var(--contrast-1000)));
border-radius: var(--shortcut-border-radius, 1rem);
}
span {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 100%;
color: var(--shortcut-label-color, rgb(var(--contrast-1100)));
font-size: 0.75rem;
text-align: center;
}
limel-badge {
position: absolute;
top: -0.25rem;
right: 0.125rem;
}
limel-3d-hover-effect-glow {
border-radius: var(--shortcut-border-radius, 1rem);
}
:host(limel-shortcut) {
isolation: isolate;
transform-style: preserve-3d;
perspective: 1000px;
}
@media (prefers-reduced-motion) {
:host(limel-shortcut) {
perspective: 2000px;
}
}
a {
position: relative;
transition-duration: 0.8s;
transition-property: transform, box-shadow, background-color;
transition-timing-function: ease-out;
transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
}
a:focus {
outline: none;
}
a:hover, a:focus, a:focus-visible, a:focus-within {
will-change: background-color, box-shadow, transform;
}
a:hover, a:focus, a:focus-visible, a:active {
transition-duration: 0.2s;
}
a:hover, a:focus-visible {
box-shadow: var(--button-shadow-hovered), var(--shadow-depth-16);
}
a:hover {
transform: scale3d(1.01, 1.01, 1.01) rotate3d(var(--limel-3d-hover-effect-rotate3d));
}
a:focus-visible {
outline: none;
transform: scale3d(1.01, 1.01, 1.01);
}
a:hover limel-3d-hover-effect-glow {
--limel-3d-hover-effect-glow-opacity: 0.5;
}
@media (prefers-reduced-motion) {
a:hover limel-3d-hover-effect-glow {
--limel-3d-hover-effect-glow-opacity: 0.2;
}
}
a {
cursor: pointer;
box-shadow: var(--button-shadow-normal);
}
a:hover, a:focus-visible {
box-shadow: var(--button-shadow-hovered), var(--shadow-depth-16);
}
a:active {
transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
box-shadow: var(--button-shadow-pressed);
}
a:focus-visible {
box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-hovered);
}
a:focus-visible:active {
box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-pressed);
}