2017-01-27 22:41:55 +01:00
|
|
|
////
|
|
|
|
/// Copyright (c) 2016-2017 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
|
|
|
|
////
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Rules
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Tabs with outline
|
2017-01-26 21:10:52 +01:00
|
|
|
.md-tabs {
|
|
|
|
width: 100%;
|
2017-02-26 13:59:54 +01:00
|
|
|
transition: background 0.25s;
|
|
|
|
background: mix($md-color-primary, $md-color-black, 75%);
|
|
|
|
overflow: auto;
|
2017-01-26 21:10:52 +01:00
|
|
|
|
2017-01-27 23:09:31 +01:00
|
|
|
// [tablet -]: Hide tabs for tablet and below, as they don't make any sense
|
|
|
|
@include break-to-device(tablet) {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2017-02-26 22:09:51 +01:00
|
|
|
// Hide for print
|
|
|
|
@media print {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2017-01-27 22:41:55 +01:00
|
|
|
// List of items
|
2017-01-26 21:10:52 +01:00
|
|
|
&__list {
|
|
|
|
margin: 0;
|
2017-01-27 22:41:55 +01:00
|
|
|
margin-left: 0.4rem;
|
2017-01-26 21:10:52 +01:00
|
|
|
padding: 0;
|
|
|
|
list-style: none;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
2017-01-27 22:41:55 +01:00
|
|
|
// List item
|
2017-01-26 21:10:52 +01:00
|
|
|
&__item {
|
|
|
|
display: inline-block;
|
2017-01-28 17:56:34 +01:00
|
|
|
height: 4.8rem;
|
|
|
|
padding-right: 1.2rem;
|
|
|
|
padding-left: 1.2rem;
|
2017-01-26 21:10:52 +01:00
|
|
|
}
|
|
|
|
|
2017-01-28 17:56:34 +01:00
|
|
|
// Link inside item - could be defined as block elements and aligned via
|
|
|
|
// line height, but this would imply more repaints when scrolling
|
2017-01-26 21:10:52 +01:00
|
|
|
&__link {
|
|
|
|
display: block;
|
2017-01-28 17:56:34 +01:00
|
|
|
margin-top: 1.6rem;
|
2017-01-27 23:21:41 +01:00
|
|
|
transition:
|
2017-03-21 15:27:45 +01:00
|
|
|
color 0.25s,
|
2017-01-28 17:56:34 +01:00
|
|
|
transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1),
|
2017-03-21 15:27:45 +01:00
|
|
|
opacity 0.1s;
|
2017-01-26 21:10:52 +01:00
|
|
|
color: $md-color-white--light;
|
2017-01-27 22:41:55 +01:00
|
|
|
font-size: 1.4rem;
|
2017-01-26 21:10:52 +01:00
|
|
|
|
2017-01-27 22:41:55 +01:00
|
|
|
// Active or hovered link
|
2017-01-26 21:10:52 +01:00
|
|
|
&--active,
|
|
|
|
&:hover {
|
|
|
|
color: $md-color-white;
|
|
|
|
}
|
2017-01-28 17:56:34 +01:00
|
|
|
|
|
|
|
// Delay transitions by a small amount
|
|
|
|
@for $i from 2 through 16 {
|
|
|
|
.md-tabs__item:nth-child(#{$i}) & {
|
|
|
|
transition-delay: 0.02s * ($i - 1);
|
|
|
|
}
|
|
|
|
}
|
2017-01-27 22:41:55 +01:00
|
|
|
}
|
2017-01-26 21:10:52 +01:00
|
|
|
|
2017-02-26 14:15:21 +01:00
|
|
|
// Fade-out tabs background upon scrolling
|
2017-02-26 13:59:54 +01:00
|
|
|
&[data-md-state="hidden"] {
|
|
|
|
background: $md-color-primary;
|
2017-02-26 22:09:51 +01:00
|
|
|
pointer-events: none;
|
2017-02-26 13:59:54 +01:00
|
|
|
|
2017-02-26 14:15:21 +01:00
|
|
|
// Hide tabs upon scrolling - disable transition to minimizes repaints whilte
|
|
|
|
// scrolling down, while scrolling up seems to be okay
|
2017-02-26 13:59:54 +01:00
|
|
|
.md-tabs__link {
|
|
|
|
transform: translateY(50%);
|
|
|
|
transition:
|
2017-03-21 15:27:45 +01:00
|
|
|
color 0.25s,
|
2017-02-26 13:59:54 +01:00
|
|
|
transform 0s 0.4s,
|
2017-03-21 15:27:45 +01:00
|
|
|
opacity 0.1s;
|
2017-02-26 13:59:54 +01:00
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [screen +]: Adjust main navigation styles
|
|
|
|
@include break-from-device(screen) {
|
|
|
|
|
|
|
|
// Hide 1st level nested items, as they are listed in the tabs by setting
|
|
|
|
// font-size to zero, as we need to preserve bottom padding
|
|
|
|
~ .md-main .md-nav--primary > .md-nav__list > .md-nav__item--nested {
|
|
|
|
font-size: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We're on the 2nd+ level
|
|
|
|
&--active ~ .md-main {
|
|
|
|
|
|
|
|
// Adjust 1st level styles
|
|
|
|
.md-nav--primary {
|
|
|
|
|
|
|
|
// Hide site title
|
|
|
|
.md-nav__title--site {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hide 1st level normal items
|
|
|
|
& > .md-nav__list > .md-nav__item {
|
|
|
|
font-size: 0;
|
|
|
|
|
2017-02-26 17:06:13 +01:00
|
|
|
// Reset font-size for nested items and induce margin collapse
|
2017-02-26 13:59:54 +01:00
|
|
|
&--nested {
|
2017-02-26 17:06:13 +01:00
|
|
|
display: none;
|
2017-02-26 13:59:54 +01:00
|
|
|
font-size: 1.4rem;
|
|
|
|
overflow: auto;
|
|
|
|
|
|
|
|
// Render link same as main navigation title
|
|
|
|
> .md-nav__link {
|
|
|
|
margin-top: 1.2rem;
|
|
|
|
font-weight: 700;
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
|
|
// Hide icon for expansion
|
|
|
|
&::after {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-02-26 17:06:13 +01:00
|
|
|
|
|
|
|
// Show 1st level active nested items
|
|
|
|
&--active {
|
|
|
|
display: block;
|
|
|
|
}
|
2017-02-26 13:59:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Always expand nested navigation on 2nd level
|
|
|
|
.md-nav[data-md-level="1"] {
|
|
|
|
max-height: initial;
|
|
|
|
|
|
|
|
// Remove left spacing on 2nd level items
|
|
|
|
> .md-nav__list > .md-nav__item {
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-01-26 21:10:52 +01:00
|
|
|
}
|
|
|
|
}
|