-
+
+
+
{% if site.search_enabled != false %}
-
-
-
-
-
+
{% endif %}
{% if site.aux_links != nil %}
-
+
-
-
+
+
+
+
-
- {% for link in site.aux_links %}
-
- - + + + {% endfor %} +
+
diff --git a/_sass/color_schemes/dark.scss b/_sass/color_schemes/dark.scss
index 9a0b9ea..a25f449 100644
--- a/_sass/color_schemes/dark.scss
+++ b/_sass/color_schemes/dark.scss
@@ -14,3 +14,4 @@ $base-button-color: $grey-dk-250;
$code-background-color: $grey-dk-250;
$search-background-color: $grey-dk-250;
$table-background-color: $grey-dk-250;
+$feedback-color: darken($sidebar-color, 3%);
diff --git a/_sass/content.scss b/_sass/content.scss
index 7ab23d8..965c9c8 100644
--- a/_sass/content.scss
+++ b/_sass/content.scss
@@ -5,7 +5,7 @@
//
// stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type
-.page-content {
+.main-content {
line-height: $content-line-height;
ol,
diff --git a/_sass/layout.scss b/_sass/layout.scss
index 79169e4..720ac1d 100644
--- a/_sass/layout.scss
+++ b/_sass/layout.scss
@@ -37,7 +37,7 @@
}
}
-.main-content-wrap {
+.main-wrap {
@include mq(md) {
position: absolute;
top: 0;
@@ -48,9 +48,13 @@
overflow-x: hidden;
overflow-y: scroll;
}
+
+ &:focus {
+ outline: none;
+ }
}
-.main-content {
+.main {
@include mq(md) {
position: relative;
max-width: $content-width;
@@ -64,11 +68,7 @@
}
}
-.js-main-content:focus {
- outline: none;
-}
-
-.page {
+.main-content-wrap {
@include container;
padding-top: $gutter-spacing-sm;
padding-bottom: $gutter-spacing-sm;
@@ -79,7 +79,7 @@
}
}
-.page-header {
+.main-header {
@include container;
display: none;
padding-top: $gutter-spacing-sm;
@@ -103,7 +103,7 @@
}
}
-.navigation,
+.site-nav,
.site-header,
.site-footer {
width: 100%;
@@ -113,9 +113,7 @@
}
}
-.navigation {
- @include container;
-
+.site-nav {
@include mq(md) {
padding-top: $sp-8;
padding-bottom: $gutter-spacing-sm;
@@ -165,7 +163,7 @@
}
}
-.menu-button {
+.site-button {
appearance: none;
display: flex;
height: 100%;
@@ -175,12 +173,18 @@
text-transform: uppercase;
background: transparent;
border: 0;
+ @include fs-3;
@include mq(md) {
display: none;
}
}
+.site-title:hover,
+.site-button:hover {
+ background-image: linear-gradient(-90deg, rgba($feedback-color, 1) 0%, rgba($feedback-color, 0.8) 80%, rgba($feedback-color, 0) 100%);
+}
+
// stylelint-disable selector-max-type
body {
@@ -202,6 +206,8 @@ body {
left: 0;
padding-top: $sp-4;
padding-bottom: $sp-4;
+ color: $grey-dk-000;
+ @include fs-2;
@include mq(md) {
position: static;
diff --git a/_sass/navigation.scss b/_sass/navigation.scss
index c774904..16ff5f0 100644
--- a/_sass/navigation.scss
+++ b/_sass/navigation.scss
@@ -1,74 +1,133 @@
//
// Main nav, breadcrumb, etc...
//
-.navigation-list {
+// stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type, selector-max-specificity
+
+.nav-list {
padding: 0;
margin-top: 0;
margin-bottom: 0;
list-style: none;
-}
-.navigation-list-child-list {
- padding-left: $sp-3;
- list-style: none;
-
- .navigation-list-link {
- color: $nav-child-link-color;
- }
-
- .navigation-list-item {
+ .nav-list-item {
+ @include fs-4;
position: relative;
+ margin: 0;
- &::before {
+ @include mq(md) {
+ @include fs-3;
+ }
+
+ .nav-list-link {
+ display: block;
+ min-height: $nav-list-item-height-sm;
+ padding-top: $sp-1;
+ padding-bottom: $sp-1;
+ line-height: #{$nav-list-item-height-sm - 2 * $sp-1};
+ @if $nav-list-expander-right {
+ padding-right: $nav-list-item-height-sm;
+ padding-left: $gutter-spacing-sm;
+ }
+ @else {
+ padding-right: $gutter-spacing-sm;
+ padding-left: $nav-list-item-height-sm;
+ }
+
+ @include mq(md) {
+ min-height: $nav-list-item-height;
+ line-height: #{$nav-list-item-height - 2 * $sp-1};
+ @if $nav-list-expander-right {
+ padding-right: $nav-list-item-height;
+ padding-left: $gutter-spacing;
+ }
+ @else {
+ padding-right: $gutter-spacing;
+ padding-left: $nav-list-item-height;
+ }
+ }
+
+ &.active {
+ font-weight: 600;
+ text-decoration: none;
+ }
+
+ &:hover,
+ &.active {
+ background-image: linear-gradient(-90deg, rgba($feedback-color, 1) 0%, rgba($feedback-color, 0.8) 80%, rgba($feedback-color, 0) 100%);
+ }
+ }
+
+ .nav-list-expander {
position: absolute;
- margin-top: 0.3em;
- margin-left: -0.8em;
- color: rgba($body-text-color, 0.3);
- content: "- ";
+ @if $nav-list-expander-right {
+ right: 0;
+ }
+ width: $nav-list-item-height-sm;
+ height: $nav-list-item-height-sm;
+ padding-top: #{$nav-list-item-height-sm / 4};
+ padding-right: #{$nav-list-item-height-sm / 4};
+ padding-bottom: #{$nav-list-item-height-sm / 4};
+ padding-left: #{$nav-list-item-height-sm / 4};
+ fill: $link-color;
+
+ @include mq(md) {
+ width: $nav-list-item-height;
+ height: $nav-list-item-height;
+ padding-top: #{$nav-list-item-height / 4};
+ padding-right: #{$nav-list-item-height / 4};
+ padding-bottom: #{$nav-list-item-height / 4};
+ padding-left: #{$nav-list-item-height / 4};
+ }
+
+ &:hover {
+ background-image: linear-gradient(-90deg, rgba($feedback-color, 1) 0%, rgba($feedback-color, 0.8) 100%);
+ }
+
+ @if $nav-list-expander-right {
+ svg {
+ transform: rotate(90deg);
+ }
+ }
+ }
+
+ > .nav-list {
+ display: none;
+ padding-left: $sp-3;
+ list-style: none;
+
+ .nav-list-item {
+ position: relative;
+
+ .nav-list-link {
+ color: $nav-child-link-color;
+ }
+
+ .nav-list-expander {
+ fill: $nav-child-link-color;
+ }
+ }
}
&.active {
- &::before {
- color: $body-text-color;
+ > .nav-list-expander svg {
+ @if $nav-list-expander-right {
+ transform: rotate(-90deg);
+ }
+ @else {
+ transform: rotate(90deg);
+ }
+ }
+
+ > .nav-list {
+ display: block;
}
}
}
}
-.navigation-list-item {
- @include fs-4;
- margin: 0;
-
- @include mq(md) {
- @include fs-3;
- }
-
- .navigation-list-child-list {
- display: none;
- }
-
- &.active {
- .navigation-list-child-list {
- display: block;
- }
- }
-}
-
-.navigation-list-link {
- display: block;
- padding-top: $sp-1;
- padding-bottom: $sp-1;
-
- &.active {
- font-weight: 600;
- color: $body-heading-color;
- text-decoration: none;
- }
-}
-
// Small screen nav
-.main-nav {
+.site-nav {
display: none;
&.nav-open {
@@ -81,9 +140,27 @@
.aux-nav {
align-self: center;
+
+ .aux-nav-list {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ @include fs-2;
+ }
+
+ .aux-nav-list-item {
+ display: inline-block;
+ margin-right: $sp-2;
+ @include fs-2;
+
+ &:last-child {
+ margin-right: 0;
+ }
+ }
}
// Breadcrumb nav
+
.breadcrumb-nav {
@include mq(md) {
margin-top: -$sp-4;
diff --git a/_sass/search.scss b/_sass/search.scss
index bef2df7..79c3cfd 100644
--- a/_sass/search.scss
+++ b/_sass/search.scss
@@ -68,7 +68,7 @@
order: 1;
}
-.search-results-wrap {
+.search-results {
position: absolute;
z-index: 100;
display: none;
@@ -112,7 +112,7 @@
&:hover,
&.active {
- background-color: $sidebar-color;
+ background-color: $feedback-color;
}
@include mq(md) {
diff --git a/_sass/support/_variables.scss b/_sass/support/_variables.scss
index 3665a36..2d155d3 100644
--- a/_sass/support/_variables.scss
+++ b/_sass/support/_variables.scss
@@ -57,6 +57,7 @@ $sidebar-color: $grey-lt-000 !default;
$search-background-color: $white !default;
$table-background-color: $white !default;
$code-background-color: $grey-lt-000 !default;
+$feedback-color: darken($sidebar-color, 3%) !default;
$body-text-color: $grey-dk-100 !default;
$body-heading-color: $grey-dk-300 !default;
@@ -113,6 +114,9 @@ $gutter-spacing: $sp-6 !default;
$gutter-spacing-sm: $sp-4 !default;
$nav-width: 264px !default;
$nav-width-md: 248px !default;
+$nav-list-item-height: $sp-6 !default;
+$nav-list-item-height-sm: $sp-8 !default;
+$nav-list-expander-right: true;
$content-width: 800px !default;
$header-height: 60px !default;
$search-results-width: 500px !default;
diff --git a/assets/js/just-the-docs.js b/assets/js/just-the-docs.js
index 2edf7f4..b683c7f 100644
--- a/assets/js/just-the-docs.js
+++ b/assets/js/just-the-docs.js
@@ -24,17 +24,28 @@ jtd.onReady = function(ready) {
// Show/hide mobile menu
function initNav() {
- const mainNav = document.querySelector('.js-main-nav');
- const pageHeader = document.querySelector('.js-page-header');
- const navTrigger = document.querySelector('.js-main-nav-trigger');
+ jtd.addEvent(document, 'click', function(e){
+ var target = e.target;
+ while (target && !(target.classList && target.classList.contains('nav-list-expander'))) {
+ target = target.parentNode;
+ }
+ if (target) {
+ e.preventDefault();
+ target.parentNode.classList.toggle('active');
+ }
+ });
+
+ const siteNav = document.getElementById('site-nav');
+ const mainHeader = document.getElementById('main-header');
+ const navTrigger = document.getElementById('site-nav-trigger');
jtd.addEvent(navTrigger, 'click', function(e){
e.preventDefault();
var text = navTrigger.innerText;
var textToggle = navTrigger.getAttribute('data-text-toggle');
- mainNav.classList.toggle('nav-open');
- pageHeader.classList.toggle('nav-open');
+ siteNav.classList.toggle('nav-open');
+ mainHeader.classList.toggle('nav-open');
navTrigger.classList.toggle('nav-open');
navTrigger.innerText = textToggle;
navTrigger.setAttribute('data-text-toggle', text);
@@ -93,8 +104,8 @@ function initSearch() {
function searchResults(index, data) {
var index = index;
var docs = data;
- var searchInput = document.querySelector('.js-search-input');
- var searchResults = document.querySelector('.js-search-results');
+ var searchInput = document.getElementById('search-input');
+ var searchResults = document.getElementById('search-results');
function hideResults() {
searchResults.innerHTML = '';
@@ -282,8 +293,8 @@ function initSearch() {
// Focus
function pageFocus() {
- var mainContent = document.querySelector('.js-main-content');
- mainContent.focus();
+ var mainWrap = document.getElementById('main-wrap');
+ mainWrap.focus();
}
// Switch theme
{% unless page.url == "/" %}
{% if page.parent %}
-