Skip to content

Commit 42189d0

Browse files
Fix/sizes overflows (#179)
* fix: overflow price at popup mobile * fix: change font-size & line-height from px to rem * feat: change img to picture to support srcset * fix: change countdown font size from px to rem
1 parent 689ed8e commit 42189d0

File tree

2 files changed

+67
-56
lines changed

2 files changed

+67
-56
lines changed

clips/popup-banner/clip/clip.css

Lines changed: 56 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
align-items: center;
3737
border: 1px solid var(--cta-color);
3838
color: var(--cta-color);
39-
font-size: 12px;
40-
line-height: 14px;
39+
font-size: 0.75rem;
40+
line-height: 0.875rem;
4141
align-self: flex-start;
4242
}
4343

@@ -72,9 +72,9 @@
7272
}
7373

7474
.title {
75-
font-size: 30px;
75+
font-size: 1.875rem;
7676
font-weight: 700;
77-
line-height: 34px;
77+
line-height: 2.125rem;
7878
display: -webkit-box;
7979
-webkit-line-clamp: 3;
8080
-webkit-box-orient: vertical;
@@ -83,9 +83,9 @@
8383
}
8484

8585
.subtitle {
86-
font-size: 18px;
86+
font-size: 1.125rem;
8787
font-weight: 300;
88-
line-height: 26px;
88+
line-height: 1.625rem;
8989
display: -webkit-box;
9090
-webkit-line-clamp: 3;
9191
-webkit-box-orient: vertical;
@@ -98,9 +98,8 @@
9898
width: 390px;
9999
padding: 10px;
100100
justify-content: space-between;
101-
gap: 5px; /*min-gap*/
101+
gap: 9px; /*min-gap*/
102102
align-items: center;
103-
border-radius: 4px;
104103
position: absolute;
105104
bottom: 30px;
106105
color: var(--product-text-color);
@@ -113,19 +112,19 @@
113112
-webkit-line-clamp: 2;
114113
-webkit-box-orient: vertical;
115114
text-overflow: ellipsis;
116-
font-size: 14px;
115+
font-size: 0.875rem;
117116
font-style: normal;
118117
font-weight: 400;
119-
line-height: 17px;
118+
line-height: normal;
120119
}
121120

122121
.price-wrapper {
123122
display: flex;
124123
justify-content: flex-end;
125124
align-items: center;
126125
gap: 9px;
127-
font-size: 16px;
128-
line-height: 16px;
126+
font-size: 1rem;
127+
line-height: 1rem;
129128
}
130129

131130
.new-price {
@@ -242,14 +241,14 @@
242241
}
243242

244243
.value {
245-
font-size: 30px;
246-
line-height: 30px;
244+
font-size: 1.875rem;
245+
line-height: 1.875rem;
247246
}
248247

249248
.countdown-text {
250-
font-size: 11px;
251-
line-height: 11px;
252-
letter-spacing: 1.1px;
249+
font-size: 0.6875rem;
250+
line-height: 0.6875rem;
251+
letter-spacing: 0.06875rem;
253252
}
254253

255254
.info-product-details {
@@ -270,7 +269,8 @@
270269
display: flex;
271270
padding: 11.683px 15.577px;
272271
align-self: stretch;
273-
font-size: 10px;
272+
font-size: 0.625rem;
273+
line-height: 0.625rem;
274274
}
275275

276276
.products-bg {
@@ -337,6 +337,9 @@
337337
width: 302px;
338338
height: 360px;
339339
}
340+
.cta-countdown {
341+
width: 302px;
342+
}
340343

341344
.cta-countdown {
342345
gap: 30px;
@@ -347,12 +350,12 @@
347350
}
348351

349352
.title {
350-
font-size: 23px;
351-
line-height: 26px;
353+
font-size: 1.4375rem;
354+
line-height: 1.625rem;
352355
}
353356
.subtitle {
354-
font-size: 14px;
355-
line-height: 20px;
357+
font-size: 0.875rem;
358+
line-height: 1.25rem; /* 142.857% */
356359
}
357360

358361
.abstract-lines1-wrapper {
@@ -367,15 +370,15 @@
367370
}
368371

369372
.product-description {
370-
width: 180px;
371-
height: 30px;
372-
min-width: 180px;
373-
max-width: 202.507px;
374-
font-size: 11px;
373+
max-width: 180px;
374+
font-size: 0.688rem;
375+
line-height: 0.81rem;
375376
}
377+
376378
.price-wrapper {
377379
gap: 9px;
378-
font-size: 13px;
380+
font-size: 0.8125rem;
381+
line-height: 0.75rem;
379382
}
380383
}
381384

