@lime-bundles/widget 2.2.1 → 2.4.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/dist/index.cjs +195 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +197 -76
- package/dist/index.js.map +1 -1
- package/dist/lime-bundle.global.js +99 -47
- package/dist/lime-bundle.global.js.map +1 -1
- package/docs/css-variables.md +8 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -332,6 +332,11 @@ function renderProductRow(state, currency, qtyFor, onVariantChange) {
|
|
|
332
332
|
prices.appendChild(compare);
|
|
333
333
|
prices.appendChild(priceEl);
|
|
334
334
|
info.appendChild(prices);
|
|
335
|
+
const unitPriceEl = el("span", "lb-bundle-product-unit-price", {
|
|
336
|
+
"data-product-unit-price": ""
|
|
337
|
+
});
|
|
338
|
+
unitPriceEl.setAttribute("hidden", "");
|
|
339
|
+
info.appendChild(unitPriceEl);
|
|
335
340
|
const applyVariantToRow = (variant) => {
|
|
336
341
|
const unit = (0, import_core.parseCents)(variant.price.amount);
|
|
337
342
|
priceEl.textContent = (0, import_core.formatCents)(unit, currency);
|
|
@@ -346,12 +351,24 @@ function renderProductRow(state, currency, qtyFor, onVariantChange) {
|
|
|
346
351
|
} else {
|
|
347
352
|
compare.setAttribute("hidden", "");
|
|
348
353
|
}
|
|
354
|
+
const unitText = (0, import_core.formatUnitPrice)(
|
|
355
|
+
variant.unitPrice,
|
|
356
|
+
variant.unitPriceMeasurement,
|
|
357
|
+
currency
|
|
358
|
+
);
|
|
359
|
+
if (unitText) {
|
|
360
|
+
unitPriceEl.textContent = unitText;
|
|
361
|
+
unitPriceEl.removeAttribute("hidden");
|
|
362
|
+
} else {
|
|
363
|
+
unitPriceEl.setAttribute("hidden", "");
|
|
364
|
+
}
|
|
349
365
|
};
|
|
350
366
|
applyVariantToRow(state.selected);
|
|
351
367
|
if (state.eligibleVariants.length > 1) {
|
|
352
368
|
const select = document.createElement("select");
|
|
353
369
|
select.className = "lb-bundle-variant-select";
|
|
354
370
|
select.setAttribute("data-variant-select", "");
|
|
371
|
+
select.name = `lb-variant-${state.product.id.replace(/^.*\//, "")}`;
|
|
355
372
|
select.setAttribute(
|
|
356
373
|
"aria-label",
|
|
357
374
|
`Select variant for ${state.product.title}`
|
|
@@ -571,7 +588,12 @@ function renderMixMatchBundle(container, bundle, onAddToCart, onCleanup) {
|
|
|
571
588
|
variantTitle: firstVariant.title,
|
|
572
589
|
imageUrl: firstEligible.product.featuredImage?.url ?? null,
|
|
573
590
|
priceCents: (0, import_core.parseCents)(firstVariant.price.amount),
|
|
574
|
-
compareCents: firstVariant.compareAtPrice ? (0, import_core.parseCents)(firstVariant.compareAtPrice.amount) : null
|
|
591
|
+
compareCents: firstVariant.compareAtPrice ? (0, import_core.parseCents)(firstVariant.compareAtPrice.amount) : null,
|
|
592
|
+
unitPriceLabel: (0, import_core.formatUnitPrice)(
|
|
593
|
+
firstVariant.unitPrice,
|
|
594
|
+
firstVariant.unitPriceMeasurement,
|
|
595
|
+
currency
|
|
596
|
+
)
|
|
575
597
|
});
|
|
576
598
|
}
|
|
577
599
|
afterMutation();
|
|
@@ -584,7 +606,12 @@ function renderMixMatchBundle(container, bundle, onAddToCart, onCleanup) {
|
|
|
584
606
|
variantTitle: variant.title,
|
|
585
607
|
imageUrl: product.featuredImage?.url ?? null,
|
|
586
608
|
priceCents: (0, import_core.parseCents)(variant.price.amount),
|
|
587
|
-
compareCents: variant.compareAtPrice ? (0, import_core.parseCents)(variant.compareAtPrice.amount) : null
|
|
609
|
+
compareCents: variant.compareAtPrice ? (0, import_core.parseCents)(variant.compareAtPrice.amount) : null,
|
|
610
|
+
unitPriceLabel: (0, import_core.formatUnitPrice)(
|
|
611
|
+
variant.unitPrice,
|
|
612
|
+
variant.unitPriceMeasurement,
|
|
613
|
+
currency
|
|
614
|
+
)
|
|
588
615
|
});
|
|
589
616
|
afterMutation();
|
|
590
617
|
}
|
|
@@ -771,6 +798,11 @@ function renderFilledSlot(selection, index, currency, onRemove) {
|
|
|
771
798
|
priceEl.textContent = (0, import_core.formatCents)(selection.priceCents, currency);
|
|
772
799
|
priceWrap.appendChild(priceEl);
|
|
773
800
|
info.appendChild(priceWrap);
|
|
801
|
+
if (selection.unitPriceLabel) {
|
|
802
|
+
const unitPrice = el("span", "lb-bundle-product-unit-price");
|
|
803
|
+
unitPrice.textContent = selection.unitPriceLabel;
|
|
804
|
+
info.appendChild(unitPrice);
|
|
805
|
+
}
|
|
774
806
|
slot.appendChild(info);
|
|
775
807
|
const remove = document.createElement("button");
|
|
776
808
|
remove.type = "button";
|
|
@@ -925,8 +957,10 @@ function renderModal(bundle, eligible, currency, handlers) {
|
|
|
925
957
|
rowsBuilt = true;
|
|
926
958
|
list.innerHTML = "";
|
|
927
959
|
eligible.forEach((ep) => {
|
|
928
|
-
const
|
|
929
|
-
|
|
960
|
+
const availableVariants = ep.variants.filter((v) => v.availableForSale);
|
|
961
|
+
const firstAvailVariant = availableVariants[0] ?? ep.firstAvailableVariant ?? ep.variants[0];
|
|
962
|
+
if (!firstAvailVariant) return;
|
|
963
|
+
let currentVariant = firstAvailVariant;
|
|
930
964
|
const productEl = el(
|
|
931
965
|
"div",
|
|
932
966
|
ep.isOos ? "lb-mix-match__modal-product lb-mix-match__modal-product--sold-out" : "lb-mix-match__modal-product",
|
|
@@ -948,70 +982,116 @@ function renderModal(bundle, eligible, currency, handlers) {
|
|
|
948
982
|
} else {
|
|
949
983
|
thumb.insertAdjacentHTML("beforeend", PLACEHOLDER_THUMB_SVG2);
|
|
950
984
|
}
|
|
985
|
+
const countBadge = el("span", "lb-bundle-qty-badge");
|
|
986
|
+
countBadge.style.display = "none";
|
|
987
|
+
thumb.appendChild(countBadge);
|
|
951
988
|
productEl.appendChild(thumb);
|
|
952
989
|
const info = el("div", "lb-mix-match__modal-product-info");
|
|
953
|
-
const title = el("
|
|
990
|
+
const title = el("p", "lb-mix-match__modal-product-title");
|
|
954
991
|
title.textContent = ep.product.title;
|
|
955
992
|
info.appendChild(title);
|
|
956
|
-
const price = el("
|
|
957
|
-
price.textContent = (0, import_core.formatCents)(
|
|
993
|
+
const price = el("p", "lb-mix-match__modal-product-price");
|
|
994
|
+
price.textContent = (0, import_core.formatCents)(
|
|
995
|
+
(0, import_core.parseCents)(currentVariant.price.amount),
|
|
996
|
+
currency
|
|
997
|
+
);
|
|
958
998
|
info.appendChild(price);
|
|
999
|
+
const unitPrice = el(
|
|
1000
|
+
"p",
|
|
1001
|
+
"lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price"
|
|
1002
|
+
);
|
|
1003
|
+
const initialUnitText = (0, import_core.formatUnitPrice)(
|
|
1004
|
+
currentVariant.unitPrice,
|
|
1005
|
+
currentVariant.unitPriceMeasurement,
|
|
1006
|
+
currency
|
|
1007
|
+
);
|
|
1008
|
+
if (initialUnitText) {
|
|
1009
|
+
unitPrice.textContent = initialUnitText;
|
|
1010
|
+
} else {
|
|
1011
|
+
unitPrice.hidden = true;
|
|
1012
|
+
}
|
|
1013
|
+
info.appendChild(unitPrice);
|
|
1014
|
+
const row = {
|
|
1015
|
+
el: productEl,
|
|
1016
|
+
product: ep.product,
|
|
1017
|
+
variant: firstAvailVariant,
|
|
1018
|
+
updateCount: () => {
|
|
1019
|
+
}
|
|
1020
|
+
};
|
|
1021
|
+
if (availableVariants.length > 1) {
|
|
1022
|
+
const select = document.createElement("select");
|
|
1023
|
+
select.className = "lb-mix-match__variant-select";
|
|
1024
|
+
select.setAttribute("data-variant-select", "");
|
|
1025
|
+
select.name = `lb-variant-${ep.product.id.replace(/^.*\//, "")}`;
|
|
1026
|
+
select.setAttribute(
|
|
1027
|
+
"aria-label",
|
|
1028
|
+
`Select variant for ${ep.product.title}`
|
|
1029
|
+
);
|
|
1030
|
+
availableVariants.forEach((v) => {
|
|
1031
|
+
const opt = document.createElement("option");
|
|
1032
|
+
opt.value = v.id;
|
|
1033
|
+
opt.textContent = v.title;
|
|
1034
|
+
if (v.id === firstAvailVariant.id) opt.selected = true;
|
|
1035
|
+
select.appendChild(opt);
|
|
1036
|
+
});
|
|
1037
|
+
select.addEventListener("change", () => {
|
|
1038
|
+
const next = availableVariants.find((v) => v.id === select.value);
|
|
1039
|
+
if (!next) return;
|
|
1040
|
+
currentVariant = next;
|
|
1041
|
+
row.variant = next;
|
|
1042
|
+
price.textContent = (0, import_core.formatCents)(
|
|
1043
|
+
(0, import_core.parseCents)(currentVariant.price.amount),
|
|
1044
|
+
currency
|
|
1045
|
+
);
|
|
1046
|
+
const nextUnitText = (0, import_core.formatUnitPrice)(
|
|
1047
|
+
currentVariant.unitPrice,
|
|
1048
|
+
currentVariant.unitPriceMeasurement,
|
|
1049
|
+
currency
|
|
1050
|
+
);
|
|
1051
|
+
if (nextUnitText) {
|
|
1052
|
+
unitPrice.textContent = nextUnitText;
|
|
1053
|
+
unitPrice.hidden = false;
|
|
1054
|
+
} else {
|
|
1055
|
+
unitPrice.textContent = "";
|
|
1056
|
+
unitPrice.hidden = true;
|
|
1057
|
+
}
|
|
1058
|
+
rowUpdateCount();
|
|
1059
|
+
});
|
|
1060
|
+
info.appendChild(select);
|
|
1061
|
+
} else if (availableVariants.length === 1 && firstAvailVariant.title !== "Default Title") {
|
|
1062
|
+
const variantLabel = el("span", "lb-mix-match__filled-variant");
|
|
1063
|
+
variantLabel.textContent = firstAvailVariant.title;
|
|
1064
|
+
info.appendChild(variantLabel);
|
|
1065
|
+
}
|
|
959
1066
|
if (ep.isOos) {
|
|
960
1067
|
const soldOut = el("span", "lb-mix-match__modal-sold-out-label");
|
|
961
1068
|
soldOut.textContent = "Sold out";
|
|
962
1069
|
info.appendChild(soldOut);
|
|
963
1070
|
}
|
|
964
1071
|
productEl.appendChild(info);
|
|
1072
|
+
const rowUpdateCount = () => {
|
|
1073
|
+
const count = handlers.countFor(ep.product.id, currentVariant.id);
|
|
1074
|
+
if (count > 0) {
|
|
1075
|
+
countBadge.textContent = String(count);
|
|
1076
|
+
countBadge.style.display = "";
|
|
1077
|
+
} else {
|
|
1078
|
+
countBadge.style.display = "none";
|
|
1079
|
+
}
|
|
1080
|
+
};
|
|
965
1081
|
if (!ep.isOos) {
|
|
966
1082
|
const addBtn = document.createElement("button");
|
|
967
1083
|
addBtn.type = "button";
|
|
968
1084
|
addBtn.className = "lb-mix-match__modal-add";
|
|
969
|
-
addBtn.
|
|
970
|
-
addBtn.innerHTML = PLUS_ICON_SVG;
|
|
971
|
-
const countBadge = el("span", "lb-bundle-qty-badge");
|
|
972
|
-
countBadge.style.display = "none";
|
|
973
|
-
addBtn.appendChild(countBadge);
|
|
1085
|
+
addBtn.textContent = "Add";
|
|
974
1086
|
addBtn.addEventListener("click", () => {
|
|
975
1087
|
if (handlers.isOverMax()) return;
|
|
976
|
-
handlers.onAdd(ep.product,
|
|
1088
|
+
handlers.onAdd(ep.product, currentVariant);
|
|
977
1089
|
});
|
|
978
1090
|
productEl.appendChild(addBtn);
|
|
979
|
-
const removeBtn = document.createElement("button");
|
|
980
|
-
removeBtn.type = "button";
|
|
981
|
-
removeBtn.className = "lb-mix-match__slot-remove";
|
|
982
|
-
removeBtn.setAttribute("aria-label", `Remove one ${ep.product.title}`);
|
|
983
|
-
removeBtn.style.display = "none";
|
|
984
|
-
removeBtn.innerHTML = CLOSE_ICON_SVG;
|
|
985
|
-
removeBtn.addEventListener("click", (e) => {
|
|
986
|
-
e.stopPropagation();
|
|
987
|
-
handlers.onRemove(ep.product.id, variant.id);
|
|
988
|
-
});
|
|
989
|
-
productEl.appendChild(removeBtn);
|
|
990
|
-
productRows.push({
|
|
991
|
-
el: productEl,
|
|
992
|
-
product: ep.product,
|
|
993
|
-
variant,
|
|
994
|
-
updateCount: () => {
|
|
995
|
-
const count = handlers.countFor(ep.product.id, variant.id);
|
|
996
|
-
if (count > 0) {
|
|
997
|
-
countBadge.textContent = String(count);
|
|
998
|
-
countBadge.style.display = "";
|
|
999
|
-
removeBtn.style.display = "";
|
|
1000
|
-
} else {
|
|
1001
|
-
countBadge.style.display = "none";
|
|
1002
|
-
removeBtn.style.display = "none";
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1006
|
-
} else {
|
|
1007
|
-
productRows.push({
|
|
1008
|
-
el: productEl,
|
|
1009
|
-
product: ep.product,
|
|
1010
|
-
variant,
|
|
1011
|
-
updateCount: () => {
|
|
1012
|
-
}
|
|
1013
|
-
});
|
|
1014
1091
|
}
|
|
1092
|
+
row.updateCount = ep.isOos ? () => {
|
|
1093
|
+
} : rowUpdateCount;
|
|
1094
|
+
productRows.push(row);
|
|
1015
1095
|
list.appendChild(productEl);
|
|
1016
1096
|
});
|
|
1017
1097
|
refreshCounts();
|
|
@@ -1421,7 +1501,6 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1421
1501
|
|
|
1422
1502
|
.lb-bundle-widget {
|
|
1423
1503
|
/* Internal CSS-only vars (not merchant-configurable). */
|
|
1424
|
-
--lb-text-muted: #666666;
|
|
1425
1504
|
--lb-thumbnail-bg: #F0F0F0;
|
|
1426
1505
|
--lb-widget-pad: 20px;
|
|
1427
1506
|
--lb-progress-color: var(--lb-primary-color);
|
|
@@ -1444,7 +1523,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1444
1523
|
margin: 0 calc(-1 * var(--lb-widget-pad)) 20px;
|
|
1445
1524
|
padding: 12px 20px;
|
|
1446
1525
|
background: var(--lb-countdown-bg);
|
|
1447
|
-
border-top: 1px solid
|
|
1526
|
+
border-top: 1px solid color-mix(in srgb, var(--lb-text) 6%, transparent);
|
|
1448
1527
|
display: flex;
|
|
1449
1528
|
align-items: center;
|
|
1450
1529
|
justify-content: space-between;
|
|
@@ -1540,7 +1619,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1540
1619
|
font-size: 16px;
|
|
1541
1620
|
font-weight: 400;
|
|
1542
1621
|
line-height: 20px;
|
|
1543
|
-
color: var(--lb-text
|
|
1622
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1544
1623
|
margin: 4px 0 0;
|
|
1545
1624
|
}
|
|
1546
1625
|
|
|
@@ -1583,15 +1662,18 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1583
1662
|
/* Product rows */
|
|
1584
1663
|
.lb-bundle-product-row {
|
|
1585
1664
|
display: flex;
|
|
1586
|
-
gap:
|
|
1665
|
+
gap: 20px;
|
|
1587
1666
|
padding: 12px 0;
|
|
1588
1667
|
}
|
|
1589
1668
|
|
|
1590
1669
|
.lb-bundle-thumbnail {
|
|
1591
1670
|
position: relative;
|
|
1592
1671
|
width: 48px;
|
|
1593
|
-
height: 48px;
|
|
1594
1672
|
min-width: 48px;
|
|
1673
|
+
/* Aspect-ratio comes from the merchant \`thumbnailRatio\` enum via Liquid;
|
|
1674
|
+
"original" sets it to \`auto\` so the box sizes to the image's intrinsic
|
|
1675
|
+
ratio. Default keeps the historical 1:1 behaviour. */
|
|
1676
|
+
aspect-ratio: var(--lb-thumbnail-aspect-ratio, 1 / 1);
|
|
1595
1677
|
background: var(--lb-thumbnail-bg);
|
|
1596
1678
|
border-radius: 8px;
|
|
1597
1679
|
overflow: hidden;
|
|
@@ -1602,14 +1684,16 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1602
1684
|
|
|
1603
1685
|
.lb-bundle-thumbnail img {
|
|
1604
1686
|
width: 100%;
|
|
1605
|
-
|
|
1606
|
-
|
|
1687
|
+
/* Height + fit come from the same merchant enum; "original" sets them to
|
|
1688
|
+
\`auto\` / \`contain\` so the image renders uncropped at intrinsic ratio. */
|
|
1689
|
+
height: var(--lb-thumbnail-img-height, 100%);
|
|
1690
|
+
object-fit: var(--lb-thumbnail-img-fit, cover);
|
|
1607
1691
|
}
|
|
1608
1692
|
|
|
1609
1693
|
.lb-bundle-thumbnail svg {
|
|
1610
1694
|
width: 28px;
|
|
1611
1695
|
height: 28px;
|
|
1612
|
-
color:
|
|
1696
|
+
color: color-mix(in srgb, var(--lb-text) 35%, transparent);
|
|
1613
1697
|
}
|
|
1614
1698
|
|
|
1615
1699
|
.lb-bundle-product-info {
|
|
@@ -1634,7 +1718,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1634
1718
|
.lb-bundle-product-price {
|
|
1635
1719
|
/* --lb-product-price-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
1636
1720
|
display: var(--lb-product-price-display, block);
|
|
1637
|
-
font-size:
|
|
1721
|
+
font-size: 14px;
|
|
1638
1722
|
font-weight: 400;
|
|
1639
1723
|
line-height: 20px;
|
|
1640
1724
|
color: var(--lb-text);
|
|
@@ -1651,7 +1735,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1651
1735
|
.lb-bundle-product-compare-price {
|
|
1652
1736
|
/* --lb-product-compare-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
1653
1737
|
display: var(--lb-product-compare-display, inline);
|
|
1654
|
-
font-size:
|
|
1738
|
+
font-size: 14px;
|
|
1655
1739
|
font-weight: 400;
|
|
1656
1740
|
line-height: 20px;
|
|
1657
1741
|
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
@@ -1664,6 +1748,22 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1664
1748
|
display: none;
|
|
1665
1749
|
}
|
|
1666
1750
|
|
|
1751
|
+
/* Unit price (e.g. "$0.50/100ml") \u2014 only rendered when the merchant has
|
|
1752
|
+
configured unit pricing on the variant in the Shopify admin. No merchant
|
|
1753
|
+
toggle: present in admin \u2192 shown; absent \u2192 hidden. Styled as muted
|
|
1754
|
+
secondary text beneath the price row so it doesn't compete visually. */
|
|
1755
|
+
.lb-bundle-product-unit-price {
|
|
1756
|
+
display: block;
|
|
1757
|
+
font-size: 12px;
|
|
1758
|
+
line-height: 16px;
|
|
1759
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1760
|
+
margin-top: 2px;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
.lb-bundle-product-unit-price[hidden] {
|
|
1764
|
+
display: none;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1667
1767
|
.lb-bundle-variant-badge {
|
|
1668
1768
|
display: inline-block;
|
|
1669
1769
|
border: var(--lb-variant-border-width) solid var(--lb-variant-border-color);
|
|
@@ -1671,14 +1771,14 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1671
1771
|
padding: 8px 12px;
|
|
1672
1772
|
font-size: 12px;
|
|
1673
1773
|
line-height: 16px;
|
|
1674
|
-
color: var(--lb-text
|
|
1774
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1675
1775
|
margin-top: 8px;
|
|
1676
1776
|
}
|
|
1677
1777
|
|
|
1678
1778
|
.lb-bundle-quantity {
|
|
1679
1779
|
font-size: 12px;
|
|
1680
1780
|
line-height: 16px;
|
|
1681
|
-
color: var(--lb-text
|
|
1781
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1682
1782
|
margin-left: 8px;
|
|
1683
1783
|
white-space: nowrap;
|
|
1684
1784
|
}
|
|
@@ -1733,7 +1833,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1733
1833
|
font-size: 16px;
|
|
1734
1834
|
font-weight: 600;
|
|
1735
1835
|
line-height: 20px;
|
|
1736
|
-
padding: 12px
|
|
1836
|
+
padding: 8px 12px;
|
|
1737
1837
|
border-radius: var(--lb-savings-bar-radius);
|
|
1738
1838
|
margin-bottom: 12px;
|
|
1739
1839
|
}
|
|
@@ -1777,7 +1877,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1777
1877
|
grid-template-rows: 1fr;
|
|
1778
1878
|
grid-template-columns: 1fr;
|
|
1779
1879
|
width: 100%;
|
|
1780
|
-
padding: 16px;
|
|
1880
|
+
padding: 12px 16px;
|
|
1781
1881
|
border: var(--lb-cta-border-width) solid var(--lb-cta-border-color);
|
|
1782
1882
|
border-radius: var(--lb-cta-radius);
|
|
1783
1883
|
font-size: 16px;
|
|
@@ -1878,7 +1978,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1878
1978
|
.lb-bundle-placeholder-icon {
|
|
1879
1979
|
width: 28px;
|
|
1880
1980
|
height: 28px;
|
|
1881
|
-
stroke:
|
|
1981
|
+
stroke: color-mix(in srgb, var(--lb-text) 35%, transparent);
|
|
1882
1982
|
stroke-width: 1.5;
|
|
1883
1983
|
fill: none;
|
|
1884
1984
|
}
|
|
@@ -1912,14 +2012,14 @@ var BUNDLE_FIXED_CSS = `/* Lime Bundles \u2014 Fixed bundle styles */
|
|
|
1912
2012
|
|
|
1913
2013
|
/* Fixed bundles: product rows */
|
|
1914
2014
|
.lb-fixed .lb-bundle-product-row {
|
|
1915
|
-
gap:
|
|
2015
|
+
gap: 20px;
|
|
1916
2016
|
align-items: center;
|
|
1917
2017
|
}
|
|
1918
2018
|
|
|
1919
|
-
/* Fixed bundles: larger thumbnails
|
|
2019
|
+
/* Fixed bundles: larger thumbnails. Height comes from --lb-thumbnail-aspect-ratio
|
|
2020
|
+
(set on .lb-bundle-widget via Liquid / applyWidgetConfigVars). */
|
|
1920
2021
|
.lb-fixed .lb-bundle-thumbnail {
|
|
1921
2022
|
width: 60px;
|
|
1922
|
-
height: 60px;
|
|
1923
2023
|
min-width: 60px;
|
|
1924
2024
|
border-radius: var(--lb-image-border-radius);
|
|
1925
2025
|
border: var(--lb-image-border-width) solid var(--lb-image-border-color);
|
|
@@ -2020,7 +2120,10 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2020
2120
|
width: 60px;
|
|
2021
2121
|
height: 60px;
|
|
2022
2122
|
min-width: 60px;
|
|
2023
|
-
border
|
|
2123
|
+
/* 2px border is intentionally independent of --lb-image-border-width \u2014
|
|
2124
|
+
empty slots always need a visible dashed outline as an affordance,
|
|
2125
|
+
regardless of how the merchant has styled populated thumbnails. */
|
|
2126
|
+
border: 2px dashed color-mix(in srgb, var(--lb-text) 35%, transparent);
|
|
2024
2127
|
border-radius: var(--lb-image-border-radius);
|
|
2025
2128
|
box-sizing: border-box;
|
|
2026
2129
|
display: flex;
|
|
@@ -2040,9 +2143,10 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2040
2143
|
cursor: default;
|
|
2041
2144
|
}
|
|
2042
2145
|
|
|
2146
|
+
/* Mix-match thumbnails. Height comes from --lb-thumbnail-aspect-ratio
|
|
2147
|
+
(set on .lb-bundle-widget via Liquid / applyWidgetConfigVars). */
|
|
2043
2148
|
.lb-mix-match .lb-bundle-thumbnail {
|
|
2044
2149
|
width: 60px;
|
|
2045
|
-
height: 60px;
|
|
2046
2150
|
min-width: 60px;
|
|
2047
2151
|
border-radius: var(--lb-image-border-radius);
|
|
2048
2152
|
border: var(--lb-image-border-width) solid var(--lb-image-border-color);
|
|
@@ -2277,7 +2381,7 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2277
2381
|
.lb-mix-match__modal-product {
|
|
2278
2382
|
display: flex;
|
|
2279
2383
|
align-items: center;
|
|
2280
|
-
gap:
|
|
2384
|
+
gap: 20px;
|
|
2281
2385
|
padding: 12px 0;
|
|
2282
2386
|
border-bottom: 1px solid color-mix(in srgb, var(--lb-picker-text) 7%, transparent);
|
|
2283
2387
|
}
|
|
@@ -2289,13 +2393,16 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2289
2393
|
.lb-mix-match__modal-product-thumb {
|
|
2290
2394
|
position: relative;
|
|
2291
2395
|
width: 48px;
|
|
2292
|
-
height: 48px;
|
|
2293
2396
|
min-width: 48px;
|
|
2397
|
+
/* Modal picker thumbs follow the merchant's pickerThumbnailRatio \u2014
|
|
2398
|
+
independent from the main widget's thumbnailRatio so a merchant can
|
|
2399
|
+
e.g. show tall picker thumbs with square main thumbs. */
|
|
2400
|
+
aspect-ratio: var(--lb-picker-thumbnail-aspect-ratio, 1 / 1);
|
|
2294
2401
|
border-radius: var(--lb-picker-product-radius);
|
|
2295
2402
|
border: var(--lb-picker-product-border-width) solid var(--lb-picker-product-border-color);
|
|
2296
2403
|
box-sizing: border-box;
|
|
2297
2404
|
overflow: visible;
|
|
2298
|
-
background:
|
|
2405
|
+
background: var(--lb-thumbnail-bg);
|
|
2299
2406
|
}
|
|
2300
2407
|
|
|
2301
2408
|
/* Qty badge inside the picker modal inherits picker-product border (width + color) plus
|
|
@@ -2311,8 +2418,10 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2311
2418
|
|
|
2312
2419
|
.lb-mix-match__modal-product-thumb img {
|
|
2313
2420
|
width: 100%;
|
|
2314
|
-
|
|
2315
|
-
|
|
2421
|
+
/* Height + fit come from pickerThumbnailRatio \u2014 "original" sets both
|
|
2422
|
+
to auto/contain so the image renders uncropped at intrinsic ratio. */
|
|
2423
|
+
height: var(--lb-picker-thumbnail-img-height, 100%);
|
|
2424
|
+
object-fit: var(--lb-picker-thumbnail-img-fit, cover);
|
|
2316
2425
|
border-radius: max(0px, calc(var(--lb-picker-product-radius) - var(--lb-picker-product-border-width)));
|
|
2317
2426
|
}
|
|
2318
2427
|
|
|
@@ -2336,6 +2445,17 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2336
2445
|
margin: 4px 0 0;
|
|
2337
2446
|
}
|
|
2338
2447
|
|
|
2448
|
+
.lb-mix-match__modal-product-unit-price {
|
|
2449
|
+
font-size: 11px;
|
|
2450
|
+
line-height: 16px;
|
|
2451
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
2452
|
+
margin: 2px 0 0;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
.lb-mix-match__modal-product-unit-price[hidden] {
|
|
2456
|
+
display: none;
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2339
2459
|
.lb-mix-match__variant-select {
|
|
2340
2460
|
font-size: 12px;
|
|
2341
2461
|
margin: 4px 0 0;
|
|
@@ -2536,7 +2656,7 @@ var BUNDLE_VOLUME_CSS = `/* Lime Bundles \u2014 Volume / Quantity Breaks styles
|
|
|
2536
2656
|
|
|
2537
2657
|
.lb-volume__tier-price {
|
|
2538
2658
|
grid-column: 1 / -1;
|
|
2539
|
-
font-size:
|
|
2659
|
+
font-size: 14px;
|
|
2540
2660
|
font-weight: 500;
|
|
2541
2661
|
color: var(--lb-text);
|
|
2542
2662
|
}
|
|
@@ -2548,7 +2668,7 @@ var BUNDLE_VOLUME_CSS = `/* Lime Bundles \u2014 Volume / Quantity Breaks styles
|
|
|
2548
2668
|
|
|
2549
2669
|
/* Compare-at (strikethrough) price */
|
|
2550
2670
|
.lb-volume__tier-compare {
|
|
2551
|
-
font-size:
|
|
2671
|
+
font-size: 14px;
|
|
2552
2672
|
line-height: 16px;
|
|
2553
2673
|
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
2554
2674
|
text-decoration: line-through;
|