Skip to content

Commit e761360

Browse files
committed
Change the layout of the view page from CSS Grid to Flexbox
1 parent 3b41bea commit e761360

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

templates/repo/view.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
{{template "repo/code/recently_pushed_new_branches" .}}
1818

19-
<div class="{{Iif .RepoPreferences.ShowFileViewTreeSidebar "repo-view-with-sidebar" "repo-view-content-only"}}">
19+
<div class="repo-view-container {{Iif .RepoPreferences.ShowFileViewTreeSidebar "repo-view-with-sidebar" "repo-view-content-only"}}">
2020
<div class="repo-view-file-tree-sidebar not-mobile {{if not .RepoPreferences.ShowFileViewTreeSidebar}}tw-hidden{{end}}" {{if .IsSigned}} data-is-signed {{end}}>{{template "repo/view_file_tree_sidebar" .}}</div>
2121
<div class="repo-view-content">
2222
{{template "repo/view_content" .}}

web_src/css/repo/home.css

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,22 @@
4949
}
5050
}
5151

52-
.repo-view-with-sidebar {
53-
display: grid;
54-
grid-template-columns: 300px auto;
55-
grid-template-rows: auto auto 1fr;
52+
.repo-view-container {
53+
display: flex;
54+
flex-wrap: wrap;
55+
gap: var(--page-spacing);
5656
}
5757

5858
.repo-view-content {
59-
min-width: 0;
60-
grid-column: 1;
61-
grid-row: 1 / 4;
62-
}
63-
64-
.repo-view-with-sidebar .repo-view-content {
65-
min-width: 0;
66-
grid-column: 2;
67-
grid-row: 1 / 4;
68-
margin-left: 1rem;
59+
flex: 1;
6960
}
7061

7162
#view-file-tree.is-loading {
7263
aspect-ratio: 5.415; /* the size is about 790 x 145 */
7364
}
7465

7566
.repo-view-with-sidebar .repo-view-file-tree-sidebar {
67+
flex: 0 1 15%;
7668
display: flex;
7769
flex-direction: column;
7870
gap: 8px;
@@ -83,18 +75,16 @@
8375
z-index: 8;
8476
}
8577

86-
.repo-view-with-sidebar .repo-button-row {
78+
.repo-view-container .repo-button-row {
8779
margin-top: 0 !important;
8880
}
8981

9082
@media (max-width: 767.98px) {
9183
.repo-view-with-sidebar {
92-
grid-template-columns: auto;
93-
grid-template-rows: auto auto auto;
84+
flex: 1 1 0;
9485
}
9586
.repo-view-content {
96-
grid-column: 1;
97-
grid-row: 2;
87+
flex: 1 1 0;
9888
}
9989
}
10090

0 commit comments

Comments
 (0)