Skip to content

Commit 3e7101d

Browse files
authored
Improve "new-menu" (#24465)
I am not sure what "new-menu" means, but I think we need to fix these problems: 1. it shouldn't have "stackable", which makes the items stacked when width is small. the `new-menu` already has `overflow: auto` 2. `justify-content: center` doesn't work with `overflow: auto` (for small width), so use `margin: auto` * https://bhch.github.io/posts/2021/04/centring-flex-items-and-allowing-overflow-scroll/ 3. `runner-new-menu` is dead code (copying & pasting ?)
1 parent 5adf32b commit 3e7101d

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

templates/explore/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="ui secondary pointing tabular top attached borderless stackable menu new-menu navbar">
1+
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
22
<a class="{{if .PageIsExploreRepositories}}active {{end}}item" href="{{AppSubUrl}}/explore/repos">
33
{{svg "octicon-repo"}} {{.locale.Tr "explore.repos"}}
44
</a>

templates/repo/diff/image_diff.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<tr>
33
<td colspan="2">
44
<div class="image-diff" data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}" data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}">
5-
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu">
5+
<div class="ui secondary pointing tabular top attached borderless menu new-menu">
66
<div class="new-menu-inner">
77
<a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a>
88
{{if and .blobBase .blobHead}}

templates/user/auth/signup_openid_navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu navbar">
1+
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
22
<div class="new-menu-inner">
33
<a class="{{if .PageIsOpenIDConnect}}active {{end}}item" href="{{AppSubUrl}}/user/openid/connect">
44
{{.locale.Tr "auth.openid_connect_title"}}

web_src/css/base.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ img.ui.avatar,
19151915
}
19161916

19171917
.ui.menu.new-menu .item {
1918-
margin: 0 !important;
1918+
margin-bottom: 0 !important; /* reset fomantic's margin, because the active menu has special bottom border */
19191919
}
19201920

19211921
@media (max-width: 767px) {
@@ -1924,8 +1924,13 @@ img.ui.avatar,
19241924
}
19251925
}
19261926

1927+
.ui.menu.new-menu .item:first-child {
1928+
margin-left: auto; /* "justify-content: center" doesn't work with "overflow: auto", so use margin: auto */
1929+
}
1930+
19271931
.ui.menu.new-menu .item:last-child {
19281932
padding-right: 30px !important;
1933+
margin-right: auto;
19291934
}
19301935

19311936
.ui.menu.new-menu::-webkit-scrollbar {

web_src/css/explore.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.explore .navbar {
2-
justify-content: center;
32
margin-bottom: 15px !important;
43
background-color: var(--color-navbar) !important;
54
border-width: 1px !important;

web_src/css/runner.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
color: var(--color-white) !important;
3333
}
3434

35-
.runner-container .runner-new-menu {
36-
width: 300px;
37-
}
38-
3935
.runner-container .task-status-success {
4036
background-color: var(--color-green);
4137
color: var(--color-white);

0 commit comments

Comments
 (0)