2016-09-04 18:11:58 +03:00
|
|
|
////
|
|
|
|
/// Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com>
|
|
|
|
///
|
|
|
|
/// 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-09-04 18:32:12 +03:00
|
|
|
// ----------------------------------------------------------------------------
|
2016-10-06 13:14:33 +03:00
|
|
|
// Rules
|
2016-09-04 18:32:12 +03:00
|
|
|
// ----------------------------------------------------------------------------
|
2016-09-04 18:11:58 +03:00
|
|
|
|
2016-10-06 13:14:33 +03:00
|
|
|
// Sidebar container
|
2016-08-07 19:01:56 +03:00
|
|
|
.md-sidebar {
|
|
|
|
position: relative;
|
|
|
|
width: 24.2rem;
|
|
|
|
float: left;
|
|
|
|
overflow: visible;
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Lock sidebar to container height (account for fixed header)
|
2016-10-06 13:14:33 +03:00
|
|
|
&[data-md-locked] {
|
2016-08-07 19:01:56 +03:00
|
|
|
position: fixed;
|
|
|
|
top: 5.6rem;
|
|
|
|
}
|
|
|
|
|
2016-10-21 22:15:35 +03:00
|
|
|
// Omit repaint of whole page by promoting primary sidebar to a separate
|
|
|
|
// layer, but not the secondary sidebar to omit jittering
|
2016-10-18 21:53:08 +03:00
|
|
|
&--primary {
|
|
|
|
backface-visibility: hidden;
|
|
|
|
}
|
|
|
|
|
2016-09-23 12:56:25 +03:00
|
|
|
// [tablet -]: Convert navigation to drawer
|
|
|
|
@include break-to-device(tablet) {
|
2016-08-07 19:01:56 +03:00
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Render primary sidebar as a slideout container
|
2016-08-07 19:01:56 +03:00
|
|
|
&--primary {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
2016-09-23 12:56:25 +03:00
|
|
|
left: -24.2rem;
|
|
|
|
width: 24.2rem;
|
2016-08-07 19:01:56 +03:00
|
|
|
height: 100%;
|
2016-10-23 11:21:37 +03:00
|
|
|
transform: translateX(0);
|
|
|
|
transition:
|
|
|
|
transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1.0),
|
|
|
|
box-shadow 0.25s;
|
2016-09-04 18:11:58 +03:00
|
|
|
background: $md-color-white;
|
2016-09-23 12:56:25 +03:00
|
|
|
z-index: 2;
|
2016-08-07 19:01:56 +03:00
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Just hide drawer, if browser doesn't support 3D transforms
|
2016-08-07 19:01:56 +03:00
|
|
|
.no-csstransforms3d & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Expanded drawer
|
2016-09-04 18:11:58 +03:00
|
|
|
.md-toggle--drawer:checked ~ .md-container & {
|
2016-09-23 18:46:16 +03:00
|
|
|
@include z-depth(8);
|
|
|
|
|
2016-10-23 11:21:37 +03:00
|
|
|
transform: translateX(24.2rem);
|
2016-08-07 19:01:56 +03:00
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Just show drawer, if browser doesn't support 3D transforms
|
2016-08-07 19:01:56 +03:00
|
|
|
.no-csstransforms3d & {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
2016-09-23 12:56:25 +03:00
|
|
|
|
|
|
|
// Hide overflow for nested navigation
|
|
|
|
.md-sidebar__scrollwrap {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
2016-08-07 19:01:56 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Secondary sidebar with table of contents
|
2016-08-07 19:01:56 +03:00
|
|
|
&--secondary {
|
|
|
|
display: none;
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// [tablet landscape +]: Show table of contents next to body copy
|
2016-08-07 19:01:56 +03:00
|
|
|
@include break-from-device(tablet landscape) {
|
|
|
|
display: block;
|
|
|
|
float: right;
|
|
|
|
|
2016-09-08 20:43:23 +03:00
|
|
|
// Hack: align right in case of locked sidebar
|
2016-10-06 13:14:33 +03:00
|
|
|
&[data-md-locked] {
|
2016-08-07 19:01:56 +03:00
|
|
|
margin-left: 100%;
|
|
|
|
transform: translate(-100%, 0);
|
|
|
|
|
2016-09-23 12:56:25 +03:00
|
|
|
// [screen +]: Limit to grid
|
|
|
|
@include break-from-device(screen) {
|
2016-09-02 01:33:45 +03:00
|
|
|
margin-left: 120.0rem;
|
2016-08-07 19:01:56 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Wrapper for scrolling on overflow
|
2016-08-07 19:01:56 +03:00
|
|
|
&__scrollwrap {
|
|
|
|
margin: 2.4rem 0.4rem;
|
|
|
|
overflow-y: scroll;
|
2016-09-23 18:46:16 +03:00
|
|
|
// -webkit-overflow-scrolling: touch; // TODO: problems with iOS
|
2016-08-07 19:01:56 +03:00
|
|
|
|
2016-09-23 12:56:25 +03:00
|
|
|
// [tablet -]: Adjust margins
|
|
|
|
@include break-to-device(tablet) {
|
2016-08-07 19:01:56 +03:00
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Adjust margins for primary scrollbar
|
2016-08-07 19:01:56 +03:00
|
|
|
.md-sidebar--primary & {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Limit height to window, if JavaScript is available
|
2016-08-07 19:01:56 +03:00
|
|
|
.js & {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
2016-09-04 18:11:58 +03:00
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
2016-08-07 19:01:56 +03:00
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Override native scrollbar styles
|
2016-08-07 19:01:56 +03:00
|
|
|
&::-webkit-scrollbar {
|
|
|
|
width: 0.4rem;
|
|
|
|
height: 0.4rem;
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Style scrollbar thumb
|
2016-08-07 19:01:56 +03:00
|
|
|
&-thumb {
|
2016-09-30 14:29:45 +03:00
|
|
|
background-color: $md-color-black--lighter;
|
|
|
|
|
|
|
|
// Hovered scrollbar thumb
|
|
|
|
&:hover {
|
|
|
|
background-color: $md-color-accent;
|
|
|
|
}
|
2016-08-07 19:01:56 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-23 11:21:37 +03:00
|
|
|
// Sidebar content
|
2016-08-07 19:01:56 +03:00
|
|
|
&__inner {
|
|
|
|
|
2016-09-23 12:56:25 +03:00
|
|
|
// [screen +]: Add line for reference
|
|
|
|
@include break-from-device(screen) {
|
2016-10-21 22:15:35 +03:00
|
|
|
border-right: 0.1rem solid $md-color-black--lightest;
|
2016-08-07 19:01:56 +03:00
|
|
|
}
|
|
|
|
}
|
2016-09-04 18:11:58 +03:00
|
|
|
}
|