Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hifis.net
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HIFIS
Overall
hifis.net
Commits
8da30eba
Commit
8da30eba
authored
1 year ago
by
Huste, Tobias
Committed by
Uwe Jandt (DESY, HIFIS)
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Make Hamburger menu tabbable
parent
49407d3f
No related branches found
Branches containing commit
No related tags found
1 merge request
!725
Make Hamburger menu tabbable
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
_includes/header.html
+4
-7
4 additions, 7 deletions
_includes/header.html
_sass/common/_header.scss
+1
-19
1 addition, 19 deletions
_sass/common/_header.scss
assets/js/header.js
+12
-0
12 additions, 0 deletions
assets/js/header.js
with
17 additions
and
26 deletions
_includes/header.html
+
4
−
7
View file @
8da30eba
...
...
@@ -45,14 +45,11 @@ See also:
The search button shall always be visible.
{% endcomment %}
<a
href=
"{{ 'search' | relative_url }}"
class=
"outer-nav-item"
><i
class=
"fas fa-search"
></i></a>
<button
onclick=
"toggleMenu();scrollableHeader()"
type=
"button"
class=
"nav_toggle"
id=
"menu-button"
>
<i
class=
"fas fa-bars"
></i>
</button>
{% comment %}
The following button shall be always minimized (hamburger menu).
{% endcomment %}
<input
type=
"checkbox"
id=
"mobile_toggle"
class=
"d-none"
>
<label
for=
"mobile_toggle"
class=
"nav_toggle"
onclick=
"scrollableHeader()"
></label>
<nav>
<nav
id=
"menu"
>
<ul
class=
"nav-grid"
>
{% for category in site.data.navigation.header %}
<li
class=
"nav-first-level"
>
...
...
This diff is collapsed.
Click to expand it.
_sass/common/_header.scss
+
1
−
19
View file @
8da30eba
...
...
@@ -105,27 +105,9 @@
&
:focus
{
color
:
$color-helmholtz-bright-blue
;
}
&
:before
{
font
:
var
(
--
fa-font-solid
);
content
:
"\f0c9"
;
}
}
/*
This SCSS part is used to mimic the behavior, previously implemented
via Javascript, in pure CSS using a technique called "Checkbox Hack"
https://css-tricks.com/the-checkbox-hack/. This works by connecting
a <label> with <input type="checkbox"> and hiding the <label>.
Clicking on the label toggles the :checked state of this ID and allows
for applying different style.
*/
#mobile_toggle
:checked
~
.nav_toggle
::before
{
content
:
"\f00d"
;
color
:
$color-helmholtz-blue
;
}
#mobile_toggle
:checked
~
nav
{
.nav-expanded
{
display
:
flex
;
flex-direction
:
column
;
...
...
This diff is collapsed.
Click to expand it.
assets/js/header.js
+
12
−
0
View file @
8da30eba
...
...
@@ -21,3 +21,15 @@ function scrollableHeader() {
document
.
getElementById
(
"
header
"
).
classList
.
toggle
(
"
scrollable-header
"
);
document
.
body
.
classList
.
toggle
(
"
no-scroll
"
);
}
function
toggleMenu
()
{
document
.
getElementById
(
"
menu
"
).
classList
.
toggle
(
"
nav-expanded
"
);
menuIconClassList
=
document
.
getElementById
(
"
menu-button
"
).
firstElementChild
.
classList
;
if
(
menuIconClassList
.
contains
(
"
fa-bars
"
))
{
menuIconClassList
.
remove
(
"
fa-bars
"
);
menuIconClassList
.
add
(
"
fa-x
"
);
}
else
{
menuIconClassList
.
remove
(
"
fa-x
"
);
menuIconClassList
.
add
(
"
fa-bars
"
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment