@meowdown/core 0.75.0 → 0.75.1

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.
Files changed (2) hide show
  1. package/dist/style.css +119 -5
  2. package/package.json +2 -2
package/dist/style.css CHANGED
@@ -183,6 +183,23 @@
183
183
  inherits: true
184
184
  }
185
185
 
186
+ @property --meowdown-embed-max-height {
187
+ syntax: "*";
188
+ inherits: true
189
+ }
190
+
191
+ @property --_overflowing {
192
+ syntax: "<integer>";
193
+ inherits: true;
194
+ initial-value: 0;
195
+ }
196
+
197
+ @keyframes meowdown-embed-overflowing {
198
+ from, to {
199
+ --_overflowing: 1;
200
+ }
201
+ }
202
+
186
203
  [data-meowdown-embed="x"] [data-root], [data-meowdown-embed="x"] [data-root] *, [data-meowdown-embed="x"] [data-root] :before, [data-meowdown-embed="x"] [data-root] :after {
187
204
  all: revert;
188
205
  box-sizing: border-box;
@@ -194,6 +211,7 @@
194
211
  --_link: var(--meowdown-embed-link-color, #1d9bf0);
195
212
  --_tint: color-mix(in srgb, currentColor 5%, transparent);
196
213
  --_media-height: 7.5rem;
214
+ --_show-more-height: 2rem;
197
215
  width: fit-content;
198
216
  max-width: min(28rem, 100%);
199
217
  font: inherit;
@@ -323,6 +341,107 @@
323
341
  color: inherit;
324
342
  }
325
343
 
344
+ & > article {
345
+ --_clip-gutter: 4px;
346
+ --_body-limit: calc(var(--meowdown-embed-max-height, 256px) - 2 * var(--meowdown-embed-padding, 1rem) - 2px + 2 *
347
+ var(--_clip-gutter));
348
+ }
349
+
350
+ & > article > [data-show-more] {
351
+ display: none;
352
+ }
353
+
354
+ & > article > [data-show-more] > summary {
355
+ width: fit-content;
356
+ font-size: .9375em;
357
+ line-height: var(--_show-more-height);
358
+ color: var(--_link);
359
+ cursor: pointer;
360
+ list-style: none;
361
+ display: block;
362
+ }
363
+
364
+ & > article > [data-show-more] > summary::-webkit-details-marker {
365
+ display: none;
366
+ }
367
+
368
+ & > article > [data-show-more] > summary:before {
369
+ content: "Show more";
370
+ }
371
+
372
+ & > article > [data-show-more][open] > summary:before {
373
+ content: "Show less";
374
+ }
375
+
376
+ & > article > [data-show-more] > summary:hover {
377
+ text-underline-offset: .15em;
378
+ text-decoration: underline;
379
+ }
380
+
381
+ & > article > [data-show-more] > summary:focus-visible {
382
+ outline: 2px solid var(--_link);
383
+ outline-offset: 2px;
384
+ border-radius: 4px;
385
+ }
386
+
387
+ @supports (animation-timeline: scroll()) {
388
+ & > article {
389
+ max-height: calc(var(--_body-limit) - var(--_overflowing) * var(--_show-more-height));
390
+ padding: var(--_clip-gutter);
391
+ margin: calc(-1 * var(--_clip-gutter));
392
+ margin-block-end: calc(var(--_overflowing) * var(--_show-more-height) - var(--_clip-gutter));
393
+ animation: linear both meowdown-embed-overflowing scroll(self);
394
+ overflow: hidden;
395
+ }
396
+
397
+ & > article:has( > [data-show-more][open]), & > article:has(:focus-visible:not(summary)) {
398
+ max-height: none;
399
+ margin-block-end: calc(-1 * var(--_clip-gutter));
400
+ overflow: visible;
401
+ }
402
+
403
+ @container style(--_overflowing: 1) {
404
+ & > article > [data-content] {
405
+ mask-image: linear-gradient(#000 calc(100% - 3rem), #0000);
406
+ mask-size: 100%
407
+ calc(var(--_body-limit) - var(--_show-more-height) - 2 * var(--_clip-gutter));
408
+ mask-repeat: no-repeat;
409
+ }
410
+
411
+ & > article > [data-show-more] {
412
+ inset-inline-start: var(--meowdown-embed-padding, 1rem);
413
+ bottom: var(--meowdown-embed-padding, 1rem);
414
+ display: block;
415
+ position: absolute;
416
+ }
417
+ }
418
+
419
+ & > article > [data-show-more][open] {
420
+ z-index: 1;
421
+ width: fit-content;
422
+ margin: .5rem auto 0;
423
+ display: block;
424
+ position: sticky;
425
+ bottom: .75rem;
426
+ }
427
+
428
+ & > article > [data-show-more][open] > summary {
429
+ border: 1px solid var(--_hairline);
430
+ background: var(--meowdown-embed-background, Canvas);
431
+ border-radius: 999px;
432
+ padding: .375rem .875rem;
433
+ font-size: .875em;
434
+ font-weight: 500;
435
+ line-height: normal;
436
+ box-shadow: 0 2px 8px #0000001f;
437
+ }
438
+
439
+ & > article > [data-show-more][open] > summary:hover {
440
+ background: color-mix(in srgb, var(--_link) 8%, var(--meowdown-embed-background, Canvas));
441
+ text-decoration: none;
442
+ }
443
+ }
444
+
326
445
  & [data-reply-to] {
327
446
  color: var(--_muted);
328
447
  margin-block-start: .625rem;
@@ -506,13 +625,8 @@
506
625
  }
507
626
 
508
627
  & [data-quoted] [data-body] {
509
- -webkit-line-clamp: 3;
510
- line-clamp: 3;
511
- -webkit-box-orient: vertical;
512
628
  margin-block-start: .25rem;
513
629
  font-size: .9375em;
514
- display: -webkit-box;
515
- overflow: hidden;
516
630
  }
517
631
 
518
632
  & [data-quoted] [data-media] {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meowdown/core",
3
3
  "type": "module",
4
- "version": "0.75.0",
4
+ "version": "0.75.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  "@codemirror/language-data": "^6.5.2",
26
26
  "@floating-ui/dom": "^1.8.0",
27
27
  "@lezer/highlight": "^1.2.3",
28
- "@meowdown/embed": "^0.2.0",
28
+ "@meowdown/embed": "^0.3.0",
29
29
  "@meowdown/markdown": "^0.72.0",
30
30
  "@ocavue/utils": "^1.8.0",
31
31
  "@post-embed/exporter": "^0.5.0",