2016-09-04 17:11:58 +02:00
|
|
|
////
|
2020-02-10 12:34:58 +01:00
|
|
|
/// Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
2016-09-04 17:11:58 +02:00
|
|
|
///
|
|
|
|
/// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
/// copy of this software and associated documentation files (the "Software"),
|
|
|
|
/// to deal in the Software without restriction, including without limitation
|
|
|
|
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
/// and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
/// Software is furnished to do so, subject to the following conditions:
|
|
|
|
///
|
|
|
|
/// The above copyright notice and this permission notice shall be included in
|
|
|
|
/// all copies or substantial portions of the Software.
|
|
|
|
///
|
|
|
|
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
/// DEALINGS
|
|
|
|
////
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// ----------------------------------------------------------------------------
|
2016-10-06 12:14:33 +02:00
|
|
|
// Rules
|
2016-09-04 17:32:12 +02:00
|
|
|
// ----------------------------------------------------------------------------
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2016-10-06 12:14:33 +02:00
|
|
|
// Navigation container
|
2016-08-07 18:01:56 +02:00
|
|
|
.md-nav {
|
2019-02-12 19:13:08 +01:00
|
|
|
font-size: px2rem(14px);
|
2016-09-23 17:46:16 +02:00
|
|
|
line-height: 1.3;
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2016-09-23 17:46:16 +02:00
|
|
|
// List title
|
2016-09-04 18:13:17 +02:00
|
|
|
&__title {
|
2016-09-23 11:56:25 +02:00
|
|
|
display: block;
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: 0 px2rem(12px);
|
2016-09-23 11:56:25 +02:00
|
|
|
font-weight: 700;
|
2016-09-23 17:46:16 +02:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Hide buttons by default
|
|
|
|
.md-nav__button {
|
2016-09-23 11:56:25 +02:00
|
|
|
display: none;
|
2018-01-13 16:54:08 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Stretch images
|
|
|
|
img {
|
|
|
|
width: 100%;
|
|
|
|
height: auto;
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
2016-12-28 16:20:52 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Logo
|
|
|
|
&.md-logo svg {
|
|
|
|
fill: currentColor;
|
|
|
|
}
|
2016-12-28 16:20:52 +01:00
|
|
|
}
|
2016-08-07 18:01:56 +02:00
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// List of items
|
2016-08-07 18:01:56 +02:00
|
|
|
&__list {
|
2016-09-04 18:13:17 +02:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2016-08-07 18:01:56 +02:00
|
|
|
list-style: none;
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// List item
|
|
|
|
&__item {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: 0 px2rem(12px);
|
2016-02-16 15:51:07 +01:00
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// Add bottom spacing to last item
|
|
|
|
&:last-child {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-bottom: px2rem(12px);
|
2016-01-28 23:27:15 +01:00
|
|
|
}
|
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// 2nd+ level items
|
|
|
|
& & {
|
|
|
|
padding-right: 0;
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(12px);
|
2018-01-13 16:54:08 +01:00
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// Remove bottom spacing for nested items
|
|
|
|
&:last-child {
|
|
|
|
padding-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
2016-08-07 18:01:56 +02:00
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Link inside item
|
2016-08-07 18:01:56 +02:00
|
|
|
&__link {
|
|
|
|
display: block;
|
2017-01-28 17:56:34 +01:00
|
|
|
margin-top: 0.625em;
|
2020-02-17 10:04:12 +01:00
|
|
|
transition: color 125ms;
|
2016-08-07 18:01:56 +02:00
|
|
|
text-overflow: ellipsis;
|
2016-09-23 11:56:25 +02:00
|
|
|
cursor: pointer;
|
2016-09-04 17:11:58 +02:00
|
|
|
overflow: hidden;
|
2020-02-15 21:34:14 +01:00
|
|
|
scroll-snap-align: start;
|
2016-02-16 15:51:07 +01:00
|
|
|
|
2016-09-23 17:46:16 +02:00
|
|
|
// Hide link to table of contents by default - this will only match the
|
2016-09-30 13:29:45 +02:00
|
|
|
// table of contents inside the drawer below and including tablet portrait
|
2018-06-10 06:45:16 -06:00
|
|
|
html &[for="__toc"] {
|
2016-09-23 11:56:25 +02:00
|
|
|
display: none;
|
|
|
|
|
|
|
|
// Hide table of contents by default
|
2016-09-23 17:46:16 +02:00
|
|
|
& ~ .md-nav {
|
2016-09-23 11:56:25 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-27 22:41:55 +01:00
|
|
|
// Blurred link
|
2016-12-15 15:55:40 +01:00
|
|
|
&[data-md-state="blur"] {
|
2016-08-07 18:01:56 +02:00
|
|
|
color: $md-color-black--light;
|
|
|
|
}
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2017-01-27 22:41:55 +01:00
|
|
|
// Active link
|
2020-02-24 18:07:50 +01:00
|
|
|
.md-nav__item &--active {
|
2016-12-18 14:22:08 +01:00
|
|
|
color: $md-color-primary;
|
|
|
|
}
|
|
|
|
|
2017-02-26 17:06:13 +01:00
|
|
|
// Reset active color for nested list titles
|
|
|
|
.md-nav__item--nested > & {
|
|
|
|
color: inherit;
|
|
|
|
}
|
|
|
|
|
2017-02-12 18:31:05 +01:00
|
|
|
// Focused or hovered link
|
2017-02-01 23:56:57 +01:00
|
|
|
&:focus,
|
2016-12-18 14:22:08 +01:00
|
|
|
&:hover {
|
2016-08-07 18:01:56 +02:00
|
|
|
color: $md-color-accent;
|
2016-01-28 23:27:15 +01:00
|
|
|
}
|
|
|
|
}
|
2016-09-23 11:56:25 +02:00
|
|
|
|
2016-09-23 17:46:16 +02:00
|
|
|
// Repository containing source
|
|
|
|
&__source {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// [tablet -]: Layered navigation
|
|
|
|
@include break-to-device(tablet) {
|
2017-02-12 16:53:04 +01:00
|
|
|
background-color: $md-color-white;
|
2016-09-23 11:56:25 +02:00
|
|
|
|
|
|
|
// Stretch primary navigation to drawer
|
|
|
|
&--primary,
|
|
|
|
&--primary .md-nav {
|
|
|
|
display: flex;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
left: 0;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Adjust styles for primary navigation
|
|
|
|
&--primary {
|
|
|
|
|
2017-01-26 21:25:31 +01:00
|
|
|
// List title and item
|
|
|
|
.md-nav__title,
|
|
|
|
.md-nav__item {
|
2019-02-12 19:13:08 +01:00
|
|
|
font-size: px2rem(16px);
|
2017-01-26 21:25:31 +01:00
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// List title
|
|
|
|
.md-nav__title {
|
2016-09-23 11:56:25 +02:00
|
|
|
position: relative;
|
2019-02-12 19:13:08 +01:00
|
|
|
height: px2rem(112px);
|
|
|
|
padding: px2rem(60px) px2rem(16px) px2rem(4px);
|
2016-12-17 12:53:24 +01:00
|
|
|
background-color: $md-color-black--lightest;
|
2016-09-23 11:56:25 +02:00
|
|
|
color: $md-color-black--light;
|
|
|
|
font-weight: 400;
|
2019-02-12 19:13:08 +01:00
|
|
|
line-height: px2rem(48px);
|
2016-09-23 11:56:25 +02:00
|
|
|
white-space: nowrap;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
// Icon
|
2020-02-24 18:07:50 +01:00
|
|
|
.md-nav__icon {
|
2016-09-23 11:56:25 +02:00
|
|
|
display: block;
|
|
|
|
position: absolute;
|
2020-02-24 18:07:50 +01:00
|
|
|
top: px2rem(8px);
|
|
|
|
left: px2rem(8px);
|
|
|
|
width: px2rem(24px);
|
|
|
|
height: px2rem(24px);
|
|
|
|
margin: px2rem(4px);
|
|
|
|
|
|
|
|
// Adjust for right-to-left languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
right: px2rem(8px);
|
|
|
|
left: initial;
|
|
|
|
}
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
2016-09-23 17:46:16 +02:00
|
|
|
|
2016-12-29 12:10:51 +01:00
|
|
|
// Main lists
|
|
|
|
~ .md-nav__list {
|
|
|
|
background-color: $md-color-white;
|
2020-02-18 14:30:06 +01:00
|
|
|
box-shadow: inset 0 px2rem(1px) 0 $md-color-black--lightest;
|
2020-02-15 21:34:14 +01:00
|
|
|
overflow-y: auto;
|
|
|
|
scroll-snap-type: y mandatory;
|
2016-12-29 12:10:51 +01:00
|
|
|
|
|
|
|
// Remove border for first list item
|
|
|
|
& > .md-nav__item:first-child {
|
|
|
|
border-top: 0;
|
|
|
|
}
|
2016-09-23 17:46:16 +02:00
|
|
|
}
|
2016-12-28 16:20:52 +01:00
|
|
|
|
|
|
|
// Site title in main navigation
|
2020-02-24 18:07:50 +01:00
|
|
|
&[for="__drawer"] {
|
2016-12-28 16:20:52 +01:00
|
|
|
position: relative;
|
|
|
|
background-color: $md-color-primary;
|
|
|
|
color: $md-color-white;
|
|
|
|
|
|
|
|
// Site logo
|
2017-01-14 20:13:10 +01:00
|
|
|
.md-nav__button {
|
2016-12-28 16:20:52 +01:00
|
|
|
display: block;
|
|
|
|
position: absolute;
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(4px);
|
|
|
|
left: px2rem(4px);
|
|
|
|
width: px2rem(64px);
|
|
|
|
height: px2rem(64px);
|
2020-02-24 18:07:50 +01:00
|
|
|
margin: px2rem(4px);
|
|
|
|
padding: px2rem(8px);
|
2019-02-12 19:13:08 +01:00
|
|
|
font-size: px2rem(48px);
|
2016-12-28 16:20:52 +01:00
|
|
|
}
|
|
|
|
}
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
html [dir="rtl"] & .md-nav__title {
|
|
|
|
|
|
|
|
// Site title in main navigation
|
2020-02-24 18:07:50 +01:00
|
|
|
&[for="__drawer"] .md-nav__button {
|
2019-02-12 19:13:08 +01:00
|
|
|
right: px2rem(4px);
|
2018-01-13 16:54:08 +01:00
|
|
|
left: initial;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// List of items
|
|
|
|
.md-nav__list {
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// List item
|
|
|
|
.md-nav__item {
|
|
|
|
padding: 0;
|
2019-02-12 19:13:08 +01:00
|
|
|
border-top: px2rem(1px) solid $md-color-black--lightest;
|
2016-09-23 17:46:16 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
2016-09-23 17:46:16 +02:00
|
|
|
// Increase spacing to account for icon
|
|
|
|
&--nested > .md-nav__link {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(48px);
|
2016-12-28 10:21:25 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(16px);
|
|
|
|
padding-left: px2rem(48px);
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
2016-09-23 17:46:16 +02:00
|
|
|
}
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Link inside item
|
|
|
|
.md-nav__link {
|
|
|
|
position: relative;
|
2017-01-28 17:56:34 +01:00
|
|
|
margin-top: 0;
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: px2rem(12px) px2rem(16px);
|
2016-09-23 11:56:25 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Icon
|
|
|
|
.md-nav__icon {
|
2016-09-23 11:56:25 +02:00
|
|
|
position: absolute;
|
2017-01-04 19:47:41 +01:00
|
|
|
top: 50%;
|
2019-02-12 19:13:08 +01:00
|
|
|
right: px2rem(12px);
|
|
|
|
margin-top: px2rem(-12px);
|
2016-12-17 12:53:24 +01:00
|
|
|
color: inherit;
|
2019-02-12 19:13:08 +01:00
|
|
|
font-size: px2rem(24px);
|
2018-01-13 16:54:08 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
|
|
|
right: initial;
|
2019-02-12 19:13:08 +01:00
|
|
|
left: px2rem(12px);
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
2016-09-23 17:46:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Icon
|
|
|
|
.md-nav__icon {
|
|
|
|
|
|
|
|
// Adjust for right-to-left languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
|
|
|
|
// Flip icon vertically
|
|
|
|
svg {
|
|
|
|
transform: scale(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-11 14:07:07 +01:00
|
|
|
// Table of contents inside navigation
|
|
|
|
.md-nav--secondary {
|
2016-09-23 17:46:16 +02:00
|
|
|
|
2017-03-11 14:07:07 +01:00
|
|
|
// Set links to static to avoid unnecessary layering
|
2016-09-23 17:46:16 +02:00
|
|
|
.md-nav__link {
|
2017-03-11 14:07:07 +01:00
|
|
|
position: static;
|
2016-09-23 17:46:16 +02:00
|
|
|
}
|
|
|
|
|
2017-03-11 14:07:07 +01:00
|
|
|
// Set nested navigation for table of contents to static
|
|
|
|
.md-nav {
|
|
|
|
position: static;
|
|
|
|
background-color: transparent;
|
2016-09-23 17:46:16 +02:00
|
|
|
|
2017-03-11 14:07:07 +01:00
|
|
|
// 3rd level link
|
|
|
|
.md-nav__link {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-left: px2rem(28px);
|
2018-01-13 16:54:08 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(28px);
|
2018-01-13 16:54:08 +01:00
|
|
|
padding-left: initial;
|
|
|
|
}
|
2017-03-11 14:07:07 +01:00
|
|
|
}
|
2016-09-23 17:46:16 +02:00
|
|
|
|
2017-03-11 14:07:07 +01:00
|
|
|
// 4th level link
|
|
|
|
.md-nav .md-nav__link {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-left: px2rem(40px);
|
2018-01-13 16:54:08 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(40px);
|
2018-01-13 16:54:08 +01:00
|
|
|
padding-left: initial;
|
|
|
|
}
|
2017-03-11 14:07:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// 5th level link
|
|
|
|
.md-nav .md-nav .md-nav__link {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-left: px2rem(52px);
|
2018-01-13 16:54:08 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(52px);
|
2018-01-13 16:54:08 +01:00
|
|
|
padding-left: initial;
|
|
|
|
}
|
2017-03-11 14:07:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// 6th level link
|
|
|
|
.md-nav .md-nav .md-nav .md-nav__link {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-left: px2rem(64px);
|
2018-01-13 16:54:08 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(64px);
|
2018-01-13 16:54:08 +01:00
|
|
|
padding-left: initial;
|
|
|
|
}
|
2017-03-11 14:07:07 +01:00
|
|
|
}
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hide nested navigation by default
|
|
|
|
.md-nav__toggle ~ & {
|
2017-08-30 17:06:31 +07:00
|
|
|
display: flex;
|
|
|
|
transform: translateX(100%);
|
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
transform 250ms cubic-bezier(0.8, 0, 0.6, 1),
|
|
|
|
opacity 125ms 50ms;
|
2017-08-30 17:06:31 +07:00
|
|
|
opacity: 0;
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
[dir="rtl"] & {
|
|
|
|
transform: translateX(-100%);
|
|
|
|
}
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Expand nested navigation, if toggle is checked
|
|
|
|
.md-nav__toggle:checked ~ & {
|
2017-08-30 17:06:31 +07:00
|
|
|
transform: translateX(0);
|
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
|
|
opacity 125ms 125ms;
|
2017-08-30 17:06:31 +07:00
|
|
|
opacity: 1;
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [tablet portrait -]: Show table of contents in drawer
|
|
|
|
@include break-to-device(tablet portrait) {
|
|
|
|
|
2016-09-23 17:46:16 +02:00
|
|
|
// Show link to table of contents - higher specificity is necessary to
|
2016-09-30 13:29:45 +02:00
|
|
|
// display the table of contents inside the drawer
|
2018-06-10 06:45:16 -06:00
|
|
|
html &__link[for="__toc"] {
|
2016-09-23 11:56:25 +02:00
|
|
|
display: block;
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(48px);
|
2016-09-23 11:56:25 +02:00
|
|
|
|
|
|
|
// Hide link to current item
|
|
|
|
+ .md-nav__link {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Show table of contents
|
2016-09-23 17:46:16 +02:00
|
|
|
& ~ .md-nav {
|
2016-09-23 11:56:25 +02:00
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
}
|
2016-09-23 17:46:16 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
html [dir="rtl"] &__link {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(16px);
|
|
|
|
padding-left: px2rem(48px);
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
|
|
|
|
2016-09-23 17:46:16 +02:00
|
|
|
// Repository containing source
|
|
|
|
&__source {
|
|
|
|
display: block;
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: 0 px2rem(4px);
|
2016-12-28 16:54:59 +01:00
|
|
|
background-color: mix($md-color-primary, $md-color-black, 75%);
|
2016-09-23 17:46:16 +02:00
|
|
|
color: $md-color-white;
|
|
|
|
}
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// [screen +]: Tree-like navigation
|
|
|
|
@include break-from-device(screen) {
|
|
|
|
|
2016-09-24 18:52:37 +02:00
|
|
|
// Animation is only possible if JavaScript is available, as the max-height
|
2016-09-30 13:29:45 +02:00
|
|
|
// property must be calculated before transitioning
|
2020-02-17 10:04:12 +01:00
|
|
|
transition: max-height 250ms cubic-bezier(0.86, 0, 0.07, 1);
|
2016-09-24 18:52:37 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// List title
|
|
|
|
.md-nav__title {
|
|
|
|
|
|
|
|
// Snap to site and table of contents title
|
|
|
|
&[for="__drawer"],
|
|
|
|
&[for="__toc"] {
|
|
|
|
scroll-snap-align: start;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hide icons
|
|
|
|
.md-nav__icon {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-02-15 21:34:14 +01:00
|
|
|
}
|
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// Hide nested navigation by default
|
|
|
|
.md-nav__toggle ~ & {
|
2020-02-15 21:34:14 +01:00
|
|
|
display: none;
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
|
2020-02-15 21:34:14 +01:00
|
|
|
// Show nested navigation, if toggle is checked
|
2019-11-22 18:42:25 +01:00
|
|
|
.md-nav__toggle:checked ~ & {
|
2020-02-15 21:34:14 +01:00
|
|
|
display: block;
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
|
2016-12-28 16:28:40 +01:00
|
|
|
// Hide titles for nested navigation
|
|
|
|
&__item--nested > .md-nav > &__title {
|
|
|
|
display: none;
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Icon
|
|
|
|
&__icon {
|
|
|
|
height: px2rem(18px);
|
|
|
|
float: right;
|
|
|
|
transition: transform 250ms;
|
2016-09-23 11:56:25 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Inline icon and adjust to match font size
|
|
|
|
svg {
|
2016-09-23 11:56:25 +02:00
|
|
|
display: inline-block;
|
2020-02-24 18:07:50 +01:00
|
|
|
width: px2rem(18px);
|
|
|
|
height: px2rem(18px);
|
|
|
|
vertical-align: px2rem(-2px);
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Rotate icon for expanded lists
|
2020-02-24 18:07:50 +01:00
|
|
|
.md-nav__item--nested .md-nav__toggle:checked ~ .md-nav__link & {
|
|
|
|
transform: rotateZ(90deg);
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-09-04 17:11:58 +02:00
|
|
|
}
|