Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/ui/src/css/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,25 @@
font-weight: var(--body-font-weight-bold);
opacity: 1;
}

.nav-close {
background: transparent url(../img/octicons-16.svg#view-close) no-repeat center / 100% 100%;
min-width: 24px;
min-height: 24px;
outline: none;
border: none;
margin-left: 0.5rem;
margin-top: 0.5rem;
}

.nav-close span {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
7 changes: 7 additions & 0 deletions docs/ui/src/img/octicons-16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/ui/src/js/01-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
if (!navContainer && (!navToggle || (navToggle.hidden = true))) return
var nav = navContainer.querySelector('.nav')
var navMenuToggle = navContainer.querySelector('.nav-menu-toggle')
var closeNavBtn = navContainer.querySelector('.nav-close')

navToggle.addEventListener('click', showNav)
navContainer.addEventListener('click', trapEvent)
closeNavBtn.addEventListener('click', hideNav)

var menuPanel = navContainer.querySelector('[data-panel=menu]')
if (!menuPanel) return
Expand Down
3 changes: 3 additions & 0 deletions docs/ui/src/partials/nav.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div class="nav-container"{{#if page.component}} data-component="{{page.component.name}}" data-version="{{page.version}}"{{/if}}>
<aside class="nav">
<button class="nav-close" type="button" aria-label="Close navigation">
<span aria-hidden="true">Close</span>
</button>
<div class="panels">
{{> nav-menu}}
{{> nav-explore}}
Expand Down
Loading