2016-09-04 17:11:58 +02:00
|
|
|
////
|
2017-01-06 19:11:18 +01:00
|
|
|
/// Copyright (c) 2016-2017 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-09-04 17:32:12 +02:00
|
|
|
// Application header (stays always on top)
|
2016-08-07 18:01:56 +02:00
|
|
|
.md-header {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
2016-09-04 17:11:58 +02:00
|
|
|
left: 0;
|
2017-11-19 16:02:33 +01:00
|
|
|
height: 4.8rem;
|
2017-11-19 17:41:06 +01:00
|
|
|
transition:
|
|
|
|
background-color 0.25s,
|
|
|
|
color 0.25s;
|
2016-12-17 12:53:24 +01:00
|
|
|
background-color: $md-color-primary;
|
2016-08-07 18:01:56 +02:00
|
|
|
color: $md-color-white;
|
2017-11-22 00:13:56 +01:00
|
|
|
box-shadow: none;
|
2017-05-31 15:22:59 +02:00
|
|
|
z-index: 2;
|
2017-03-03 21:57:15 +01:00
|
|
|
// Hack: putting the header on the GPU avoids unnecessary repaints
|
|
|
|
backface-visibility: hidden;
|
2016-10-24 18:02:53 +02:00
|
|
|
|
2017-01-26 23:20:38 +01:00
|
|
|
// Always show shadow, in case JavaScript is not available
|
|
|
|
.no-js & {
|
2017-12-27 11:31:07 +01:00
|
|
|
transition: none;
|
2017-11-19 17:41:06 +01:00
|
|
|
box-shadow: none;
|
2017-01-26 23:20:38 +01:00
|
|
|
}
|
|
|
|
|
2017-11-22 00:13:56 +01:00
|
|
|
// Show and animate shadow
|
|
|
|
&[data-md-state="shadow"] {
|
|
|
|
transition:
|
|
|
|
background-color 0.25s,
|
|
|
|
color 0.25s,
|
|
|
|
box-shadow 0.25s;
|
|
|
|
box-shadow:
|
|
|
|
0 0 0.4rem rgba(0, 0, 0, 0.1),
|
|
|
|
0 0.4rem 0.8rem rgba(0, 0, 0, 0.2);
|
2017-01-27 22:41:55 +01:00
|
|
|
}
|
|
|
|
|
2016-10-24 18:02:53 +02:00
|
|
|
// Hide for print
|
|
|
|
@media print {
|
|
|
|
display: none;
|
|
|
|
}
|
2016-09-13 20:58:28 +02:00
|
|
|
}
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2016-09-13 20:58:28 +02:00
|
|
|
// Navigation within header
|
|
|
|
.md-header-nav {
|
2017-11-19 16:02:33 +01:00
|
|
|
padding: 0 0.4rem;
|
2016-02-16 15:51:07 +01:00
|
|
|
|
2017-01-14 20:13:10 +01:00
|
|
|
// Icon buttons
|
|
|
|
&__button {
|
2016-09-23 11:56:25 +02:00
|
|
|
@extend %md-icon__button;
|
|
|
|
|
2016-09-13 20:58:28 +02:00
|
|
|
position: relative;
|
|
|
|
transition: opacity 0.25s;
|
|
|
|
z-index: 1;
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2016-09-13 20:58:28 +02:00
|
|
|
// Hovered icon
|
|
|
|
&:hover {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2016-08-08 23:33:06 +02:00
|
|
|
|
2017-09-01 15:22:50 +07:00
|
|
|
// Set correct display on image or icon
|
|
|
|
&.md-logo * {
|
2017-01-14 20:13:10 +01:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// Hide search icon, if JavaScript is not available.
|
2017-01-14 20:13:10 +01:00
|
|
|
.no-js &.md-icon--search {
|
2016-10-23 10:21:37 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [tablet landscape +]: Hide the search icon
|
|
|
|
@include break-from-device(tablet landscape) {
|
2016-08-08 23:33:06 +02:00
|
|
|
|
2016-09-13 20:58:28 +02:00
|
|
|
// Search icon
|
2017-01-11 23:49:36 +01:00
|
|
|
&.md-icon--search {
|
2016-09-30 13:29:45 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-14 20:13:10 +01:00
|
|
|
// [tablet -]: Hide the home icon or logo
|
2016-09-30 13:29:45 +02:00
|
|
|
@include break-to-device(tablet) {
|
|
|
|
|
2017-01-14 20:13:10 +01:00
|
|
|
// Home icon or logo
|
|
|
|
&.md-icon--home,
|
|
|
|
&.md-logo {
|
2016-09-30 13:29:45 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [screen +]: Hide the menu icon
|
|
|
|
@include break-from-device(screen) {
|
|
|
|
|
|
|
|
// Menu icon
|
2017-01-11 23:49:36 +01:00
|
|
|
&.md-icon--menu {
|
2016-09-13 20:58:28 +02:00
|
|
|
display: none;
|
2016-08-08 23:33:06 +02:00
|
|
|
}
|
2016-02-16 15:51:07 +01:00
|
|
|
}
|
2016-09-13 20:58:28 +02:00
|
|
|
}
|
2016-02-16 15:51:07 +01:00
|
|
|
|
2017-11-19 16:46:01 +01:00
|
|
|
// Header topics
|
|
|
|
&__topic {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
transition:
|
|
|
|
transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1),
|
2017-11-19 17:28:00 +01:00
|
|
|
opacity 0.15s;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
2017-11-19 16:46:01 +01:00
|
|
|
|
|
|
|
// Page title
|
|
|
|
& + & {
|
2017-11-21 21:32:25 +01:00
|
|
|
transform: translateX(2.5rem);
|
2017-11-19 17:28:00 +01:00
|
|
|
transition:
|
|
|
|
transform 0.4s cubic-bezier(1, 0.7, 0.1, 0.1),
|
|
|
|
opacity 0.15s;
|
2017-11-19 16:46:01 +01:00
|
|
|
opacity: 0;
|
|
|
|
z-index: -1;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
2017-11-19 17:41:06 +01:00
|
|
|
|
|
|
|
// Induce ellipsis, if no JavaScript is available
|
|
|
|
.no-js & {
|
|
|
|
position: initial;
|
|
|
|
}
|
2017-12-27 11:31:07 +01:00
|
|
|
|
|
|
|
// Hide page title as it is invisible anyway and will overflow the header
|
|
|
|
.no-js & + & {
|
|
|
|
display: none;
|
|
|
|
}
|
2017-11-19 16:46:01 +01:00
|
|
|
}
|
|
|
|
|
2016-12-28 11:49:57 +01:00
|
|
|
// Header title - set line height to match icon for correct alignment
|
2016-09-13 20:58:28 +02:00
|
|
|
&__title {
|
2017-01-01 15:59:44 +01:00
|
|
|
padding: 0 2rem;
|
2016-09-13 20:58:28 +02:00
|
|
|
font-size: 1.8rem;
|
|
|
|
line-height: 4.8rem;
|
2017-11-19 16:46:01 +01:00
|
|
|
|
|
|
|
// Show page title
|
2017-11-19 17:28:00 +01:00
|
|
|
&[data-md-state="active"] .md-header-nav__topic {
|
2017-11-21 21:32:25 +01:00
|
|
|
transform: translateX(-2.5rem);
|
2017-11-19 17:28:00 +01:00
|
|
|
transition:
|
|
|
|
transform 0.4s cubic-bezier(1, 0.7, 0.1, 0.1),
|
|
|
|
opacity 0.15s;
|
|
|
|
opacity: 0;
|
|
|
|
z-index: -1;
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
|
|
// Page title
|
|
|
|
& + .md-header-nav__topic {
|
|
|
|
transform: translateX(0);
|
2017-11-19 16:46:01 +01:00
|
|
|
transition:
|
2017-11-19 17:28:00 +01:00
|
|
|
transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1),
|
|
|
|
opacity 0.15s;
|
|
|
|
opacity: 1;
|
|
|
|
z-index: 0;
|
|
|
|
pointer-events: initial;
|
2017-11-19 16:46:01 +01:00
|
|
|
}
|
|
|
|
}
|
2016-01-28 23:27:15 +01:00
|
|
|
}
|
2016-09-23 17:46:16 +02:00
|
|
|
|
|
|
|
// Repository containing source
|
|
|
|
&__source {
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
// [tablet landscape +]: Show the reposistory from tablet
|
|
|
|
@include break-from-device(tablet landscape) {
|
|
|
|
display: block;
|
2017-01-01 15:59:44 +01:00
|
|
|
width: 23rem;
|
|
|
|
max-width: 23rem;
|
2017-06-06 17:48:39 +02:00
|
|
|
margin-left: 2.8rem;
|
2016-09-23 17:46:16 +02:00
|
|
|
padding-right: 1.2rem;
|
|
|
|
}
|
|
|
|
}
|
2016-09-04 17:11:58 +02:00
|
|
|
}
|