@sc-360-v2/storefront-cms-library 0.5.67 → 0.5.69

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.
@@ -353,12 +353,24 @@ $overflowSelector: ".flex__overflow";
353
353
  .gallery-slider-element {
354
354
  flex-direction: row;
355
355
  }
356
- .gallery-header {
357
- // Text Container Width; fit-content is the previous behaviour.
358
- width: prepareMediaVariable(--_ctm-dn-gy-wt-lt-tt-cr-wh, fit-content);
356
+ // Child combinator: as a plain descendant this also matched the per-item captions
357
+ // inside the slides, so the widget's text position resized those too.
358
+ .gallery-slider-element > .gallery-header {
359
+ // Beside the slider, Text Container Width is a ceiling rather than a fixed width
360
+ // (what the schema comment describes). It is always emitted as 100%, so used as
361
+ // `width` it made the header's flex basis the whole row: no free space for the
362
+ // slider to grow into and no overflow to shrink anyone, leaving the slider 0px.
363
+ width: fit-content;
364
+ max-width: prepareMediaVariable(--_ctm-dn-gy-wt-lt-tt-cr-wh, 100%);
359
365
  min-width: 0;
366
+ flex-shrink: 1;
360
367
  height: 100%;
361
368
  }
369
+ // The slider takes whatever the caption leaves.
370
+ .gallery-slider-element > .embla {
371
+ flex: 1 1 0;
372
+ min-width: 0;
373
+ }
362
374
  &[data-widget-alignment="top"] {
363
375
  .gallery-slider-element {
364
376
  align-items: flex-start;
@@ -385,12 +397,18 @@ $overflowSelector: ".flex__overflow";
385
397
  }
386
398
  }
387
399
  &[data-text-position="right"] {
388
- .gallery-header {
389
- // Text Container Width; fit-content is the previous behaviour.
390
- width: prepareMediaVariable(--_ctm-dn-gy-wt-lt-tt-cr-wh, fit-content);
400
+ // Same pair as the "left" block above — see the comments there.
401
+ .gallery-slider-element > .gallery-header {
402
+ width: fit-content;
403
+ max-width: prepareMediaVariable(--_ctm-dn-gy-wt-lt-tt-cr-wh, 100%);
391
404
  min-width: 0;
405
+ flex-shrink: 1;
392
406
  height: 100%;
393
407
  }
408
+ .gallery-slider-element > .embla {
409
+ flex: 1 1 0;
410
+ min-width: 0;
411
+ }
394
412
  .gallery-slider-element {
395
413
  flex-direction: row-reverse;
396
414
  }
@@ -1483,6 +1501,10 @@ $overflowSelector: ".flex__overflow";
1483
1501
  var(--_ctm-tab-dn-im-se-wd-bk, var(--_ctm-dn-im-se-wd-bk))
1484
1502
  );
1485
1503
 
1504
+ &#{$overflowSelector} {
1505
+ @include restrictToLinesShow(#{var(--_sf-line-clamp, 1)});
1506
+ }
1507
+
1486
1508
  font-size: var(
1487
1509
  --_ctm-mob-dn-im-se-ft-se,
1488
1510
  var(--_ctm-tab-dn-im-se-ft-se, var(--_ctm-dn-im-se-ft-se))
@@ -1542,6 +1564,10 @@ $overflowSelector: ".flex__overflow";
1542
1564
  var(--_ctm-tab-dn-im-se-wd-bk-dc, var(--_ctm-dn-im-se-wd-bk-dc))
1543
1565
  );
1544
1566
 
1567
+ &#{$overflowSelector} {
1568
+ @include restrictToLinesShow(#{var(--_sf-line-clamp-desc, 1)});
1569
+ }
1570
+
1545
1571
  font-size: var(
1546
1572
  --_ctm-mob-dn-im-se-ft-se-dc,
1547
1573
  var(--_ctm-tab-dn-im-se-ft-se-dc, var(--_ctm-dn-im-se-ft-se-dc))
@@ -1631,11 +1657,26 @@ $overflowSelector: ".flex__overflow";
1631
1657
  flex-direction: row;
1632
1658
 
1633
1659
  .gallery-header {
1634
- // Text Container Width; fit-content is the previous behaviour.
1635
- width: prepareMediaVariable(--_ctm-dn-gy-wt-lt-tt-cr-wh, fit-content);
1660
+ // The item's own Text Container Width, not the widget's. This read
1661
+ // --_ctm-dn-gy-wt-lt-tt-cr-wh, which is always emitted as 100%; combined with
1662
+ // the header's `flex: 0 0 auto` it never gave any of that width back, so the
1663
+ // image was squeezed to 0px and vanished. There is no item-level control yet,
1664
+ // so this falls back to fit-content and the caption sizes to its own text.
1665
+ width: fit-content;
1666
+ max-width: prepareMediaVariable(--_ctm-dn-im-lt-tt-cr-wh, 100%);
1636
1667
  min-width: 0;
1668
+ // Beside the image the caption has to be able to give way. The base rule's
1669
+ // flex-shrink 0 is right for the stacked positions, not for these.
1670
+ flex-shrink: 1;
1637
1671
  height: 100%;
1638
1672
  }
1673
+
1674
+ // The image takes whatever the caption leaves. Scoped to the row directions —
1675
+ // in top/bottom the main axis is vertical and a flex-basis here would break it.
1676
+ > img {
1677
+ flex: 1 1 0;
1678
+ min-width: 0;
1679
+ }
1639
1680
  &[data-widget-alignment="top"] {
1640
1681
  align-items: flex-start;
1641
1682
 
@@ -1661,12 +1702,27 @@ $overflowSelector: ".flex__overflow";
1661
1702
  &[data-text-position="right"] {
1662
1703
  flex-direction: row-reverse;
1663
1704
  .gallery-header {
1664
- // Text Container Width; fit-content is the previous behaviour.
1665
- width: prepareMediaVariable(--_ctm-dn-gy-wt-lt-tt-cr-wh, fit-content);
1705
+ // The item's own Text Container Width, not the widget's. This read
1706
+ // --_ctm-dn-gy-wt-lt-tt-cr-wh, which is always emitted as 100%; combined with
1707
+ // the header's `flex: 0 0 auto` it never gave any of that width back, so the
1708
+ // image was squeezed to 0px and vanished. There is no item-level control yet,
1709
+ // so this falls back to fit-content and the caption sizes to its own text.
1710
+ width: fit-content;
1711
+ max-width: prepareMediaVariable(--_ctm-dn-im-lt-tt-cr-wh, 100%);
1666
1712
  min-width: 0;
1713
+ // Beside the image the caption has to be able to give way. The base rule's
1714
+ // flex-shrink 0 is right for the stacked positions, not for these.
1715
+ flex-shrink: 1;
1667
1716
  height: 100%;
1668
1717
  }
1669
1718
 
1719
+ // The image takes whatever the caption leaves. Scoped to the row directions —
1720
+ // in top/bottom the main axis is vertical and a flex-basis here would break it.
1721
+ > img {
1722
+ flex: 1 1 0;
1723
+ min-width: 0;
1724
+ }
1725
+
1670
1726
  &[data-widget-alignment="top"] {
1671
1727
  align-items: flex-start;
1672
1728
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sc-360-v2/storefront-cms-library",
3
- "version": "0.5.67",
3
+ "version": "0.5.69",
4
4
  "main": "/dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {