@limetech/lime-elements 39.8.1 → 39.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +7 -5
- package/dist/collection/components/action-bar/action-bar.css +7 -5
- package/dist/collection/components/badge/badge.css +7 -5
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +7 -5
- package/dist/collection/components/button/button.css +7 -5
- package/dist/collection/components/button-group/button-group.css +7 -5
- package/dist/collection/components/card/card.css +7 -5
- package/dist/collection/components/chart/chart.css +7 -5
- package/dist/collection/components/checkbox/checkbox.css +7 -5
- package/dist/collection/components/chip/chip.css +7 -5
- package/dist/collection/components/chip-set/chip-set.css +7 -5
- package/dist/collection/components/circular-progress/circular-progress.css +7 -5
- package/dist/collection/components/code-diff/code-diff.css +7 -5
- package/dist/collection/components/code-editor/code-editor.css +7 -5
- package/dist/collection/components/collapsible-section/collapsible-section.css +7 -5
- package/dist/collection/components/color-picker/color-picker-palette.css +7 -5
- package/dist/collection/components/color-picker/color-picker.css +7 -5
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +7 -5
- package/dist/collection/components/dialog/dialog.css +7 -5
- package/dist/collection/components/dock/dock-button/dock-button.css +7 -5
- package/dist/collection/components/dock/dock.css +7 -5
- package/dist/collection/components/drag-handle/drag-handle.css +7 -5
- package/dist/collection/components/email-viewer/email-viewer.css +7 -5
- package/dist/collection/components/file/file.css +7 -5
- package/dist/collection/components/file-viewer/file-viewer.css +7 -5
- package/dist/collection/components/form/form.css +7 -5
- package/dist/collection/components/header/header.css +7 -5
- package/dist/collection/components/help/help.css +7 -5
- package/dist/collection/components/help/limel-help-content.css +7 -5
- package/dist/collection/components/icon-button/icon-button.css +7 -5
- package/dist/collection/components/info-tile/info-tile.css +7 -5
- package/dist/collection/components/input-field/input-field.css +7 -5
- package/dist/collection/components/list/list.css +7 -5
- package/dist/collection/components/list-item/list-item.css +7 -5
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.css +7 -5
- package/dist/collection/components/markdown/markdown.css +7 -5
- package/dist/collection/components/menu-list/menu-list.css +7 -5
- package/dist/collection/components/notched-outline/notched-outline.css +7 -5
- package/dist/collection/components/popover-surface/popover-surface.css +7 -5
- package/dist/collection/components/profile-picture/profile-picture.css +7 -5
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +7 -5
- package/dist/collection/components/radio-button-group/radio-button.css +7 -5
- package/dist/collection/components/select/select.css +7 -5
- package/dist/collection/components/shortcut/shortcut.css +7 -5
- package/dist/collection/components/slider/slider.css +7 -5
- package/dist/collection/components/split-button/split-button.css +7 -5
- package/dist/collection/components/switch/switch.css +7 -5
- package/dist/collection/components/tab-bar/tab-bar.css +7 -5
- package/dist/collection/components/table/table.css +7 -5
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.css +7 -5
- package/dist/collection/components/text-editor/text-editor.css +7 -5
- package/dist/collection/scss/mixins.scss +7 -5
- package/dist/collection/style/exports.scss +12 -0
- package/dist/collection/style/mixins.scss +7 -5
- package/dist/lime-elements/scss/mixins.scss +7 -5
- package/dist/lime-elements/style/exports.scss +12 -0
- package/dist/lime-elements/style/mixins.scss +7 -5
- package/dist/scss/mixins.scss +724 -0
- package/index.scss +9 -0
- package/package.json +3 -1
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note! This file is forwarded via `src/style/exports.scss`
|
|
3
|
+
* and exposed to consumers through the root `index.scss`.
|
|
4
|
+
*
|
|
5
|
+
* Consumers import it using:
|
|
6
|
+
* `@use '@limetech/lime-elements' as lime-elements;`
|
|
7
|
+
*
|
|
8
|
+
* Legacy import paths (`dist/scss/mixins`) are maintained
|
|
9
|
+
* for backward compatibility via copy rules in the Stencil config.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
@mixin visualize-keyboard-focus {
|
|
13
|
+
&:focus {
|
|
14
|
+
outline: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:focus-visible {
|
|
18
|
+
outline: none;
|
|
19
|
+
box-shadow: var(--shadow-depth-8-focused);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
@mixin visualize-aria-expanded($trigger-element) {
|
|
28
|
+
:host([aria-expanded='true']),
|
|
29
|
+
:host([aria-expanded]:not([aria-expanded='false'])) {
|
|
30
|
+
#{$trigger-element} {
|
|
31
|
+
box-shadow: var(--button-shadow-inset-pressed) !important;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@mixin in($media) {
|
|
37
|
+
// ⛔️ As long as we don't have a script that generates a
|
|
38
|
+
// `.css` files automatically, we cannot use this mixin.
|
|
39
|
+
// we need to manually write the dark-mode CSS variables
|
|
40
|
+
// inside this file: /style/color-palette-extended.css
|
|
41
|
+
//
|
|
42
|
+
// ⚠️ Also note that this mixin only puts styles
|
|
43
|
+
// on the `:root` which means the `<html` level.
|
|
44
|
+
// Therefore, it cannot be used inside components
|
|
45
|
+
// to generate custom dark-mode styles.
|
|
46
|
+
|
|
47
|
+
@if $media == dark-mode {
|
|
48
|
+
@media (prefers-color-scheme: dark) {
|
|
49
|
+
:root:not([data-theme='force-light']) {
|
|
50
|
+
@content;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
:root[data-theme='force-dark'] {
|
|
54
|
+
@content;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// @media (prefers-color-scheme: dark) {
|
|
58
|
+
// :host(:not([data-theme='force-light'])) & {
|
|
59
|
+
// @content;
|
|
60
|
+
// }
|
|
61
|
+
// }
|
|
62
|
+
// :host([data-theme='force-dark']) & {
|
|
63
|
+
// @content;
|
|
64
|
+
// }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
$clickable-normal-state-transitions: (
|
|
69
|
+
color var(--limel-clickable-transition-speed, 0.4s) ease,
|
|
70
|
+
background-color var(--limel-clickable-transition-speed, 0.4s) ease,
|
|
71
|
+
box-shadow var(--limel-clickable-transform-speed, 0.4s) ease,
|
|
72
|
+
transform var(--limel-clickable-transform-speed, 0.4s)
|
|
73
|
+
var(--limel-clickable-transform-timing-function, ease)
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
@mixin is-elevated-clickable(
|
|
77
|
+
$color: var(--limel-theme-on-surface-color),
|
|
78
|
+
$color--hovered: var(--limel-theme-on-surface-color),
|
|
79
|
+
$background-color: var(--lime-elevated-surface-background-color),
|
|
80
|
+
$background-color--hovered: var(--lime-elevated-surface-background-color)
|
|
81
|
+
) {
|
|
82
|
+
transition: $clickable-normal-state-transitions;
|
|
83
|
+
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
color: $color;
|
|
86
|
+
background-color: $background-color;
|
|
87
|
+
box-shadow: var(--button-shadow-normal);
|
|
88
|
+
|
|
89
|
+
&:hover,
|
|
90
|
+
&:focus,
|
|
91
|
+
&:focus-visible {
|
|
92
|
+
will-change: color, background-color, box-shadow, transform;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:hover,
|
|
96
|
+
&:focus-visible {
|
|
97
|
+
transform: translate3d(0, -0.04rem, 0);
|
|
98
|
+
color: $color--hovered;
|
|
99
|
+
background-color: $background-color--hovered;
|
|
100
|
+
box-shadow: var(--button-shadow-hovered);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:active {
|
|
104
|
+
--limel-clickable-transform-timing-function: cubic-bezier(
|
|
105
|
+
0.83,
|
|
106
|
+
-0.15,
|
|
107
|
+
0.49,
|
|
108
|
+
1.16
|
|
109
|
+
);
|
|
110
|
+
transform: translate3d(0, 0.05rem, 0);
|
|
111
|
+
box-shadow: var(--button-shadow-pressed);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:hover,
|
|
115
|
+
&:active {
|
|
116
|
+
--limel-clickable-transition-speed: 0.2s;
|
|
117
|
+
--limel-clickable-transform-speed: 0.16s;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@mixin is-elevated-inset-clickable(
|
|
122
|
+
$color: var(--limel-theme-on-surface-color),
|
|
123
|
+
$color--hovered: var(--limel-theme-on-surface-color),
|
|
124
|
+
$background-color: var(--lime-elevated-surface-background-color),
|
|
125
|
+
$background-color--hovered: var(--lime-elevated-surface-background-color),
|
|
126
|
+
$background-color--inset: var(--limel-theme-surface-background-color)
|
|
127
|
+
) {
|
|
128
|
+
transition: $clickable-normal-state-transitions;
|
|
129
|
+
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
color: $color;
|
|
132
|
+
background-color: $background-color;
|
|
133
|
+
box-shadow: var(--button-shadow-normal);
|
|
134
|
+
|
|
135
|
+
&:hover,
|
|
136
|
+
&:focus,
|
|
137
|
+
&:focus-visible {
|
|
138
|
+
will-change: color, background-color, box-shadow, transform;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&:hover,
|
|
142
|
+
&:focus-visible {
|
|
143
|
+
transform: translate3d(0, 0.01rem, 0);
|
|
144
|
+
color: $color--hovered;
|
|
145
|
+
background-color: $background-color--hovered;
|
|
146
|
+
}
|
|
147
|
+
&:hover {
|
|
148
|
+
box-shadow: var(--button-shadow-hovered);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&:active {
|
|
152
|
+
--limel-clickable-transform-timing-function: cubic-bezier(
|
|
153
|
+
0.83,
|
|
154
|
+
-0.15,
|
|
155
|
+
0.49,
|
|
156
|
+
1.16
|
|
157
|
+
);
|
|
158
|
+
transform: translate3d(0, 0.05rem, 0);
|
|
159
|
+
background-color: $background-color--inset;
|
|
160
|
+
box-shadow: var(--button-shadow-inset-pressed);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&:hover,
|
|
164
|
+
&:active {
|
|
165
|
+
--limel-clickable-transition-speed: 0.2s;
|
|
166
|
+
--limel-clickable-transform-speed: 0.16s;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@mixin is-flat-clickable(
|
|
171
|
+
$color: var(--limel-theme-on-surface-color),
|
|
172
|
+
$background-color: transparent,
|
|
173
|
+
$color--hovered: var(--limel-theme-on-surface-color),
|
|
174
|
+
$background-color--hovered: var(--lime-elevated-surface-background-color)
|
|
175
|
+
) {
|
|
176
|
+
transition: $clickable-normal-state-transitions;
|
|
177
|
+
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
color: $color;
|
|
180
|
+
background-color: $background-color;
|
|
181
|
+
|
|
182
|
+
&:hover,
|
|
183
|
+
&:focus,
|
|
184
|
+
&:focus-visible {
|
|
185
|
+
will-change: color, background-color, box-shadow, transform;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&:hover,
|
|
189
|
+
&:focus-visible {
|
|
190
|
+
transform: translate3d(0, 0.01rem, 0);
|
|
191
|
+
color: $color--hovered;
|
|
192
|
+
background-color: $background-color--hovered;
|
|
193
|
+
}
|
|
194
|
+
&:hover {
|
|
195
|
+
box-shadow: var(--button-shadow-hovered);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&:active {
|
|
199
|
+
--limel-clickable-transform-timing-function: cubic-bezier(
|
|
200
|
+
0.83,
|
|
201
|
+
-0.15,
|
|
202
|
+
0.49,
|
|
203
|
+
1.16
|
|
204
|
+
);
|
|
205
|
+
transform: translate3d(0, 0.05rem, 0);
|
|
206
|
+
box-shadow: var(--button-shadow-pressed);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&:hover,
|
|
210
|
+
&:active {
|
|
211
|
+
--limel-clickable-transition-speed: 0.2s;
|
|
212
|
+
--limel-clickable-transform-speed: 0.16s;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@mixin is-flat-inset-clickable(
|
|
217
|
+
$color: var(--limel-theme-on-surface-color),
|
|
218
|
+
$background-color: transparent,
|
|
219
|
+
$color--hovered: var(--limel-theme-on-surface-color),
|
|
220
|
+
$background-color--hovered: var(--lime-elevated-surface-background-color),
|
|
221
|
+
$background-color--inset: var(--limel-theme-surface-background-color)
|
|
222
|
+
) {
|
|
223
|
+
transition: $clickable-normal-state-transitions;
|
|
224
|
+
|
|
225
|
+
cursor: pointer;
|
|
226
|
+
color: $color;
|
|
227
|
+
background-color: $background-color;
|
|
228
|
+
|
|
229
|
+
&:hover,
|
|
230
|
+
&:focus,
|
|
231
|
+
&:focus-visible {
|
|
232
|
+
will-change: color, background-color, box-shadow, transform;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&:hover,
|
|
236
|
+
&:focus-visible {
|
|
237
|
+
transform: translate3d(0, -0.04rem, 0);
|
|
238
|
+
color: $color--hovered;
|
|
239
|
+
background-color: $background-color--hovered;
|
|
240
|
+
}
|
|
241
|
+
&:hover {
|
|
242
|
+
box-shadow: var(--button-shadow-hovered);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&:active {
|
|
246
|
+
--limel-clickable-transform-timing-function: cubic-bezier(
|
|
247
|
+
0.83,
|
|
248
|
+
-0.15,
|
|
249
|
+
0.49,
|
|
250
|
+
1.16
|
|
251
|
+
);
|
|
252
|
+
transform: translate3d(0, 0.05rem, 0);
|
|
253
|
+
background-color: $background-color--inset;
|
|
254
|
+
box-shadow: var(--button-shadow-inset-pressed);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&:hover,
|
|
258
|
+
&:active {
|
|
259
|
+
--limel-clickable-transition-speed: 0.2s;
|
|
260
|
+
--limel-clickable-transform-speed: 0.16s;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@mixin clear-all-button() {
|
|
265
|
+
// NOTE: you may need to specify "position: absolute" and align the position where you use this mixin
|
|
266
|
+
@include is-flat-clickable(
|
|
267
|
+
$background-color: rgb(var(--contrast-900)),
|
|
268
|
+
$color--hovered: rgb(var(--color-white)),
|
|
269
|
+
$background-color--hovered: rgb(var(--color-red-default))
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
cursor: pointer;
|
|
273
|
+
|
|
274
|
+
height: 1.25rem;
|
|
275
|
+
width: 1.25rem;
|
|
276
|
+
border-radius: 50%;
|
|
277
|
+
|
|
278
|
+
background: {
|
|
279
|
+
repeat: no-repeat;
|
|
280
|
+
position: center;
|
|
281
|
+
size: 0.75rem;
|
|
282
|
+
image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3E%3Cdefs/%3E%3Cpath%20fill='rgb(255,255,255)'%20d='M7.219%205.781L5.78%207.22%2014.563%2016%205.78%2024.781%207.22%2026.22%2016%2017.437l8.781%208.782%201.438-1.438L17.437%2016l8.782-8.781L24.78%205.78%2016%2014.563z'/%3E%3C/svg%3E");
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@mixin truncate-text() {
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
white-space: nowrap;
|
|
289
|
+
text-overflow: ellipsis;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* This mixin will mask out the content that is close to
|
|
294
|
+
* the edges of a scrollable area.
|
|
295
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
296
|
+
* as an argument for `$direction`.
|
|
297
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
298
|
+
* as an argument for `$direction`.
|
|
299
|
+
*
|
|
300
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
301
|
+
* the size of the fade-out edge effect is the same as the
|
|
302
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
303
|
+
* scrollable area that does not have a padding will fade out before
|
|
304
|
+
* any scrolling has been done.
|
|
305
|
+
* This is why this mixin already adds paddings, which automatically
|
|
306
|
+
* default to the size of the fade-out effect.
|
|
307
|
+
* This size defaults to `1rem`, but to override the size use
|
|
308
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
309
|
+
* when `vertically` argument is set, and use
|
|
310
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
311
|
+
* when `horizontally` argument is set.
|
|
312
|
+
* Of course you can also programmatically increase and decrease the
|
|
313
|
+
* size of these variables for each edge, based on the amount of
|
|
314
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
315
|
+
* to add a custom padding where the mixin is used, to override
|
|
316
|
+
* the paddings that are automatically added by the mixin in the
|
|
317
|
+
* compiled CSS code.
|
|
318
|
+
*/
|
|
319
|
+
@mixin fade-out-overflowed-content-on-edges($direction) {
|
|
320
|
+
@if $direction == vertically {
|
|
321
|
+
--limel-overflow-mask-vertical: linear-gradient(
|
|
322
|
+
to bottom,
|
|
323
|
+
transparent 0%,
|
|
324
|
+
black calc(0% + var(--limel-top-edge-fade-height, 1rem)),
|
|
325
|
+
black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)),
|
|
326
|
+
transparent 100%
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
-webkit-mask-image: var(--limel-overflow-mask-vertical);
|
|
330
|
+
mask-image: var(--limel-overflow-mask-vertical);
|
|
331
|
+
|
|
332
|
+
padding-top: var(--limel-top-edge-fade-height, 1rem);
|
|
333
|
+
padding-bottom: var(--limel-bottom-edge-fade-height, 1rem);
|
|
334
|
+
} @else if $direction == horizontally {
|
|
335
|
+
--limel-overflow-mask-horizontal: linear-gradient(
|
|
336
|
+
to right,
|
|
337
|
+
transparent 0%,
|
|
338
|
+
black calc(0% + var(--limel-left-edge-fade-width, 1rem)),
|
|
339
|
+
black calc(100% - var(--limel-right-edge-fade-width, 1rem)),
|
|
340
|
+
transparent 100%
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
-webkit-mask-image: var(--limel-overflow-mask-horizontal);
|
|
344
|
+
mask-image: var(--limel-overflow-mask-horizontal);
|
|
345
|
+
|
|
346
|
+
padding-left: var(--limel-left-edge-fade-width, 1rem);
|
|
347
|
+
padding-right: var(--limel-right-edge-fade-width, 1rem);
|
|
348
|
+
} @else {
|
|
349
|
+
@error "Please specify the direction #{$direction}!";
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@mixin hide-helper-line-when-not-needed($component-tag) {
|
|
354
|
+
// This is when:
|
|
355
|
+
// - the component is not focused, or
|
|
356
|
+
// - an interactive element within the component is not focused, or
|
|
357
|
+
// - the component is valid
|
|
358
|
+
|
|
359
|
+
:host(#{$component-tag}:focus),
|
|
360
|
+
:host(#{$component-tag}:focus-visible),
|
|
361
|
+
:host(#{$component-tag}:focus-within) {
|
|
362
|
+
--limel-h-l-grid-template-rows-transition-speed: 0.46s;
|
|
363
|
+
--limel-h-l-grid-template-rows: 1fr;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
:host(#{$component-tag}) {
|
|
367
|
+
--limel-h-l-grid-template-rows-transition-speed: 0.3s;
|
|
368
|
+
--limel-h-l-grid-template-rows: 0fr;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
:host(#{$component-tag}:focus),
|
|
372
|
+
:host(#{$component-tag}:focus-visible),
|
|
373
|
+
:host(#{$component-tag}:focus-within),
|
|
374
|
+
:host(#{$component-tag}:hover) {
|
|
375
|
+
limel-helper-line {
|
|
376
|
+
will-change: grid-template-rows;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* This mixin will add an animated underline to the bottom of an `a` elements.
|
|
383
|
+
* Note that you may need to add `all: unset;` –depending on your use case–
|
|
384
|
+
* before using this mixin.
|
|
385
|
+
*/
|
|
386
|
+
@mixin hyperlink(
|
|
387
|
+
$color: rgb(var(--color-blue-default)),
|
|
388
|
+
$color--hovered: rgb(var(--color-blue-default))
|
|
389
|
+
) {
|
|
390
|
+
position: relative;
|
|
391
|
+
cursor: pointer;
|
|
392
|
+
transition: color 0.2s ease;
|
|
393
|
+
color: $color;
|
|
394
|
+
|
|
395
|
+
&:before {
|
|
396
|
+
transition:
|
|
397
|
+
opacity 0.2s ease,
|
|
398
|
+
transform 0.3s ease-out;
|
|
399
|
+
content: '';
|
|
400
|
+
position: absolute;
|
|
401
|
+
inset: auto 0 0 0;
|
|
402
|
+
width: calc(100% - 0.5rem);
|
|
403
|
+
margin: auto;
|
|
404
|
+
height: 0.125rem;
|
|
405
|
+
border-radius: 1rem;
|
|
406
|
+
|
|
407
|
+
background-color: currentColor;
|
|
408
|
+
opacity: 0;
|
|
409
|
+
transform: scale(0.6);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
&:hover {
|
|
413
|
+
color: $color--hovered;
|
|
414
|
+
&:before {
|
|
415
|
+
opacity: 0.3;
|
|
416
|
+
transform: scale(1);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* This mixin creates a cross-browser font stack.
|
|
423
|
+
* - `sans-serif` can be used for the UI of the components.
|
|
424
|
+
* - `monospace` can be used for code.
|
|
425
|
+
*
|
|
426
|
+
* ⚠️ If we change the font stacks, we need to update
|
|
427
|
+
* 1. the consumer documentation in `README.md`, and
|
|
428
|
+
* 2. the CSS variables of `--kompendium-example-font-family`
|
|
429
|
+
* in the `<style>` tag of `index.html`.
|
|
430
|
+
*/
|
|
431
|
+
@mixin font-family($letterform) {
|
|
432
|
+
@if $letterform == sans-serif {
|
|
433
|
+
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
434
|
+
} @else if $letterform == monospace {
|
|
435
|
+
font-family:
|
|
436
|
+
ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas,
|
|
437
|
+
'DejaVu Sans Mono', monospace;
|
|
438
|
+
} @else {
|
|
439
|
+
@error "Please specify the font-family #{$letterform}!";
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* This mixin is a hack, using old CSS syntax
|
|
445
|
+
* to enable you to truncate a piece of text,
|
|
446
|
+
* after a certain number of lines.
|
|
447
|
+
*/
|
|
448
|
+
@mixin truncate-text-on-line($max-lines) {
|
|
449
|
+
display: -webkit-box;
|
|
450
|
+
overflow: hidden;
|
|
451
|
+
white-space: normal;
|
|
452
|
+
-webkit-box-orient: vertical;
|
|
453
|
+
-webkit-line-clamp: $max-lines;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* This mixin will add a chessboard background pattern,
|
|
458
|
+
* typically used to visualize transparency.
|
|
459
|
+
*/
|
|
460
|
+
@mixin add-chessboard-background {
|
|
461
|
+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%208%208'%20style='fill-rule:evenodd;'%3E%3Cpath%20fill='rgba(186,186,192,0.16)'%20d='M0%200h4v4H0zM4%204h4v4H4z'/%3E%3C/svg%3E");
|
|
462
|
+
background-size: 0.5rem;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Make a container resizable by the user.
|
|
467
|
+
* This is used in the documentations and examples
|
|
468
|
+
* of some components, to demonstrate how the component
|
|
469
|
+
* behaves in a resizable container.
|
|
470
|
+
*/
|
|
471
|
+
@mixin is-resizable(
|
|
472
|
+
$direction: both,
|
|
473
|
+
// can be `horizontal`, `vertical`, or `both`
|
|
474
|
+
$width: 100%,
|
|
475
|
+
$min-width: 10rem,
|
|
476
|
+
$max-width: 100%,
|
|
477
|
+
$height: 100%,
|
|
478
|
+
$min-height: 5rem,
|
|
479
|
+
$max-height: 50rem
|
|
480
|
+
) {
|
|
481
|
+
box-sizing: border-box;
|
|
482
|
+
position: relative;
|
|
483
|
+
|
|
484
|
+
border: 1px dashed rgb(var(--contrast-700));
|
|
485
|
+
padding: 0.75rem;
|
|
486
|
+
padding-bottom: 2rem;
|
|
487
|
+
|
|
488
|
+
resize: $direction;
|
|
489
|
+
overflow: auto;
|
|
490
|
+
|
|
491
|
+
min-width: $min-width;
|
|
492
|
+
width: $width;
|
|
493
|
+
max-width: $max-width;
|
|
494
|
+
|
|
495
|
+
min-height: $min-height;
|
|
496
|
+
height: $height;
|
|
497
|
+
max-height: $max-height;
|
|
498
|
+
|
|
499
|
+
border-radius: 0.5rem;
|
|
500
|
+
|
|
501
|
+
&::after {
|
|
502
|
+
content: 'Resize me ⤵';
|
|
503
|
+
font-size: 0.75rem;
|
|
504
|
+
position: absolute;
|
|
505
|
+
right: 0.25rem;
|
|
506
|
+
bottom: 0.25rem;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// Hide element visually while keeping it accessible to assistive technologies
|
|
511
|
+
// See: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
|
|
512
|
+
// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
|
|
513
|
+
@mixin visually-hidden {
|
|
514
|
+
position: absolute;
|
|
515
|
+
width: 0;
|
|
516
|
+
height: 0;
|
|
517
|
+
margin: -1px;
|
|
518
|
+
padding: 0;
|
|
519
|
+
border: 0;
|
|
520
|
+
overflow: hidden;
|
|
521
|
+
clip: rect(0, 0, 0, 0);
|
|
522
|
+
clip-path: inset(50%);
|
|
523
|
+
white-space: nowrap;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// These mixins below are designed to apply the necessary visual effects,
|
|
527
|
+
// when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
|
|
528
|
+
// is implemented in a component.
|
|
529
|
+
@mixin parent-of-the-3d-element {
|
|
530
|
+
isolation: isolate;
|
|
531
|
+
transform-style: preserve-3d;
|
|
532
|
+
|
|
533
|
+
perspective: 1000px;
|
|
534
|
+
@media (prefers-reduced-motion) {
|
|
535
|
+
perspective: 2000px;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
@mixin the-3d-element {
|
|
540
|
+
position: relative;
|
|
541
|
+
|
|
542
|
+
transition-duration: 0.8s;
|
|
543
|
+
transition-property: transform, box-shadow, background-color;
|
|
544
|
+
transition-timing-function: ease-out;
|
|
545
|
+
transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
|
|
546
|
+
|
|
547
|
+
&:focus {
|
|
548
|
+
outline: none;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
&:hover,
|
|
552
|
+
&:focus,
|
|
553
|
+
&:focus-visible,
|
|
554
|
+
&:focus-within {
|
|
555
|
+
will-change: background-color, box-shadow, transform;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
&:hover,
|
|
559
|
+
&:focus,
|
|
560
|
+
&:focus-visible,
|
|
561
|
+
&:active {
|
|
562
|
+
transition-duration: 0.2s;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
&:hover,
|
|
566
|
+
&:focus-visible {
|
|
567
|
+
box-shadow: var(--button-shadow-hovered), var(--shadow-depth-16);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
&:hover {
|
|
571
|
+
transform: scale3d(1.01, 1.01, 1.01)
|
|
572
|
+
rotate3d(var(--limel-3d-hover-effect-rotate3d));
|
|
573
|
+
}
|
|
574
|
+
&:focus-visible {
|
|
575
|
+
outline: none;
|
|
576
|
+
transform: scale3d(1.01, 1.01, 1.01);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
&:hover {
|
|
580
|
+
limel-3d-hover-effect-glow {
|
|
581
|
+
--limel-3d-hover-effect-glow-opacity: 0.5;
|
|
582
|
+
@media (prefers-reduced-motion) {
|
|
583
|
+
--limel-3d-hover-effect-glow-opacity: 0.2;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
@mixin the-3d-element--clickable {
|
|
590
|
+
cursor: pointer;
|
|
591
|
+
box-shadow: var(--button-shadow-normal);
|
|
592
|
+
|
|
593
|
+
&:hover,
|
|
594
|
+
&:focus-visible {
|
|
595
|
+
// seems repetitive. But it's required for some scenarios, like for info tiles.
|
|
596
|
+
box-shadow: var(--button-shadow-hovered), var(--shadow-depth-16);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
&:active {
|
|
600
|
+
transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
|
|
601
|
+
box-shadow: var(--button-shadow-pressed);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
&:focus-visible {
|
|
605
|
+
box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-hovered);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
&:focus-visible:active {
|
|
609
|
+
box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-pressed);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Drag to reorder mixins
|
|
615
|
+
*/
|
|
616
|
+
@mixin is-draggable-item(
|
|
617
|
+
$border-radius-while-being-dragged: 0.5rem,
|
|
618
|
+
$transform-scale-while-being-dragged: 1.01
|
|
619
|
+
) {
|
|
620
|
+
// Note: Since SortableJS add `transitions`s in real-time as styles,
|
|
621
|
+
// we cannot define `transition` properties here,
|
|
622
|
+
|
|
623
|
+
&:has(limel-drag-handle:hover),
|
|
624
|
+
&:has(limel-drag-handle:focus-within),
|
|
625
|
+
&.is-elevated,
|
|
626
|
+
&.sortable-chosen // this class is added by SortableJS, when item is being dragged
|
|
627
|
+
{
|
|
628
|
+
will-change: transform, box-shadow, border-radius, background-color;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
&.sortable-ghost {
|
|
632
|
+
border-radius: $border-radius-while-being-dragged;
|
|
633
|
+
box-shadow:
|
|
634
|
+
var(--shadow-depth-64),
|
|
635
|
+
0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
&.sortable-chosen {
|
|
639
|
+
border-radius: $border-radius-while-being-dragged;
|
|
640
|
+
background-color: var(--lime-elevated-surface-background-color);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
&.is-elevated[draggable='false'] {
|
|
644
|
+
// Components must add this `is-elevated` class on their own,
|
|
645
|
+
// the moment the item is dropped and keep it around briefly
|
|
646
|
+
// so visual transitions (box-shadow, etc.) can fade
|
|
647
|
+
// out without being clipped by neighboring content.
|
|
648
|
+
animation: sit-here 0.8s forwards;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
@keyframes sit-here {
|
|
652
|
+
0% {
|
|
653
|
+
border-radius: $border-radius-while-being-dragged;
|
|
654
|
+
background-color: var(--lime-elevated-surface-background-color);
|
|
655
|
+
box-shadow:
|
|
656
|
+
var(--shadow-depth-64),
|
|
657
|
+
0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
100% {
|
|
661
|
+
box-shadow: none;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* The breakpoints below are used to create responsive designs
|
|
668
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
669
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
670
|
+
* file, to create consistent styles.
|
|
671
|
+
*
|
|
672
|
+
* :::important
|
|
673
|
+
* In very rare cases you should used media queries!
|
|
674
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
675
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
676
|
+
* :::
|
|
677
|
+
*/
|
|
678
|
+
$narrow-viewport-breakpoint: 800px;
|
|
679
|
+
$medium-viewport-breakpoint: 1023px;
|
|
680
|
+
// At this breakpoint, `limel-dialog` switches the layout of `slot="button"`
|
|
681
|
+
// and stretches the buttons to full-width.
|
|
682
|
+
$narrow-dialog-breakpoint: 760px;
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Media query mixins for responsive design based on screen width.
|
|
686
|
+
* Note that these mixins do not detect the device type!
|
|
687
|
+
*/
|
|
688
|
+
@mixin when-viewport-width-is-narrow {
|
|
689
|
+
// What our products consider as mobile (held in portrait mode)
|
|
690
|
+
@media (max-width: #{$narrow-viewport-breakpoint}) {
|
|
691
|
+
@content;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
@mixin when-viewport-width-is-not-narrow {
|
|
696
|
+
// Wider than what our products consider as mobile (held in portrait mode)
|
|
697
|
+
@media (min-width: #{$narrow-viewport-breakpoint + 1px}) {
|
|
698
|
+
@content;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
@mixin when-viewport-width-is-medium {
|
|
703
|
+
// What our products consider as to be bigger than a phone,
|
|
704
|
+
// but not bigger than a tablet (held in landscape mode)
|
|
705
|
+
// or a small laptop screen.
|
|
706
|
+
@media (min-width: #{$narrow-viewport-breakpoint + 1px}) and (max-width: #{$medium-viewport-breakpoint}) {
|
|
707
|
+
@content;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
@mixin when-viewport-width-is-not-large {
|
|
712
|
+
// What our products consider as a phone,
|
|
713
|
+
// or a small tablet (held in landscape mode) or a small laptop screen.
|
|
714
|
+
@media (max-width: #{$medium-viewport-breakpoint}) {
|
|
715
|
+
@content;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
@mixin when-viewport-width-is-large {
|
|
720
|
+
// What our products consider wider than tablet (held in landscape mode)
|
|
721
|
+
@media (min-width: #{$medium-viewport-breakpoint + 1px}) {
|
|
722
|
+
@content;
|
|
723
|
+
}
|
|
724
|
+
}
|