Skip to content

Commit 33f31d0

Browse files
committed
Navbar and media query cleanups
1 parent 63a4295 commit 33f31d0

File tree

13 files changed

+74
-85
lines changed

13 files changed

+74
-85
lines changed

templates/base/head_navbar.tmpl

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<nav class="ui container secondary stackable main menu" id="navbar" aria-label="{{.locale.Tr "aria.navbar"}}">
1+
<nav id="navbar" class="ui secondary stackable menu" aria-label="{{.locale.Tr "aria.navbar"}}">
22
{{$notificationUnreadCount := 0}}
33
{{if .IsSigned}}
44
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
@@ -28,33 +28,21 @@
2828
{{/* No links */}}
2929
{{else if .IsSigned}}
3030
{{if not .UnitIssuesGlobalDisabled}}
31-
<a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.locale.Tr "issues"}}</a>
31+
<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{.locale.Tr "issues"}}</a>
3232
{{end}}
3333
{{if not .UnitPullsGlobalDisabled}}
34-
<a class="item {{if .PageIsPulls}}active{{end}}" href="{{AppSubUrl}}/pulls">{{.locale.Tr "pull_requests"}}</a>
34+
<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{.locale.Tr "pull_requests"}}</a>
3535
{{end}}
3636
{{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}}
37-
{{if .ShowMilestonesDashboardPage}}<a class="item {{if .PageIsMilestonesDashboard}}active{{end}}" href="{{AppSubUrl}}/milestones">{{.locale.Tr "milestones"}}</a>{{end}}
37+
{{if .ShowMilestonesDashboardPage}}<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{.locale.Tr "milestones"}}</a>{{end}}
3838
{{end}}
39-
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
39+
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
4040
{{else if .IsLandingPageOrganizations}}
41-
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.locale.Tr "explore"}}</a>
41+
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.locale.Tr "explore"}}</a>
4242
{{else}}
43-
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
43+
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
4444
{{end}}
45-
4645
{{template "custom/extra_links" .}}
47-
48-
{{/* TODO
49-
<div class="item">
50-
<div class="ui icon input">
51-
<input class="searchbox" type="text" placeholder="{{.locale.Tr "search_project"}}">
52-
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
53-
</div>
54-
</div>
55-
*/}}
56-
57-
5846
{{if and .IsSigned .MustChangePassword}}
5947
<div class="right stackable menu">
6048
<div class="ui dropdown jump item" tabindex="-1" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}">

templates/status/500.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</head>
1616
<body>
1717
<div class="full height">
18-
<nav class="ui container secondary stackable main menu" id="navbar">
18+
<nav id="navbar" class="ui secondary stackable menu">
1919
<div class="ui container gt-df">
2020
<div class="item brand gt-f1">
2121
<a href="{{AppSubUrl}}/" aria-label="{{.locale.Tr "home"}}">

web_src/css/admin.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
width: calc(100% - 245px);
2121
}
2222

23-
@media (max-width: 767px) {
23+
@media (max-width: 767.98px) {
2424
.admin dl.admin-dl-horizontal dd {
2525
width: calc(100% - 185px);
2626
}
@@ -40,7 +40,7 @@
4040
white-space: nowrap;
4141
}
4242

43-
@media (max-width: 767px) {
43+
@media (max-width: 767.98px) {
4444
.admin dl.admin-dl-horizontal dt {
4545
width: 160px;
4646
}

web_src/css/base.css

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ img.ui.avatar,
941941
}
942942
}
943943

944-
@media (max-width: 767px) {
944+
@media (max-width: 767.98px) {
945945
.page-content .ui.ui.ui.container:not(.fluid) {
946946
width: calc(100vw - 16px);
947947
max-width: calc(100vw - 16px);
@@ -961,19 +961,11 @@ img.ui.avatar,
961961
margin: 0 !important;
962962
}
963963

964-
#navbar .column .menu {
965-
margin-top: 0;
966-
}
967-
968964
#navbar .fitted .svg {
969965
margin-right: 0;
970966
vertical-align: middle;
971967
}
972968

973-
#navbar .searchbox {
974-
background-color: var(--color-input-background) !important;
975-
}
976-
977969
#navbar .text .svg {
978970
width: 16px;
979971
text-align: center;
@@ -987,8 +979,17 @@ img.ui.avatar,
987979
margin-right: 0 !important;
988980
}
989981

990-
@media (max-width: 767px) {
991-
#navbar:not(.shown) > *:not(:first-child) {
982+
@media (max-width: 767.98px) {
983+
#navbar {
984+
align-items: stretch;
985+
}
986+
#navbar.shown {
987+
padding-bottom: 8px;
988+
}
989+
#navbar.shown .item.brand {
990+
padding-bottom: 2px;
991+
}
992+
#navbar:not(.shown) > *:not(.item.brand) {
992993
display: none;
993994
}
994995
}
@@ -1455,7 +1456,7 @@ img.ui.avatar,
14551456
line-height: 20px;
14561457
}
14571458

