@sc-360-v2/storefront-cms-library 0.5.72 → 0.5.74
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/builder.js +1 -1
- package/dist/builderLite.js +1 -1
- package/dist/global-styles.scss +202 -198
- package/dist/option-families.scss +252 -0
- package/dist/product-actions.scss +401 -0
- package/dist/quantity-selector.scss +1074 -1074
- package/dist/types/builder/enums/data-connectors.d.ts +3 -1
- package/dist/types/builder/enums/index.d.ts +3 -1
- package/dist/types/builder/tools/element-edit/index.d.ts +2 -1
- package/dist/types/builder/tools/element-edit/optionFamilies.d.ts +20 -0
- package/dist/types/website/constants/data-connector-souces.d.ts +40 -8
- package/dist/types/website/constants/data-connectors.d.ts +12 -1
- package/dist/types/website/helper/ssr-functions.d.ts +8 -0
- package/dist/website.js +1 -1
- package/dist/widget.scss +1 -0
- package/package.json +1 -1
package/dist/global-styles.scss
CHANGED
|
@@ -1,198 +1,202 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
@use "sass:list";
|
|
3
|
-
@use "./functions.scss" as *;
|
|
4
|
-
|
|
5
|
-
.custom-upload {
|
|
6
|
-
display: flex;
|
|
7
|
-
&:has(.preview_image_container) {
|
|
8
|
-
justify-content: space-between;
|
|
9
|
-
}
|
|
10
|
-
align-items: center;
|
|
11
|
-
border: 1px solid var(--_gray-300);
|
|
12
|
-
background-color: var(--_base-white);
|
|
13
|
-
padding: 16px;
|
|
14
|
-
border-radius: 4px;
|
|
15
|
-
gap: 12px;
|
|
16
|
-
.preview_image_container {
|
|
17
|
-
width: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
gap: 12px;
|
|
21
|
-
.image_title {
|
|
22
|
-
font-size: 14px;
|
|
23
|
-
margin-top: 3px;
|
|
24
|
-
.label {
|
|
25
|
-
color: var(--_thm-cs-at-sy);
|
|
26
|
-
@include restrictToLinesShow(1);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
.preview_image {
|
|
30
|
-
height: 36px;
|
|
31
|
-
width: 36px;
|
|
32
|
-
border-radius: 50%;
|
|
33
|
-
padding: 4px;
|
|
34
|
-
background: var(--_base-white);
|
|
35
|
-
border: 1px solid var(--_gray-300);
|
|
36
|
-
img {
|
|
37
|
-
width: 100%;
|
|
38
|
-
width: 100%;
|
|
39
|
-
object-fit: contain;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
.clear_upload_icon {
|
|
44
|
-
svg {
|
|
45
|
-
width: 18px;
|
|
46
|
-
height: 18px;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
.uploadicon {
|
|
50
|
-
padding: 8px;
|
|
51
|
-
display: flex;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
align-items: center;
|
|
54
|
-
background: var(--_gray-200);
|
|
55
|
-
outline: 6px solid var(--_gray-100);
|
|
56
|
-
border-radius: 50%;
|
|
57
|
-
height: 36px;
|
|
58
|
-
width: 36px;
|
|
59
|
-
.svg_icon {
|
|
60
|
-
svg {
|
|
61
|
-
width: 20px;
|
|
62
|
-
height: 20px;
|
|
63
|
-
path {
|
|
64
|
-
stroke: var(--_gray-700);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.file_upload_text {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
gap: 8px;
|
|
74
|
-
.label {
|
|
75
|
-
@include restrictToLinesShow(1);
|
|
76
|
-
}
|
|
77
|
-
p {
|
|
78
|
-
color: var(--_thm-cs-at-py);
|
|
79
|
-
font-weight: 600;
|
|
80
|
-
}
|
|
81
|
-
span {
|
|
82
|
-
color: var(--_thm-cs-at-sy);
|
|
83
|
-
font-size: 14px;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Skeleton for the reused ProductOptions swatches (rendered inside the CMS
|
|
89
|
-
// builder/preview, e.g. the Category Groups product cards). Mirrors the website
|
|
90
|
-
// globals so the swatch placeholders keep their spacing here too.
|
|
91
|
-
.product_options_skeleton {
|
|
92
|
-
width: 100%;
|
|
93
|
-
.sklts_swatch {
|
|
94
|
-
display: flex;
|
|
95
|
-
gap: 8px;
|
|
96
|
-
margin-bottom: 8px;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Skeleton base styles (mirrored from storefront-websites globals so reused
|
|
101
|
-
// element skeletons render identically inside the CMS builder/preview).
|
|
102
|
-
.skeleton {
|
|
103
|
-
background-color: #e5e7eb !important;
|
|
104
|
-
border: none !important;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
&--
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
//
|
|
188
|
-
// that
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:list";
|
|
3
|
+
@use "./functions.scss" as *;
|
|
4
|
+
|
|
5
|
+
.custom-upload {
|
|
6
|
+
display: flex;
|
|
7
|
+
&:has(.preview_image_container) {
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
}
|
|
10
|
+
align-items: center;
|
|
11
|
+
border: 1px solid var(--_gray-300);
|
|
12
|
+
background-color: var(--_base-white);
|
|
13
|
+
padding: 16px;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
gap: 12px;
|
|
16
|
+
.preview_image_container {
|
|
17
|
+
width: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: 12px;
|
|
21
|
+
.image_title {
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
margin-top: 3px;
|
|
24
|
+
.label {
|
|
25
|
+
color: var(--_thm-cs-at-sy);
|
|
26
|
+
@include restrictToLinesShow(1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
.preview_image {
|
|
30
|
+
height: 36px;
|
|
31
|
+
width: 36px;
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
padding: 4px;
|
|
34
|
+
background: var(--_base-white);
|
|
35
|
+
border: 1px solid var(--_gray-300);
|
|
36
|
+
img {
|
|
37
|
+
width: 100%;
|
|
38
|
+
width: 100%;
|
|
39
|
+
object-fit: contain;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
.clear_upload_icon {
|
|
44
|
+
svg {
|
|
45
|
+
width: 18px;
|
|
46
|
+
height: 18px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.uploadicon {
|
|
50
|
+
padding: 8px;
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
background: var(--_gray-200);
|
|
55
|
+
outline: 6px solid var(--_gray-100);
|
|
56
|
+
border-radius: 50%;
|
|
57
|
+
height: 36px;
|
|
58
|
+
width: 36px;
|
|
59
|
+
.svg_icon {
|
|
60
|
+
svg {
|
|
61
|
+
width: 20px;
|
|
62
|
+
height: 20px;
|
|
63
|
+
path {
|
|
64
|
+
stroke: var(--_gray-700);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.file_upload_text {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
gap: 8px;
|
|
74
|
+
.label {
|
|
75
|
+
@include restrictToLinesShow(1);
|
|
76
|
+
}
|
|
77
|
+
p {
|
|
78
|
+
color: var(--_thm-cs-at-py);
|
|
79
|
+
font-weight: 600;
|
|
80
|
+
}
|
|
81
|
+
span {
|
|
82
|
+
color: var(--_thm-cs-at-sy);
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Skeleton for the reused ProductOptions swatches (rendered inside the CMS
|
|
89
|
+
// builder/preview, e.g. the Category Groups product cards). Mirrors the website
|
|
90
|
+
// globals so the swatch placeholders keep their spacing here too.
|
|
91
|
+
.product_options_skeleton {
|
|
92
|
+
width: 100%;
|
|
93
|
+
.sklts_swatch {
|
|
94
|
+
display: flex;
|
|
95
|
+
gap: 8px;
|
|
96
|
+
margin-bottom: 8px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Skeleton base styles (mirrored from storefront-websites globals so reused
|
|
101
|
+
// element skeletons render identically inside the CMS builder/preview).
|
|
102
|
+
.skeleton {
|
|
103
|
+
background-color: #e5e7eb !important;
|
|
104
|
+
border: none !important;
|
|
105
|
+
// One radius for every placeholder, never the element's schema radius — see the
|
|
106
|
+
// note on `.skeleton` in storefront-websites globals.scss. `!important` beats both
|
|
107
|
+
// the element classes templates reuse and the Skeleton component's inline `br`.
|
|
108
|
+
border-radius: 4px !important;
|
|
109
|
+
min-height: 8px;
|
|
110
|
+
position: relative;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
display: block;
|
|
113
|
+
|
|
114
|
+
&--rectangular {
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&--circular {
|
|
120
|
+
// The only exception to 6px; needs `!important` to survive the base rule.
|
|
121
|
+
border-radius: 50% !important;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&--text {
|
|
125
|
+
transform-origin: 0 55%;
|
|
126
|
+
transform: scale(1, 0.6);
|
|
127
|
+
|
|
128
|
+
&::before {
|
|
129
|
+
content: "\00a0";
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&--shimmer {
|
|
134
|
+
&::after {
|
|
135
|
+
content: "";
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 0;
|
|
138
|
+
left: 0;
|
|
139
|
+
right: 0;
|
|
140
|
+
bottom: 0;
|
|
141
|
+
background: linear-gradient(
|
|
142
|
+
90deg,
|
|
143
|
+
transparent 0%,
|
|
144
|
+
rgba(255, 255, 255, 0.4) 50%,
|
|
145
|
+
transparent 100%
|
|
146
|
+
);
|
|
147
|
+
animation: skeleton-shimmer 1.5s infinite;
|
|
148
|
+
transform: translateX(-100%);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&--pulse {
|
|
153
|
+
animation: skeleton-pulse 1.5s ease-in-out infinite;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@keyframes skeleton-shimmer {
|
|
158
|
+
0% {
|
|
159
|
+
transform: translateX(-100%);
|
|
160
|
+
}
|
|
161
|
+
100% {
|
|
162
|
+
transform: translateX(100%);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@keyframes skeleton-pulse {
|
|
167
|
+
0%,
|
|
168
|
+
100% {
|
|
169
|
+
opacity: 1;
|
|
170
|
+
}
|
|
171
|
+
50% {
|
|
172
|
+
opacity: 0.5;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.skeleton__element {
|
|
177
|
+
@extend .skeleton;
|
|
178
|
+
@extend .skeleton--shimmer;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Text Overflow fallback.
|
|
182
|
+
//
|
|
183
|
+
// Text Overflow is a `controls` property, not a CSS one, so it cannot travel to the
|
|
184
|
+
// stylesheet as a variable — the renderer opts a text node in with `.flex__overflow`
|
|
185
|
+
// and carries the line count in `--_sf-line-clamp`.
|
|
186
|
+
//
|
|
187
|
+
// This is the clamp declared once, for every text node whose own block does not set a
|
|
188
|
+
// competing `display`. Blocks that do (a flex label, say) carry their own scoped
|
|
189
|
+
// `&.flex__overflow` rule, since this one is a single class and would lose to them.
|
|
190
|
+
//
|
|
191
|
+
// The class is only ever emitted when the toggle is on, so this cannot clamp a node
|
|
192
|
+
// that was not asked to be clamped.
|
|
193
|
+
//
|
|
194
|
+
// Mirrored in storefront-cms-library/src/components/css/widgets/global-styles.scss —
|
|
195
|
+
// change one, copy it across.
|
|
196
|
+
.flex__overflow {
|
|
197
|
+
// A clamp can only reach its second line if the text is allowed to wrap, so this
|
|
198
|
+
// undoes any `white-space: nowrap` the node carries — the same thing the hand-written
|
|
199
|
+
// clamps in allocations-quota-details.scss and friends do.
|
|
200
|
+
white-space: normal;
|
|
201
|
+
@include restrictToLinesShow(#{var(--_sf-line-clamp, 1)});
|
|
202
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
@use "./functions.scss" as *;
|
|
2
|
+
|
|
3
|
+
// Option Families — swatch tiles of option families ("Shop by Color"): every family, the ones
|
|
4
|
+
// picked in Choose Item, or one per row when repeated by a Repeater.
|
|
5
|
+
//
|
|
6
|
+
// Variable names come from the builderData keys in element-edit/optionFamilies.ts:
|
|
7
|
+
// layout.swatchHeight -> --_ctm-lt-sh-ht
|
|
8
|
+
// design.tile.* -> --_ctm-dn-te-*
|
|
9
|
+
// design.swatch.* -> --_ctm-dn-sh-*
|
|
10
|
+
// design.image.* -> --_ctm-dn-ie-*
|
|
11
|
+
// design.label.* -> --_ctm-dn-ll-*
|
|
12
|
+
// Keep this file in step with storefront-cms-library/src/components/css/widgets/option-families.scss.
|
|
13
|
+
|
|
14
|
+
[data-div-type="element"] {
|
|
15
|
+
&[data-element-type="optionFamilies"] {
|
|
16
|
+
// Reads the percentage the left/right resize handles write, same as Quota Details.
|
|
17
|
+
width: var(
|
|
18
|
+
--_sf-el-wh-st-mx,
|
|
19
|
+
calc(
|
|
20
|
+
1% * var(--_ctm-mob-ele-nw-wh-vl, var(--_ctm-tab-ele-nw-wh-vl, var(--_ctm-ele-nw-wh-vl)))
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
min-width: 64px;
|
|
24
|
+
margin: prepareMediaVariable(--_ctm-lt-mn, 0);
|
|
25
|
+
|
|
26
|
+
& > .wrapper {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Connected on its own the element holds every family shown in Choose Item, one tile each,
|
|
32
|
+
// side by side in a single row that shares the element's width. Inside a Repeater it holds one.
|
|
33
|
+
.option__families__list {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-wrap: nowrap;
|
|
36
|
+
gap: 12px;
|
|
37
|
+
width: 100%;
|
|
38
|
+
|
|
39
|
+
& > * {
|
|
40
|
+
flex: 1 1 0;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.option__families__tile {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: prepareMediaVariable(--_ctm-dn-te-im-gp);
|
|
49
|
+
width: 100%;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
padding: prepareMediaVariable(--_ctm-lt-pg, 8px);
|
|
52
|
+
color: inherit;
|
|
53
|
+
text-decoration: none;
|
|
54
|
+
background-color: prepareMediaVariable(--_ctm-dn-te-bd-cr, #ffffff);
|
|
55
|
+
border-color: prepareMediaVariable(--_ctm-dn-te-br-cr, #eaecf0);
|
|
56
|
+
border-style: prepareMediaVariable(--_ctm-dn-te-br-se, solid);
|
|
57
|
+
border-width: prepareMediaVariable(--_ctm-dn-te-br-wh, 1px);
|
|
58
|
+
border-radius: prepareMediaVariable(--_ctm-dn-te-br-rs, 6px);
|
|
59
|
+
box-shadow: var(
|
|
60
|
+
--_sf-of-te-show-shadow,
|
|
61
|
+
prepareMediaVariable(--_ctm-dn-te-sw-ae, 0px 0px)
|
|
62
|
+
prepareMediaVariable(--_ctm-dn-te-sw-br, 0px)
|
|
63
|
+
prepareMediaVariable(--_ctm-dn-te-sw-sd, 0px)
|
|
64
|
+
prepareMediaVariable(--_ctm-dn-te-sw-cr, transparent)
|
|
65
|
+
);
|
|
66
|
+
transition: transform 0.15s ease;
|
|
67
|
+
|
|
68
|
+
&[data-has-link="true"] {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
|
|
71
|
+
// &:hover {
|
|
72
|
+
// transform: translateY(-2px);
|
|
73
|
+
// }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&[data-tile-shadow="false"] .option__families__tile {
|
|
78
|
+
--_sf-of-te-show-shadow: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.option__families__swatch {
|
|
82
|
+
position: relative;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: flex-end;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: prepareMediaVariable(--_ctm-lt-sh-ht, 88px);
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
// `--_sf-of-swatch` is the row's hex colour, set on the element by the renderer.
|
|
91
|
+
background-color: var(--_sf-of-swatch, #d0d5dd);
|
|
92
|
+
border-color: prepareMediaVariable(--_ctm-dn-sh-br-cr, #eaecf0);
|
|
93
|
+
border-style: prepareMediaVariable(--_ctm-dn-sh-br-se, solid);
|
|
94
|
+
border-width: prepareMediaVariable(--_ctm-dn-sh-br-wh, 0px);
|
|
95
|
+
border-radius: prepareMediaVariable(--_ctm-dn-sh-br-rs, 4px);
|
|
96
|
+
box-shadow: var(
|
|
97
|
+
--_sf-of-sh-show-shadow,
|
|
98
|
+
prepareMediaVariable(--_ctm-dn-sh-sw-ae, 0px 0px)
|
|
99
|
+
prepareMediaVariable(--_ctm-dn-sh-sw-br, 0px)
|
|
100
|
+
prepareMediaVariable(--_ctm-dn-sh-sw-sd, 0px)
|
|
101
|
+
prepareMediaVariable(--_ctm-dn-sh-sw-cr, transparent)
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// Measured by SwatchImage (OptionFamilies.tsx) for the size it asks the CDN for.
|
|
105
|
+
.option__families__image-frame {
|
|
106
|
+
position: absolute;
|
|
107
|
+
inset: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.option__families__image {
|
|
111
|
+
position: absolute;
|
|
112
|
+
inset: 0;
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 100%;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
object-fit: cover;
|
|
117
|
+
object-position: center;
|
|
118
|
+
background-color: prepareMediaVariable(--_ctm-dn-ie-bd-cr, transparent);
|
|
119
|
+
border-color: prepareMediaVariable(--_ctm-dn-ie-br-cr, #eaecf0);
|
|
120
|
+
border-style: prepareMediaVariable(--_ctm-dn-ie-br-se, solid);
|
|
121
|
+
border-width: prepareMediaVariable(--_ctm-dn-ie-br-wh, 0px);
|
|
122
|
+
border-radius: prepareMediaVariable(--_ctm-dn-ie-br-rs, 0px);
|
|
123
|
+
transition: transform 0.3s ease-in-out;
|
|
124
|
+
// Fit Options and Image Position are applied by the image CDN (scale.option /
|
|
125
|
+
// canvas.position in the request URL, see OptionFamilies.tsx), which returns an
|
|
126
|
+
// image of exactly the swatch's size — so nothing to fit here.
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.option__families__label {
|
|
130
|
+
position: relative;
|
|
131
|
+
z-index: 2;
|
|
132
|
+
padding: 0 6px 8px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Layout > Image Settings > On Hover. The swatch clips it (overflow: hidden), so the
|
|
137
|
+
// zoom stays inside the tile. Zoom Out is a visible 0.92 — the Image element's 0.9998
|
|
138
|
+
// is too small to see on a swatch this size.
|
|
139
|
+
.option__families__tile:hover .option__families__image {
|
|
140
|
+
&[data-on-hover="Zoom In"] {
|
|
141
|
+
transform: scale(1.08);
|
|
142
|
+
}
|
|
143
|
+
&[data-on-hover="Zoom Out"] {
|
|
144
|
+
transform: scale(0.92);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Layout > Swatch Shape. Rectangle is the default above: a full-width tile and swatch, with
|
|
149
|
+
// the Border Radius set in Design for each. Square and Circle make the swatch Swatch Height on
|
|
150
|
+
// each side and shrink the tile around it, so every border — tile, swatch and image — takes
|
|
151
|
+
// the shape: square corners for Square, round for Circle. There the shape decides the corners
|
|
152
|
+
// and the Design > Border Radius controls do not apply.
|
|
153
|
+
&[data-swatch-shape="square"],
|
|
154
|
+
&[data-swatch-shape="circle"] {
|
|
155
|
+
.option__families__tile {
|
|
156
|
+
flex: 0 1 auto;
|
|
157
|
+
width: fit-content;
|
|
158
|
+
max-width: 100%;
|
|
159
|
+
margin-inline: auto;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.option__families__swatch {
|
|
163
|
+
width: prepareMediaVariable(--_ctm-lt-sh-ht, 88px);
|
|
164
|
+
max-width: 100%;
|
|
165
|
+
align-self: center;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// &[data-swatch-shape="square"] {
|
|
170
|
+
// .option__families__tile,
|
|
171
|
+
// .option__families__swatch,
|
|
172
|
+
// .option__families__image {
|
|
173
|
+
// border-radius: 0;
|
|
174
|
+
// }
|
|
175
|
+
// }
|
|
176
|
+
|
|
177
|
+
&[data-swatch-shape="circle"] {
|
|
178
|
+
// The swatch and its image are square boxes, so 50% makes them round.
|
|
179
|
+
.option__families__swatch,
|
|
180
|
+
.option__families__image {
|
|
181
|
+
border-radius: 50%;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// With the name inside the swatch the tile is square too (swatch plus even padding) and
|
|
185
|
+
// 50% draws a circle. A name below makes it taller than wide, where 50% would draw an
|
|
186
|
+
// oval, so it becomes a pill instead.
|
|
187
|
+
&[data-label-position="inside"] .option__families__tile {
|
|
188
|
+
border-radius: 50%;
|
|
189
|
+
}
|
|
190
|
+
&[data-label-position="below"] .option__families__tile {
|
|
191
|
+
border-radius: 9999px;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&[data-swatch-shadow="false"] .option__families__swatch {
|
|
196
|
+
--_sf-of-sh-show-shadow: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.option__families__label {
|
|
200
|
+
display: block;
|
|
201
|
+
min-width: 0;
|
|
202
|
+
overflow-wrap: anywhere;
|
|
203
|
+
color: prepareMediaVariable(--_ctm-dn-ll-cr, #ffffff);
|
|
204
|
+
font-family: prepareMediaVariable(--_ctm-dn-ll-ft-fy);
|
|
205
|
+
font-size: prepareMediaVariable(--_ctm-dn-ll-ft-se, 14px);
|
|
206
|
+
font-weight: prepareMediaVariable(--_ctm-dn-ll-ft-wt, bold);
|
|
207
|
+
font-style: prepareMediaVariable(--_ctm-dn-ll-ft-se-ic);
|
|
208
|
+
text-align: prepareMediaVariable(--_ctm-dn-ll-tt-an, center);
|
|
209
|
+
letter-spacing: prepareMediaVariable(--_ctm-dn-ll-lr-sg);
|
|
210
|
+
line-height: prepareMediaVariable(--_ctm-dn-ll-le-ht);
|
|
211
|
+
text-decoration: prepareMediaVariable(--_ctm-dn-ll-ue);
|
|
212
|
+
text-transform: prepareMediaVariable(--_ctm-dn-ll-tt-tm, uppercase);
|
|
213
|
+
box-sizing: border-box;
|
|
214
|
+
max-width: 100%;
|
|
215
|
+
|
|
216
|
+
// Design > Label > Typography > Text Overflow: N lines, then an ellipsis. `--_sf-line-clamp`
|
|
217
|
+
// is set on the label by the renderer. `overflow-wrap: anywhere` above would break a long
|
|
218
|
+
// word across lines before the ellipsis could apply, so the clamp restores normal wrapping.
|
|
219
|
+
&.flex__overflow {
|
|
220
|
+
@include restrictToLinesShow(#{var(--_sf-line-clamp, 1)});
|
|
221
|
+
overflow-wrap: normal;
|
|
222
|
+
word-break: normal;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// A Square or Circle tile is only as wide as its content. A label below the swatch would
|
|
227
|
+
// widen it to fit the whole name, leaving nothing to clamp; this makes the label take the
|
|
228
|
+
// tile's width (set by the swatch) without adding to it.
|
|
229
|
+
&[data-swatch-shape="square"],
|
|
230
|
+
&[data-swatch-shape="circle"] {
|
|
231
|
+
&[data-label-position="below"] .option__families__tile > .option__families__label {
|
|
232
|
+
width: 0;
|
|
233
|
+
min-width: 100%;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Light swatches get a faint inner edge so they don't melt into a white tile. An
|
|
238
|
+
// outline, not the border: the border width holds four values and is the merchant's.
|
|
239
|
+
.option__families__swatch[data-light="true"] {
|
|
240
|
+
outline: 1px solid rgba(16, 24, 40, 0.12);
|
|
241
|
+
outline-offset: -1px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// A white label disappears on white/cream swatches. Only while the label sits inside
|
|
245
|
+
// the swatch — below it, the label is on the tile and keeps its own colour.
|
|
246
|
+
&[data-label-position="inside"]
|
|
247
|
+
.option__families__swatch[data-light="true"]
|
|
248
|
+
.option__families__label {
|
|
249
|
+
color: #344054;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|