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
5 changes: 4 additions & 1 deletion src/css/doc.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
letter-spacing: -0.025rem;
line-height: var(--line-height-heading);
margin-bottom: 0;
margin-left: -2.5rem;
padding-left: 2.5rem;
}

.doc h1 {
font-size: var(--heading-h1);
font-weight: var(--weight-light);
letter-spacing: 0;
margin: 2.5rem 0 0;
margin-left: -2.5rem;
}

.page-heading-title {
Expand Down Expand Up @@ -1091,7 +1094,7 @@ table.tableblock pre code.language-bash.hljs {

.doc h2 {
font-size: var(--heading-h2-sm);
margin: 1rem 0 1rem;
margin: 1rem 0 1rem -2.5rem;
}

.doc h3 {
Expand Down
2 changes: 1 addition & 1 deletion src/js/01-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
})

find(/*'.nav-toggle',*/ '.in-toggle', navMenu.element).forEach(function (toggleBtn) {
console.log(toggleBtn, 17)
// console.log(toggleBtn, 17)
var navItem = findAncestorWithClass('nav-item', toggleBtn, navMenu.element)
toggleBtn.addEventListener('click', toggleActive.bind(navItem))
// var dataDepth = toggleBtn.getAttribute('data-depth')
Expand Down
9 changes: 9 additions & 0 deletions src/js/02-on-this-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
if (sidebar) {
window.addEventListener('load', function () {
onScroll()
hashScroll()
window.addEventListener('scroll', onScroll)
})
}
Expand Down Expand Up @@ -92,4 +93,12 @@
function toArray (collection) {
return [].slice.call(collection)
}

function hashScroll () {
// element which needs to be scrolled to
var hasValue = window.location.hash
var elementTillScroll = document.querySelector(hasValue)
// scroll to element
elementTillScroll.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
})()
2 changes: 1 addition & 1 deletion src/js/05-tabset.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ find('.doc .tabset').forEach(function (tabset) {
var dropdownBtn = tab.parentNode.parentNode.querySelector('.dropdown-btn-down')
var dropdownMenu = tab.parentNode.parentNode.querySelector('.tabs .other-tablist')
dropdownBtn.addEventListener('click', function (e) {
console.log(e, 'enter')
// console.log(e, 'enter')
e.preventDefault()
if (dropdownMenu.style.display === 'block' || dropdownMenu.classList.contains('show')) {
dropdownMenu.classList.remove('show')
Expand Down