Skip to content

Commit 9420384

Browse files
authored
Merge pull request #69 from couchbase/left-nav-feature
Left nav feature
2 parents a8e7d1a + 9c4b348 commit 9420384

File tree

8 files changed

+45
-37
lines changed

8 files changed

+45
-37
lines changed

src/css/base.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ i {
9999
.hide-nav {
100100
display: none;
101101
}
102+
103+
@media screen and (min-width: 992px) {
104+
.body.container {
105+
padding-left: 0;
106+
}
107+
}
102108
/* .container-fluid {
103109
max-width: var(--width-container-fluid);
104110
padding: 0;

src/css/body.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ aside.toc.sidebar {
5959

6060
@media screen and (max-width: 767px) {
6161
div.body {
62-
margin-top: 3.9rem;
62+
margin-top: 4.2rem;
6363
}
6464
}

src/css/component-frame.css

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
.frame-body {
2222
margin-left: var(--base-extra-small-space);
23-
position: relative;
23+
/* position: relative; */
2424
padding-top: 12px;
2525
padding-bottom: 12px;
2626
padding-right: 0;
@@ -32,7 +32,7 @@
3232

3333
.frame-body .title {
3434
margin: 0 0 0 0;
35-
font-size: var(--font-medium);
35+
font-size: 1.125rem;
3636
line-height: 1.5rem;
3737
font-weight: var(--weight-semibold);
3838
color: var(--color-brand-gray1);
@@ -56,8 +56,12 @@
5656
.frame-body .frame-link {
5757
position: relative;
5858
color: var(--color-brand-gray1);
59-
font-size: 18px;
60-
margin-left: 4px;
59+
font-size: 1.125rem;
60+
font-weight: var(--weight-semibold);
61+
}
62+
63+
.frame-body .frame-link .version {
64+
margin: 0 8px 0 4px;
6165
}
6266

6367
.frame-dropdown {
@@ -67,6 +71,7 @@
6771
top: 100%;
6872
z-index: 1;
6973
padding: 0;
74+
right: 4px;
7075
}
7176

7277
.component-frame .frame-dropdown.show,
@@ -76,8 +81,6 @@
7681

7782
.frame-link-dropdowns .frame-link {
7883
color: var(--color-brand-gray1);
79-
font-weight: var(--weight-semibold);
80-
margin: 0;
8184
font-family: "Source Sans Pro", sans-serif;
8285
}
8386

@@ -89,7 +92,7 @@
8992
.frame-dropdown .frame-dropdown-list,
9093
.frame-dropdown .related {
9194
margin: 0;
92-
padding: 0;
95+
padding: 0.5rem 0;
9396
list-style: none;
9497
min-width: 125px;
9598
}
@@ -103,7 +106,7 @@
103106

104107
.frame-dropdown ul li a,
105108
.frame-dropdown .related li a {
106-
padding: 8px 0.625rem;
109+
padding: 0.5rem 1rem;
107110
display: inline-block;
108111
width: 100%;
109112
color: var(--color-brand-primary);
@@ -140,7 +143,7 @@ ul.frame-dropdown-list li:last-child,
140143
.frame-link,
141144
.frame-item,
142145
.navbar-item {
143-
font-size: var(--font-small);
146+
font-size: var(--font-base);
144147
color: var(--color-brand-gray4);
145148
text-decoration: none;
146149
}

src/css/nav.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ html.is-clipped--nav {
251251
background-size: 75%;
252252
}
253253

254-
.is-inactive {
254+
/* .is-inactive {
255255
display: none;
256-
}
256+
} */
257257

258258
.main-nav-parent {
259259
font-size: var(--font-small);
@@ -316,7 +316,7 @@ html.is-clipped--nav {
316316
color: var(--color-brand-black);
317317
font-size: var(--font-base);
318318
line-height: var(--line-height-base);
319-
font-weight: var(--weight-semibold);
319+
/* font-weight: var(--weight-semibold); */
320320
}
321321

322322
.is-active[data-depth='0'] .is-active > .nav-line[data-depth="1"] {

src/js/01-nav.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
})
1515

1616
find(/*'.nav-toggle',*/ '.in-toggle', navMenu.element).forEach(function (toggleBtn) {
17-
console.log(toggleBtn, 17)
17+
// console.log(toggleBtn, 17)
1818
var navItem = findAncestorWithClass('nav-item', toggleBtn, navMenu.element)
1919
toggleBtn.addEventListener('click', toggleActive.bind(navItem))
2020
// var dataDepth = toggleBtn.getAttribute('data-depth')
@@ -68,18 +68,18 @@
6868
// navMenu.element.style.height = reclaimedHeight > 0 ? Math.max(0, preferredHeight - reclaimedHeight) + 'px' : ''
6969
// }
7070

71-
var navMenuControl
72-
if (document.querySelector('.main-nav-parent')) {
73-
navMenuControl = document.querySelector('.main-nav-parent')
74-
navMenuControl.addEventListener('click', function () {
75-
for (var i = 0; i < navItems.length; i++) {
76-
navItems[i].classList.remove('is-active')
77-
navItems[i].classList.remove('is-inactive')
78-
navItems[i].classList.remove('open')
79-
}
80-
this.style.display = 'none'
81-
})
82-
}
71+
// var navMenuControl
72+
// if (document.querySelector('.main-nav-parent')) {
73+
// navMenuControl = document.querySelector('.main-nav-parent')
74+
// navMenuControl.addEventListener('click', function () {
75+
// for (var i = 0; i < navItems.length; i++) {
76+
// navItems[i].classList.remove('is-active')
77+
// navItems[i].classList.remove('is-inactive')
78+
// navItems[i].classList.remove('open')
79+
// }
80+
// this.style.display = 'none'
81+
// })
82+
// }
8383
// Toggle class
8484
function toggleActive (e) {
8585
// if (this.getAttribute('data-depth') === '1') {
@@ -92,7 +92,7 @@
9292
this.classList.toggle('is-active')
9393
}
9494

95-
var navItems = document.querySelectorAll('.nav .nav-item')
95+
// var navItems = document.querySelectorAll('.nav .nav-item')
9696
function revealNav (e) {
9797
if (nav.classList.contains('is-active')) return hideNav(e)
9898
document.documentElement.classList.add('is-clipped--nav')
@@ -148,7 +148,7 @@
148148
setTimeout(function () {
149149
if (document.querySelector('.is-current-page')) {
150150
var currentPageMenu = document.querySelector('.is-current-page')
151-
var topPositon = currentPageMenu.offsetTop
151+
var topPositon = currentPageMenu.offsetTop - 100
152152
var leftMenu = document.querySelector('.left-sidebar-menu .nav-menu')
153153
leftMenu.scrollTop = topPositon
154154
}
@@ -166,9 +166,9 @@
166166

167167
// hide main menu for top level navigation -
168168

169-
if (nav.className.includes('is-current-page')) {
170-
navMenuControl.style.display = 'none'
171-
}
169+
// if (nav.className.includes('is-current-page')) {
170+
// navMenuControl.style.display = 'none'
171+
// }
172172

173173
// hide in second level menu
174174
if (nav.className.includes('is-current-path')) {

src/partials/main.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{/with}}
1717
{{/unless}}
1818
<div class="article-header">
19-
{{> nav-control}}
19+
{{!-- {{> nav-control}} --}}
2020
{{> crumbs}}
2121
</div>
2222
{{> article}}

src/partials/nav-tree.hbs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
{{#each navigation}}
33
{{#if (eq ../crumbAtLevel this)}}
44
{{#if ( eq ../crumbLevel 0 or eq ../crumbLevel 1 or eq ../crumbLevel 2 or eq ../crumbLevel 3)}}
5-
<div class="main-nav-parent new " data-depth="{{../level}}">
6-
<span class="back-to-menu"><i class="fas fa-chevron-left"></i> Main Menu </span>
7-
{{!-- <span class="nav-text">{{{./content}}}</span> --}}
8-
</div>
5+
{{!-- <div class="main-nav-parent new " data-depth="{{../level}}"><span class="back-to-menu"><i class="fas fa-chevron-left"></i> Main Menu </span>
6+
7+
</div> --}}
98
{{/if}}
109
{{/if}}
1110
{{/each}}

src/partials/nav-version-control.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</div>
4747
<div class="frame-body">
4848
<h4 class="title"><span class="">{{{page.component.title}}}</span></h4>
49-
<a class="navbar-item component" href="{{relativize page.componentVersion.url}}">{{#unless (eq page.componentVersion.displayVersion 'master')}} <span class="version">{{page.componentVersion.displayVersion}}</span>{{/unless}}</a>
49+
<a class="frame-link component" href="{{relativize page.componentVersion.url}}">{{#unless (eq page.componentVersion.displayVersion 'master')}} <span class="version">{{page.componentVersion.displayVersion}}</span>{{/unless}}</a>
5050
</div>
5151
</div>
5252
{{/if}}

0 commit comments

Comments
 (0)