Skip to content

Commit 2c13c8c

Browse files
committed
use dedicated container
1 parent 417c2ba commit 2c13c8c

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

templates/user/dashboard/dashboard.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content dashboard feeds">
33
{{template "user/dashboard/navbar" .}}
44
<div class="ui container flex-container">
5-
<div class="flex-container-main activity-heatmap-container">
5+
<div class="flex-container-main">
66
{{template "base/alert" .}}
77
{{template "user/heatmap" .}}
88
{{if .Page.Paginater.TotalPages}}

templates/user/heatmap.tmpl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{{if .HeatmapData}}
2-
<div id="user-heatmap" class="is-loading"
3-
data-heatmap-data="{{JsonUtils.EncodeToString .HeatmapData}}"
4-
data-locale-total-contributions="{{ctx.Locale.Tr "heatmap.number_of_contributions_in_the_last_12_months" (ctx.Locale.PrettyNumber .HeatmapTotalContributions)}}"
5-
data-locale-no-contributions="{{ctx.Locale.Tr "heatmap.no_contributions"}}"
6-
data-locale-more="{{ctx.Locale.Tr "heatmap.more"}}"
7-
data-locale-less="{{ctx.Locale.Tr "heatmap.less"}}"
8-
></div>
9-
<div class="divider"></div>
2+
<div class="activity-heatmap-container">
3+
<div id="user-heatmap" class="is-loading"
4+
data-heatmap-data="{{JsonUtils.EncodeToString .HeatmapData}}"
5+
data-locale-total-contributions="{{ctx.Locale.Tr "heatmap.number_of_contributions_in_the_last_12_months" (ctx.Locale.PrettyNumber .HeatmapTotalContributions)}}"
6+
data-locale-no-contributions="{{ctx.Locale.Tr "heatmap.no_contributions"}}"
7+
data-locale-more="{{ctx.Locale.Tr "heatmap.more"}}"
8+
data-locale-less="{{ctx.Locale.Tr "heatmap.less"}}"
9+
></div>
10+
<div class="divider"></div>
11+
</div>
1012
{{end}}

templates/user/profile.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="ui four wide column">
66
{{template "shared/user/profile_big_avatar" .}}
77
</div>
8-
<div class="ui twelve wide column tw-mb-4 activity-heatmap-container">
8+
<div class="ui twelve wide column tw-mb-4">
99
{{template "user/overview/header" .}}
1010
{{if eq .TabName "activity"}}
1111
{{if .ContextUser.KeepActivityPrivate}}

web_src/css/features/heatmap.css

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
position: relative;
55
}
66

7-
@supports (container-type: inline-size) {
8-
.activity-heatmap-container {
9-
container: activity-heatmap-container / inline-size;
10-
}
11-
@container activity-heatmap-container (width > 0) {
12-
#user-heatmap {
13-
/* Set element to fixed height so that it does not resize after load. The calculation is complex
14-
because the element does not scale with a fixed aspect ratio. */
15-
height: calc((100cqw / 5) - (100cqw / 25) + 20px);
16-
}
7+
.activity-heatmap-container {
8+
container-type: inline-size;
9+
}
10+
11+
@container (width > 0) {
12+
#user-heatmap {
13+
/* Set element to fixed height so that it does not resize after load. The calculation is complex
14+
because the element does not scale with a fixed aspect ratio. */
15+
height: calc((100cqw / 5) - (100cqw / 25) + 20px);
1716
}
1817
}
1918

0 commit comments

Comments
 (0)