2016-09-04 17:11:58 +02:00
|
|
|
////
|
2019-01-01 18:42:00 +01:00
|
|
|
/// Copyright (c) 2016-2019 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
|
|
|
|
////
|
|
|
|
|
2017-03-21 15:27:45 +01:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Variables
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Active (toggled) drawer
|
|
|
|
$md-toggle__drawer--checked:
|
|
|
|
"[data-md-toggle=\"drawer\"]:checked ~ .md-container";
|
|
|
|
|
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-09-04 17:11:58 +02:00
|
|
|
|
2016-10-06 12:14:33 +02:00
|
|
|
// Sidebar container
|
2016-08-07 18:01:56 +02:00
|
|
|
.md-sidebar {
|
2017-03-03 17:57:20 +01:00
|
|
|
position: absolute;
|
2016-08-07 18:01:56 +02:00
|
|
|
width: 24.2rem;
|
2017-01-15 14:57:06 +01:00
|
|
|
padding: 2.4rem 0;
|
2017-02-26 22:09:51 +01:00
|
|
|
overflow: hidden;
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2016-10-24 18:02:53 +02:00
|
|
|
// Hide for print
|
|
|
|
@media print {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Lock sidebar to container height (account for fixed header)
|
2016-12-15 15:55:40 +01:00
|
|
|
&[data-md-state="lock"] {
|
2016-08-07 18:01:56 +02:00
|
|
|
position: fixed;
|
2017-11-19 16:02:33 +01:00
|
|
|
top: 4.8rem;
|
2016-08-07 18:01:56 +02:00
|
|
|
}
|
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// [tablet -]: Convert navigation to drawer
|
|
|
|
@include break-to-device(tablet) {
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Render primary sidebar as a slideout container
|
2016-08-07 18:01:56 +02:00
|
|
|
&--primary {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
2016-09-23 11:56:25 +02:00
|
|
|
left: -24.2rem;
|
|
|
|
width: 24.2rem;
|
2016-08-07 18:01:56 +02:00
|
|
|
height: 100%;
|
2016-10-23 10:21:37 +02:00
|
|
|
transform: translateX(0);
|
|
|
|
transition:
|
2017-01-01 15:59:44 +01:00
|
|
|
transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
|
2016-10-23 10:21:37 +02:00
|
|
|
box-shadow 0.25s;
|
2016-12-17 12:53:24 +01:00
|
|
|
background-color: $md-color-white;
|
2017-06-01 22:24:48 +02:00
|
|
|
z-index: 3;
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2018-01-13 16:54:08 +01:00
|
|
|
// Adjust for RTL languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
right: -24.2rem;
|
|
|
|
left: initial;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Just hide drawer, if browser doesn't support 3D transforms
|
2016-08-07 18:01:56 +02:00
|
|
|
.no-csstransforms3d & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Expanded drawer
|
2017-03-21 15:27:45 +01:00
|
|
|
#{$md-toggle__drawer--checked} & {
|
2016-09-23 17:46:16 +02:00
|
|
|
@include z-depth(8);
|
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
transform: translateX(24.2rem);
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2018-01-13 16:54:08 +01:00
|
|
|
// Adjust for RTL languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
transform: translateX(-24.2rem);
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Just show drawer, if browser doesn't support 3D transforms
|
2016-08-07 18:01:56 +02:00
|
|
|
.no-csstransforms3d & {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
2016-09-23 11:56:25 +02:00
|
|
|
|
|
|
|
// Hide overflow for nested navigation
|
|
|
|
.md-sidebar__scrollwrap {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
2016-08-07 18:01:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Secondary sidebar with table of contents
|
2016-08-07 18:01:56 +02:00
|
|
|
&--secondary {
|
|
|
|
display: none;
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// [tablet landscape +]: Show table of contents next to body copy
|
2016-08-07 18:01:56 +02:00
|
|
|
@include break-from-device(tablet landscape) {
|
|
|
|
display: block;
|
2017-03-03 17:57:20 +01:00
|
|
|
margin-left: 100%;
|
|
|
|
transform: translate(-100%, 0);
|
2018-01-13 16:54:08 +01:00
|
|
|
|
|
|
|
// Adjust for RTL languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin-right: 100%;
|
|
|
|
margin-left: initial;
|
|
|
|
transform: translate(100%, 0);
|
|
|
|
}
|
2017-03-03 17:57:20 +01:00
|
|
|
}
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2017-03-03 17:57:20 +01:00
|
|
|
// [screen +]: Limit to grid
|
|
|
|
@include break-from-device(screen) {
|
|
|
|
margin-left: 122rem;
|
2018-01-13 16:54:08 +01:00
|
|
|
|
|
|
|
// Adjust for RTL languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin-right: 122rem;
|
|
|
|
margin-left: initial;
|
|
|
|
}
|
2016-08-07 18:01:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Wrapper for scrolling on overflow
|
2016-08-07 18:01:56 +02:00
|
|
|
&__scrollwrap {
|
2017-01-15 14:57:06 +01:00
|
|
|
max-height: 100%;
|
|
|
|
margin: 0 0.4rem;
|
2017-01-14 19:48:00 +01:00
|
|
|
overflow-y: auto;
|
2017-02-26 11:55:47 +01:00
|
|
|
// Hack: putting the scroll wrapper on the GPU massively reduces jitter
|
|
|
|
// when locking the sidebars into place
|
|
|
|
backface-visibility: hidden;
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// [tablet -]: Adjust margins
|
|
|
|
@include break-to-device(tablet) {
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2017-01-15 15:14:08 +01:00
|
|
|
// Stretch scrollwrap for primary sidebar
|
2016-08-07 18:01:56 +02:00
|
|
|
.md-sidebar--primary & {
|
2017-01-15 15:14:08 +01:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
2016-08-07 18:01:56 +02:00
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Override native scrollbar styles
|
2016-08-07 18:01:56 +02:00
|
|
|
&::-webkit-scrollbar {
|
|
|
|
width: 0.4rem;
|
|
|
|
height: 0.4rem;
|
2016-11-05 23:26:07 +01:00
|
|
|
}
|
2016-08-07 18:01:56 +02:00
|
|
|
|
2016-11-05 23:26:07 +01:00
|
|
|
// Style scrollbar thumb
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
|
|
background-color: $md-color-black--lighter;
|
2016-09-30 13:29:45 +02:00
|
|
|
|
2016-11-05 23:26:07 +01:00
|
|
|
// Hovered scrollbar thumb
|
|
|
|
&:hover {
|
|
|
|
background-color: $md-color-accent;
|
2016-08-07 18:01:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-09-04 17:11:58 +02:00
|
|
|
}
|