1458-
@media (max-width: 767px) {
1459+
@media (max-width: 767.98px) {
14591460
.ui.pagination.menu .item:not(.active,.navigation),
14601461
.ui.pagination.menu .item.navigation span.navigation_label {
14611462
display: none;
@@ -1550,7 +1551,7 @@ img.ui.avatar,
15501551
}
15511552
}
15521553

1553-
@media (max-width: 767px) {
1554+
@media (max-width: 767.98px) {
15541555
/* double selector so it wins over .gt-df etc */
15551556
.not-mobile.not-mobile {
15561557
display: none !important;
@@ -1613,7 +1614,7 @@ img.ui.avatar,
16131614
margin-bottom: 0 !important; /* reset fomantic's margin, because the active menu has special bottom border */
16141615
}
16151616

1616-
@media (max-width: 767px) {
1617+
@media (max-width: 767.98px) {
16171618
.ui.menu.new-menu .item {
16181619
width: auto !important;
16191620
}

web_src/css/dashboard.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
width: 15%;
3636
}
3737

38-
@media (max-width: 767px) {
38+
@media (max-width: 767.98px) {
3939
.dashboard.feeds .filter.menu .item .floating.label,
4040
.dashboard.issues .filter.menu .item .floating.label {
4141
top: 10px;
@@ -60,7 +60,7 @@
6060
left: auto !important;
6161
}
6262

63-
@media (max-width: 767px) {
63+
@media (max-width: 767.98px) {
6464
.dashboard.feeds .filter.menu,
6565
.dashboard.issues .filter.menu {
6666
width: 100%;
@@ -90,7 +90,7 @@
9090
max-width: 100%;
9191
}
9292

93-
@media (max-width: 767px) {
93+
@media (max-width: 767.98px) {
9494
.dashboard .dashboard-navbar .ui.dropdown > .menu {
9595
position: static;
9696
}

web_src/css/form.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ textarea:focus,
197197
}
198198
}
199199

200-
@media (max-width: 767px) {
200+
@media (max-width: 767.98px) {
201201
#create-page-form form .optional .title {
202202
margin-left: 15px;
203203
}
@@ -315,7 +315,7 @@ textarea:focus,
315315
}
316316
}
317317

318-
@media (max-width: 767px) {
318+
@media (max-width: 767.98px) {
319319
.user.activate form .optional .title,
320320
.user.forgot.password form .optional .title,
321321
.user.reset.password form .optional .title,
@@ -353,7 +353,7 @@ textarea:focus,
353353
width: 200px;
354354
}
355355

356-
@media (max-width: 767px) {
356+
@media (max-width: 767.98px) {
357357
.user.activate form .inline.field > label,
358358
.user.forgot.password form .inline.field > label,
359359
.user.reset.password form .inline.field > label,
@@ -449,7 +449,7 @@ textarea:focus,
449449
}
450450
}
451451

452-
@media (max-width: 767px) {
452+
@media (max-width: 767.98px) {
453453
.repository.new.repo form .optional .title,
454454
.repository.new.migrate form .optional .title,
455455
.repository.new.fork form .optional .title {
@@ -483,7 +483,7 @@ textarea:focus,
483483
width: 50% !important;
484484
}
485485

486-
@media (max-width: 767px) {
486+
@media (max-width: 767.98px) {
487487
.repository.new.repo form label,
488488
.repository.new.migrate form label,
489489
.repository.new.fork form label,
@@ -516,7 +516,7 @@ textarea:focus,
516516
width: 50% !important;
517517
}
518518

519-
@media (max-width: 767px) {
519+
@media (max-width: 767.98px) {
520520
.repository.new.repo .ui.form .selection.dropdown:not(.owner) {
521521
width: 100% !important;
522522
}
@@ -534,7 +534,7 @@ textarea:focus,
534534
font-family: var(--fonts-monospace);
535535
}
536536

537-
@media (max-width: 767px) {
537+
@media (max-width: 767.98px) {
538538
.new.org .ui.form .field button,
539539
.new.org .ui.form .field a {
540540
margin-bottom: 1em;

web_src/css/helpers.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Gitea's private styles use `g-` prefix.
260260
.gt-font-17 { font-size: 17px !important }
261261
.gt-font-18 { font-size: 18px !important }
262262

263-
@media (max-width: 767px) {
263+
@media (max-width: 767.98px) {
264264
.gt-db-small { display: block !important; }
265265
.gt-w-100-small { width: 100% !important; }
266266
.gt-js-small { justify-content: flex-start !important; }

web_src/css/home.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
max-width: 220px;
33
}
44

5-
@media (max-width: 767px) {
5+
@media (max-width: 767.98px) {
66
.home .hero h1 {
77
font-size: 3.5em;
88
}

web_src/css/org.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}
3232
}
3333

34-
@media (max-width: 767px) {
34+
@media (max-width: 767.98px) {
3535
#create-page-form form .optional .title {
3636
margin-left: 15px;
3737
}
@@ -77,7 +77,7 @@
7777
}
7878
}
7979

80-
@media (max-width: 767px) {
80+
@media (max-width: 767.98px) {
8181
.organization.new.org form .optional .title {
8282
margin-left: 15px;
8383
}
@@ -222,7 +222,7 @@
222222
height: 60px;
223223
}
224224

225-
@media (max-width: 767px) {
225+
@media (max-width: 767.98px) {
226226
.organization.teams #repo-top-segment {
227227
height: 100px;
228228
}

0 commit comments

Comments
 (0)