Skip to content

Commit 923a115

Browse files
committed
Fix heatmap rendering in Chrome and Safari
Apparently SVG inside flexbox renders slightly different across browsers where Firefox would stretch to fit the parent while Chrome and safari wouldn't. Stretch the SVG to the width of the parent for consistent rendering. Also did a few minor tweaks on the min-height of the box so it takes up less space on smaller responsive breakpoints. Fixes: go-gitea#13634 Fixes: go-gitea#13637
1 parent 64bd5f4 commit 923a115

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

web_src/less/features/heatmap.less

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
align-items: center;
88
justify-content: center;
99

10+
> svg {
11+
width: 100%;
12+
}
13+
1014
svg:not(:root) {
1115
overflow: inherit;
1216
padding: 0 !important;
@@ -16,13 +20,6 @@
1620
fill: currentColor !important;
1721
}
1822

19-
@media @mediaLgAndDown {
20-
&,
21-
& + .divider {
22-
display: none;
23-
}
24-
}
25-
2623
.total-contributions {
2724
font-size: 11px;
2825
position: absolute;
@@ -31,12 +28,18 @@
3128
}
3229

3330
@media @mediaLgAndDown {
31+
& {
32+
min-height: 105px;
33+
}
3434
.total-contributions {
3535
left: 21px;
3636
}
3737
}
3838

3939
@media (max-width: 1000px) {
40+
& {
41+
min-height: 80px;
42+
}
4043
.total-contributions {
4144
font-size: 10px;
4245
left: 17px;
@@ -48,3 +51,15 @@
4851
.user.profile #user-heatmap {
4952
min-height: 135px;
5053
}
54+
55+
@media @mediaLgAndDown {
56+
.user.profile #user-heatmap {
57+
min-height: 115px;
58+
}
59+
}
60+
61+
@media (max-width: 1000px) {
62+
.user.profile #user-heatmap {
63+
min-height: 90px;
64+
}
65+
}

0 commit comments

Comments
 (0)