@@ -472,8 +475,8 @@
472475

473476
.title {
474477
width: 436px;
475-
font-size: 1.8rem;
476-
line-height: 26px;
478+
font-size: 1.5rem;
479+
line-height: 1.55rem;
477480
-webkit-line-clamp: 2;
478481
}
479482

@@ -491,6 +494,8 @@
491494
transform-origin: top left;
492495
transform: scale(0.6);
493496
display: block;
497+
margin-top: -3px;
498+
margin-bottom: -8px;
494499
}
495500

496501
.product-details {
@@ -500,11 +505,11 @@
500505
.info-product-wrapper {
501506
width: 436px;
502507
position: relative;
503-
height: 40px;
508+
height: 47px;
504509
}
505510
.info-product {
506511
width: 436px;
507-
height: 40px;
512+
height: 47px;
508513
position: absolute;
509514
right: 0px;
510515
width: 0;
@@ -516,7 +521,7 @@
516521
display: flex;
517522
flex-direction: column;
518523
align-items: flex-start;
519-
gap: 10px;
524+
gap: 8px;
520525
color: var(--text-color);
521526
right: 0;
522527
background-color: var(--text-bg-color);
@@ -532,7 +537,7 @@
532537
}
533538

534539
.countdown {
535-
gap: 5px;
540+
gap: 3px;
536541
width: 150px;
537542
height: 37px;
538543
align-items: center;
@@ -544,21 +549,21 @@
544549
flex-direction: row;
545550
gap: 0px;
546551
color: var(--cta-color);
547-
width: 19px;
552+
width: 1rem;
548553
}
549554

550555
.value {
551-
font-size: 15px;
552-
line-height: 15px;
556+
font-size: 0.75rem;
557+
line-height: 1.5rem;
553558
}
554559

555560
.countdown-text {
556561
display: none;
557562
}
558563

559564
.d {
560-
font-size: 15px;
561-
line-height: 15px;
565+
font-size: 0.75rem;
566+
line-height: 1.5rem;
562567
display: block;
563568
}
564569
}
@@ -642,9 +647,8 @@
642647
}
643648

644649
.title {
645-
font-size: 1.5rem;
646-
line-height: 16px;
647-
margin-bottom: -10px;
650+
font-size: 1.1rem;
651+
line-height: 1.15rem;
648652
max-width: 259px;
649653
-webkit-line-clamp: 2;
650654
}
@@ -663,6 +667,7 @@
663667
transform-origin: top left;
664668
transform: scale(0.35);
665669
display: block;
670+
margin-top: -10px;
666671
margin-bottom: -18px;
667672
}
668673

@@ -698,12 +703,13 @@
698703
.product-description {
699704
max-width: 259px;
700705
-webkit-line-clamp: 1;
701-
font-size: 12px;
702-
line-height: 20px;
706+
font-size: 0.75rem;
707+
line-height: normal;
703708
}
704709
.price-wrapper {
705710
gap: 9px;
706-
font-size: 13px;
711+
font-size: 0.875rem;
712+
line-height: 1rem;
707713
}
708714

709715
.countdown-mini {
@@ -723,17 +729,17 @@
723729
flex-direction: row;
724730
gap: 0px;
725731
color: var(--cta-color);
726-
width: 14px;
732+
width: 0.95rem;
727733
}
728734

729735
.value {
730-
font-size: 12px;
731-
line-height: 12px;
736+
font-size:0.75rem;
737+
line-height:0.75rem;
732738
}
733739

734740
.d {
735-
font-size: 12px;
736-
line-height: 12px;
741+
font-size:0.75rem;
742+
line-height:0.75rem;
737743
display: block;
738744
}
739745
}

clips/popup-banner/clip/clip.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
<div class="info-cta">
44
<div class="info">
55
<div class="details-wrapper">
6-
<img
7-
mc-if="initParams.logo.length > 0"
8-
class="logo"
9-
src="{{initParams.logo.default}}"
10-
alt="logo"
11-
/>
6+
<picture mc-if="initParams.logo.default" class="logo">
7+
<source
8+
class="logo"
9+
mc-for="key,item"
10+
mc-of="initParams.logo"
11+
mc-if="{{key}}!='default'"
12+
srcset="{{item}}"
13+
media="{{key}}"
14+
/>
15+
<img alt="logo" src="{{initParams.logo.default}}" class="logo" />
16+
</picture>
1217
<div class="abstract-lines2-wrapper">
1318
<svg
1419
width="119"

0 commit comments

Comments
 (0)