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-09-04 17:32:12 +02:00
|
|
|
// Application header (stays always on top)
|
2016-08-07 18:01:56 +02:00
|
|
|
.md-header {
|
2020-01-25 14:25:50 +01:00
|
|
|
position: sticky;
|
2016-08-07 18:01:56 +02:00
|
|
|
top: 0;
|
|
|
|
right: 0;
|
2016-09-04 17:11:58 +02:00
|
|
|
left: 0;
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: 2;
|
2019-02-12 19:13:08 +01:00
|
|
|
height: px2rem(48px);
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-primary-bg-color);
|
2020-03-06 15:21:08 +01:00
|
|
|
background-color: var(--md-primary-fg-color);
|
2020-03-01 00:11:30 +01:00
|
|
|
// Hack: reduce jitter by adding a transparent box shadow of the same size
|
|
|
|
// so the size of the layer doesn't change during animation
|
|
|
|
box-shadow:
|
|
|
|
0 0 px2rem(4px) rgba(0, 0, 0, 0),
|
|
|
|
0 px2rem(4px) px2rem(8px) rgba(0, 0, 0, 0);
|
2020-03-06 15:21:08 +01:00
|
|
|
transition:
|
2020-03-26 11:19:20 +01:00
|
|
|
color 250ms,
|
|
|
|
background-color 250ms;
|
2016-10-24 18:02:53 +02:00
|
|
|
|
2020-02-13 16:49:08 +01:00
|
|
|
// Always hide shadow, in case JavaScript is not available
|
2017-01-26 23:20:38 +01:00
|
|
|
.no-js & {
|
2017-11-19 17:41:06 +01:00
|
|
|
box-shadow: none;
|
2020-03-06 15:21:08 +01:00
|
|
|
transition: 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"] {
|
2020-03-06 15:21:08 +01:00
|
|
|
box-shadow:
|
|
|
|
0 0 px2rem(4px) rgba(0, 0, 0, 0.1),
|
|
|
|
0 px2rem(4px) px2rem(8px) rgba(0, 0, 0, 0.2);
|
2017-11-22 00:13:56 +01:00
|
|
|
transition:
|
2020-02-17 17:25:40 +01:00
|
|
|
color 250ms,
|
2020-03-26 11:19:20 +01:00
|
|
|
background-color 250ms,
|
2020-02-17 17:25:40 +01:00
|
|
|
box-shadow 250ms;
|
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 {
|
2020-02-24 18:07:50 +01:00
|
|
|
display: flex;
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: 0 px2rem(4px);
|
2016-02-16 15:51:07 +01:00
|
|
|
|
2017-01-14 20:13:10 +01:00
|
|
|
// Icon buttons
|
|
|
|
&__button {
|
2016-09-13 20:58:28 +02:00
|
|
|
position: relative;
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: 1;
|
2020-03-23 10:45:06 +01:00
|
|
|
display: block;
|
2020-02-27 11:37:02 +01:00
|
|
|
margin: px2rem(4px);
|
|
|
|
padding: px2rem(8px);
|
|
|
|
cursor: pointer;
|
2020-03-06 15:21:08 +01:00
|
|
|
transition: opacity 250ms;
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
|
|
|
|
// Flip icon vertically
|
|
|
|
svg {
|
|
|
|
transform: scaleX(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Focused or hovered icon
|
|
|
|
&:focus,
|
2016-09-13 20:58:28 +02:00
|
|
|
&:hover {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2016-08-08 23:33:06 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Logo
|
|
|
|
&.md-logo {
|
|
|
|
margin: px2rem(4px);
|
|
|
|
padding: px2rem(8px);
|
|
|
|
|
2020-02-25 15:02:54 +01:00
|
|
|
// Image or icon
|
|
|
|
img,
|
2020-02-24 18:07:50 +01:00
|
|
|
svg {
|
2020-02-25 15:02:54 +01:00
|
|
|
display: block;
|
2020-02-24 18:07:50 +01:00
|
|
|
width: px2rem(24px);
|
|
|
|
height: px2rem(24px);
|
|
|
|
fill: currentColor;
|
|
|
|
}
|
2017-01-14 20:13:10 +01:00
|
|
|
}
|
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// Hide search icon, if JavaScript is not available.
|
2020-02-24 22:44:12 +01:00
|
|
|
.no-js &[for="__search"] {
|
2016-10-23 10:21:37 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2020-02-23 13:36:51 +01:00
|
|
|
// [tablet landscape +]: Hide the search button
|
2016-10-23 10:21:37 +02:00
|
|
|
@include break-from-device(tablet landscape) {
|
2016-08-08 23:33:06 +02:00
|
|
|
|
2020-02-23 13:36:51 +01:00
|
|
|
// Search button
|
|
|
|
&[for="__search"] {
|
2016-09-30 13:29:45 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-23 13:36:51 +01:00
|
|
|
// [tablet -]: Hide the logo
|
2016-09-30 13:29:45 +02:00
|
|
|
@include break-to-device(tablet) {
|
|
|
|
|
2020-02-23 13:36:51 +01:00
|
|
|
// Logo
|
2017-01-14 20:13:10 +01:00
|
|
|
&.md-logo {
|
2016-09-30 13:29:45 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-23 13:36:51 +01:00
|
|
|
// [screen +]: Hide the menu button
|
2016-09-30 13:29:45 +02:00
|
|
|
@include break-from-device(screen) {
|
|
|
|
|
2020-02-23 13:36:51 +01:00
|
|
|
// Menu button
|
|
|
|
&[for="__drawer"] {
|
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 {
|
|
|
|
position: absolute;
|
2020-02-24 22:44:12 +01:00
|
|
|
width: 100%;
|
2020-03-06 15:21:08 +01:00
|
|
|
transition:
|
|
|
|
transform 400ms cubic-bezier(0.1, 0.7, 0.1, 1),
|
|
|
|
opacity 150ms;
|
2017-11-19 16:46:01 +01:00
|
|
|
|
2020-03-23 10:45:06 +01:00
|
|
|
// Adjust for right-to-left languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
padding-right: px2rem(20px);
|
|
|
|
padding-left: initial;
|
|
|
|
}
|
|
|
|
|
2017-11-19 16:46:01 +01:00
|
|
|
// Page title
|
|
|
|
& + & {
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: -1;
|
2019-11-27 19:12:49 +01:00
|
|
|
transform: translateX(px2rem(25px));
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 0;
|
2017-11-19 17:28:00 +01:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
transform 400ms cubic-bezier(1, 0.7, 0.1, 0.1),
|
|
|
|
opacity 150ms;
|
2017-11-19 16:46:01 +01:00
|
|
|
pointer-events: none;
|
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-11-27 19:12:49 +01:00
|
|
|
transform: translateX(px2rem(-25px));
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
2017-11-19 16:46:01 +01:00
|
|
|
}
|
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 {
|
2020-02-24 18:07:50 +01:00
|
|
|
flex-grow: 1;
|
2020-03-25 17:13:48 +01:00
|
|
|
padding: 0 px2rem(20px);
|
2019-02-12 19:13:08 +01:00
|
|
|
font-size: px2rem(18px);
|
|
|
|
line-height: px2rem(48px);
|
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 {
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: -1;
|
2019-11-27 19:12:49 +01:00
|
|
|
transform: translateX(px2rem(-25px));
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 0;
|
2017-11-19 17:28:00 +01:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
transform 400ms cubic-bezier(1, 0.7, 0.1, 0.1),
|
|
|
|
opacity 150ms;
|
2017-11-19 17:28:00 +01:00
|
|
|
pointer-events: none;
|
|
|
|
|
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-11-27 19:12:49 +01:00
|
|
|
transform: translateX(px2rem(25px));
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
|
|
|
|
2017-11-19 17:28:00 +01:00
|
|
|
// Page title
|
|
|
|
& + .md-header-nav__topic {
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: 0;
|
2019-11-27 19:12:49 +01:00
|
|
|
transform: translateX(0);
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 1;
|
2017-11-19 16:46:01 +01:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
transform 400ms cubic-bezier(0.1, 0.7, 0.1, 1),
|
|
|
|
opacity 150ms;
|
2017-11-19 17:28:00 +01:00
|
|
|
pointer-events: initial;
|
2017-11-19 16:46:01 +01:00
|
|
|
}
|
|
|
|
}
|
2020-02-24 18:07:50 +01:00
|
|
|
|
|
|
|
// Patch ellipsis
|
|
|
|
> .md-header-nav__ellipsis {
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
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;
|
2019-05-17 21:35:11 +02:00
|
|
|
width: px2rem(234px);
|
|
|
|
max-width: px2rem(234px);
|
2020-02-10 14:05:39 +01:00
|
|
|
margin-left: px2rem(20px);
|
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"] & {
|
2020-02-10 14:05:39 +01:00
|
|
|
margin-right: px2rem(20px);
|
|
|
|
margin-left: initial;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [screen +]: Increase spacing of search bar
|
|
|
|
@include break-from-device(screen) {
|
|
|
|
margin-left: px2rem(28px);
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2020-02-10 14:05:39 +01:00
|
|
|
[dir="rtl"] & {
|
|
|
|
margin-right: px2rem(28px);
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
2016-09-23 17:46:16 +02:00
|
|
|
}
|
|
|
|
}
|
2016-09-04 17:11:58 +02:00
|
|
|
}
|