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
|
|
|
|
////
|
|
|
|
|
2017-03-21 15:27:45 +01:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Variables
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Active (toggled) search
|
|
|
|
$md-toggle__search--checked:
|
|
|
|
"[data-md-toggle=\"search\"]:checked ~ .md-header";
|
|
|
|
|
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
|
|
|
// Search container
|
2016-09-02 00:33:45 +02:00
|
|
|
.md-search {
|
2020-02-24 18:07:50 +01:00
|
|
|
position: relative;
|
2016-09-23 11:56:25 +02:00
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// Hide search, if JavaScript is not available.
|
2016-09-30 13:29:45 +02:00
|
|
|
.no-js & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// [tablet landscape +]: Header-embedded search
|
|
|
|
@include break-from-device(tablet landscape) {
|
2020-02-10 14:05:39 +01:00
|
|
|
padding: px2rem(4px) 0;
|
2016-09-23 11:56:25 +02:00
|
|
|
}
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// Search modal overlay
|
|
|
|
&__overlay {
|
2017-04-22 14:10:32 +02:00
|
|
|
z-index: 1;
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 0;
|
2016-10-23 10:21:37 +02:00
|
|
|
|
2016-10-23 19:31:54 +02:00
|
|
|
// [tablet portrait -]: Full-screen search bar
|
2016-10-23 10:21:37 +02:00
|
|
|
@include break-to-device(tablet portrait) {
|
|
|
|
position: absolute;
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(4px);
|
2020-02-24 18:07:50 +01:00
|
|
|
left: px2rem(-44px);
|
|
|
|
width: px2rem(40px);
|
|
|
|
height: px2rem(40px);
|
2020-03-06 15:21:08 +01:00
|
|
|
overflow: hidden;
|
|
|
|
background-color: var(--md-default-bg-color);
|
|
|
|
border-radius: px2rem(20px);
|
2016-10-23 10:21:37 +02:00
|
|
|
transform-origin: center;
|
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
transform 300ms 100ms,
|
|
|
|
opacity 200ms 200ms;
|
2017-04-22 14:10:32 +02:00
|
|
|
pointer-events: none;
|
2016-10-23 10:21:37 +02: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-24 18:07:50 +01:00
|
|
|
right: px2rem(-44px);
|
2018-01-13 16:54:08 +01:00
|
|
|
left: initial;
|
|
|
|
}
|
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// Expanded overlay
|
2017-03-21 15:27:45 +01:00
|
|
|
#{$md-toggle__search--checked} & {
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 1;
|
2016-10-23 10:21:37 +02:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
transform 400ms,
|
|
|
|
opacity 100ms;
|
2016-10-23 10:21:37 +02:00
|
|
|
}
|
|
|
|
}
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-10-23 19:31:54 +02:00
|
|
|
// Set scale factors
|
2017-03-21 15:27:45 +01:00
|
|
|
#{$md-toggle__search--checked} & {
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// [mobile portrait -]: Scale up 45 times
|
|
|
|
@include break-to-device(mobile portrait) {
|
|
|
|
transform: scale(45);
|
|
|
|
}
|
|
|
|
|
|
|
|
// [mobile landscape]: Scale up 60 times
|
|
|
|
@include break-at-device(mobile landscape) {
|
|
|
|
transform: scale(60);
|
|
|
|
}
|
|
|
|
|
2016-10-23 19:31:54 +02:00
|
|
|
// [tablet portrait]: Scale up 75 times
|
2016-10-23 10:21:37 +02:00
|
|
|
@include break-at-device(tablet portrait) {
|
|
|
|
transform: scale(75);
|
|
|
|
}
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
2017-04-22 14:10:32 +02:00
|
|
|
|
|
|
|
// [tablet landscape +]: Overlay for better focus on search
|
|
|
|
@include break-from-device(tablet landscape) {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
2020-03-06 15:21:08 +01:00
|
|
|
background-color: var(--md-default-fg-color--light);
|
|
|
|
cursor: pointer;
|
2017-04-22 14:10:32 +02:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
width 0ms 250ms,
|
|
|
|
height 0ms 250ms,
|
|
|
|
opacity 250ms;
|
2017-04-22 14:10:32 +02: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"] & {
|
|
|
|
right: 0;
|
|
|
|
left: initial;
|
|
|
|
}
|
|
|
|
|
2017-04-22 14:10:32 +02:00
|
|
|
// Expanded overlay
|
|
|
|
#{$md-toggle__search--checked} & {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 1;
|
2017-04-22 14:10:32 +02:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
width 0ms,
|
|
|
|
height 0ms,
|
|
|
|
opacity 250ms;
|
2017-04-22 14:10:32 +02:00
|
|
|
}
|
|
|
|
}
|
2016-10-23 10:21:37 +02:00
|
|
|
}
|
2016-09-30 13:29:45 +02:00
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// Search modal wrapper
|
|
|
|
&__inner {
|
2020-03-01 00:11:30 +01:00
|
|
|
// Hack: reduce jitter
|
|
|
|
backface-visibility: hidden;
|
2016-10-23 10:21:37 +02:00
|
|
|
|
|
|
|
// [tablet portrait -]: Put search modal off-canvas by default
|
|
|
|
@include break-to-device(tablet portrait) {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 100%;
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: 2;
|
2017-10-19 09:23:22 +02:00
|
|
|
width: 100%;
|
2016-10-23 10:21:37 +02:00
|
|
|
height: 100%;
|
|
|
|
transform: translateX(5%);
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 0;
|
2016-10-23 10:21:37 +02:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
right 0ms 300ms,
|
|
|
|
left 0ms 300ms,
|
|
|
|
transform 150ms 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
|
|
opacity 150ms 150ms;
|
2016-10-23 10:21:37 +02:00
|
|
|
|
|
|
|
// Active search modal
|
2017-03-21 15:27:45 +01:00
|
|
|
#{$md-toggle__search--checked} & {
|
2016-10-23 10:21:37 +02:00
|
|
|
left: 0;
|
|
|
|
transform: translateX(0);
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 1;
|
2016-10-23 10:21:37 +02:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
right 0ms 0ms,
|
|
|
|
left 0ms 0ms,
|
|
|
|
transform 150ms 150ms cubic-bezier(0.1, 0.7, 0.1, 1),
|
|
|
|
opacity 150ms 150ms;
|
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"] & {
|
|
|
|
right: 0;
|
|
|
|
left: initial;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
2018-01-13 16:54:08 +01:00
|
|
|
html [dir="rtl"] & {
|
|
|
|
right: 100%;
|
|
|
|
left: initial;
|
|
|
|
transform: translateX(-5%);
|
2016-10-23 10:21:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [tablet landscape +]: Header-embedded search
|
|
|
|
@include break-from-device(tablet landscape) {
|
2017-10-19 09:23:22 +02:00
|
|
|
position: relative;
|
2020-03-06 15:21:08 +01:00
|
|
|
float: right;
|
2020-02-10 14:05:39 +01:00
|
|
|
width: px2rem(234px);
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: px2rem(2px) 0;
|
2020-02-17 10:04:12 +01:00
|
|
|
transition: width 250ms cubic-bezier(0.1, 0.7, 0.1, 1);
|
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-04-28 10:34:27 +02:00
|
|
|
float: left;
|
2019-04-28 10:20:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-30 10:36:18 +01:00
|
|
|
// Set maximum width
|
2017-03-21 15:27:45 +01:00
|
|
|
#{$md-toggle__search--checked} & {
|
2016-10-30 10:36:18 +01:00
|
|
|
|
|
|
|
// [tablet landscape]: Do not overlay title
|
|
|
|
@include break-at-device(tablet landscape) {
|
2019-02-12 19:13:08 +01:00
|
|
|
width: px2rem(468px);
|
2016-10-30 10:36:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// [screen +]: Match content width
|
|
|
|
@include break-from-device(screen) {
|
2019-02-12 19:13:08 +01:00
|
|
|
width: px2rem(688px);
|
2016-09-30 13:29:45 +02:00
|
|
|
}
|
|
|
|
}
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
|
|
|
|
2017-10-19 09:23:22 +02:00
|
|
|
// Search form
|
|
|
|
&__form {
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
// [tablet landscape +]: Header-embedded search
|
|
|
|
@include break-from-device(tablet landscape) {
|
2019-02-12 19:13:08 +01:00
|
|
|
border-radius: px2rem(2px);
|
2017-10-19 09:23:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-23 19:31:54 +02:00
|
|
|
// Search input
|
2016-09-02 00:33:45 +02:00
|
|
|
&__input {
|
2016-10-23 19:31:54 +02:00
|
|
|
position: relative;
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: 2;
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: 0 px2rem(44px) 0 px2rem(72px);
|
2016-09-13 20:58:28 +02:00
|
|
|
text-overflow: ellipsis;
|
2016-09-02 00:33:45 +02: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-02-12 19:13:08 +01:00
|
|
|
padding: 0 px2rem(72px) 0 px2rem(44px);
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
|
|
|
|
2017-04-01 15:54:50 +02:00
|
|
|
// Transition on placeholder
|
|
|
|
&::placeholder {
|
2020-03-04 15:17:02 +01:00
|
|
|
transition: color 250ms;
|
2017-04-01 15:54:50 +02:00
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Placeholder and icon color in active state
|
2017-03-19 19:49:19 +01:00
|
|
|
~ .md-search__icon,
|
2016-09-02 00:33:45 +02:00
|
|
|
&::placeholder {
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-default-fg-color--light);
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
|
|
|
|
2016-12-28 19:00:04 +01:00
|
|
|
// Remove the "x" rendered by Internet Explorer
|
|
|
|
&::-ms-clear {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// [tablet portrait -]: Full-screen search bar
|
|
|
|
@include break-to-device(tablet portrait) {
|
2016-09-02 00:33:45 +02:00
|
|
|
width: 100%;
|
2019-02-12 19:13:08 +01:00
|
|
|
height: px2rem(48px);
|
|
|
|
font-size: px2rem(18px);
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
|
|
|
|
2016-10-23 10:21:37 +02:00
|
|
|
// [tablet landscape +]: Header-embedded search
|
|
|
|
@include break-from-device(tablet landscape) {
|
2016-09-30 13:29:45 +02:00
|
|
|
width: 100%;
|
2019-02-12 19:13:08 +01:00
|
|
|
height: px2rem(36px);
|
|
|
|
padding-left: px2rem(44px);
|
2020-03-06 15:21:08 +01:00
|
|
|
color: inherit;
|
|
|
|
font-size: ms(0);
|
|
|
|
background-color: var(--md-default-fg-color--lighter);
|
|
|
|
border-radius: px2rem(2px);
|
2016-10-23 10:21:37 +02:00
|
|
|
transition:
|
2020-03-04 15:17:02 +01:00
|
|
|
background-color 250ms,
|
|
|
|
color 250ms;
|
2016-09-02 00:33:45 +02: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-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(44px);
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
|
|
|
|
2017-11-19 16:02:33 +01:00
|
|
|
// Icon color
|
|
|
|
+ .md-search__icon {
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-primary-bg-color);
|
2017-11-19 16:02:33 +01:00
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Placeholder color
|
2016-09-02 00:33:45 +02:00
|
|
|
&::placeholder {
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-primary-bg-color--light);
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
|
|
|
|
2016-09-08 19:43:23 +02:00
|
|
|
// Hovered search field
|
|
|
|
&:hover {
|
2020-02-25 20:25:05 +01:00
|
|
|
background-color: var(--md-default-bg-color--lightest);
|
2016-09-08 19:43:23 +02:00
|
|
|
}
|
|
|
|
|
2016-10-23 19:31:54 +02:00
|
|
|
// Set light background on active search field
|
2017-03-21 15:27:45 +01:00
|
|
|
#{$md-toggle__search--checked} & {
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-default-fg-color);
|
2019-03-28 17:16:26 +01:00
|
|
|
text-overflow: clip;
|
2020-03-06 15:21:08 +01:00
|
|
|
background-color: var(--md-default-bg-color);
|
|
|
|
border-radius: px2rem(2px) px2rem(2px) 0 0;
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2020-02-26 08:47:53 +01:00
|
|
|
// Icon and placeholder color in active state
|
2016-09-02 00:33:45 +02:00
|
|
|
+ .md-search__icon,
|
|
|
|
&::placeholder {
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-default-fg-color--light);
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-23 19:31:54 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Icon
|
2016-10-23 19:31:54 +02:00
|
|
|
&__icon {
|
|
|
|
position: absolute;
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: 2;
|
2020-02-23 13:36:51 +01:00
|
|
|
width: px2rem(24px);
|
|
|
|
height: px2rem(24px);
|
2020-03-06 15:21:08 +01:00
|
|
|
cursor: pointer;
|
2017-04-01 15:54:50 +02:00
|
|
|
transition:
|
2020-03-04 15:17:02 +01:00
|
|
|
color 250ms,
|
2020-02-17 10:04:12 +01:00
|
|
|
opacity 250ms;
|
2016-10-23 19:31:54 +02:00
|
|
|
|
2017-03-21 15:27:45 +01:00
|
|
|
// Hovered icon
|
|
|
|
&:hover {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
2017-03-19 19:49:19 +01:00
|
|
|
// Search icon
|
2018-06-10 06:45:16 -06:00
|
|
|
&[for="__search"] {
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(6px);
|
|
|
|
left: px2rem(10px);
|
2017-03-19 19:49:19 +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-02-12 19:13:08 +01:00
|
|
|
right: px2rem(10px);
|
2018-01-13 16:54:08 +01:00
|
|
|
left: initial;
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Flip icon vertically
|
|
|
|
svg {
|
|
|
|
transform: scaleX(-1);
|
|
|
|
}
|
|
|
|
}
|
2017-03-19 19:49:19 +01:00
|
|
|
|
|
|
|
// [tablet portrait -]: Full-screen search bar
|
|
|
|
@include break-to-device(tablet portrait) {
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(12px);
|
|
|
|
left: px2rem(16px);
|
2017-03-19 19:49:19 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Adjust for right-to-left languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
right: px2rem(16px);
|
|
|
|
left: initial;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hide the magnifying glass (1st icon)
|
|
|
|
svg:first-child {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [tablet landscape +]: Header-embedded search
|
|
|
|
@include break-from-device(tablet landscape) {
|
2020-03-16 15:43:10 +01:00
|
|
|
pointer-events: none;
|
2018-01-13 16:54:08 +01:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Hide the arrow (2nd icon)
|
|
|
|
svg:last-child {
|
|
|
|
display: none;
|
|
|
|
}
|
2017-03-19 19:49:19 +01:00
|
|
|
}
|
2016-10-23 19:31:54 +02:00
|
|
|
}
|
|
|
|
|
2017-03-19 19:49:19 +01:00
|
|
|
// Reset button
|
|
|
|
&[type="reset"] {
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(6px);
|
|
|
|
right: px2rem(10px);
|
2020-02-26 09:58:25 +01:00
|
|
|
transform: scale(0.75);
|
2020-03-06 15:21:08 +01:00
|
|
|
opacity: 0;
|
2017-03-19 19:49:19 +01:00
|
|
|
transition:
|
2020-02-17 10:04:12 +01:00
|
|
|
transform 150ms cubic-bezier(0.1, 0.7, 0.1, 1),
|
|
|
|
opacity 150ms;
|
2020-02-26 10:03:15 +01:00
|
|
|
pointer-events: none;
|
2016-10-23 19:31:54 +02: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"] & {
|
|
|
|
right: initial;
|
2019-02-12 19:13:08 +01:00
|
|
|
left: px2rem(10px);
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
|
|
|
|
2017-03-19 19:49:19 +01:00
|
|
|
// [tablet portrait -]: Full-screen search bar
|
|
|
|
@include break-to-device(tablet portrait) {
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(12px);
|
|
|
|
right: px2rem(16px);
|
2020-02-24 18:07:50 +01:00
|
|
|
|
|
|
|
// Adjust for right-to-left languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
right: initial;
|
|
|
|
left: px2rem(16px);
|
|
|
|
}
|
2017-03-19 19:49:19 +01:00
|
|
|
}
|
|
|
|
|
2017-03-21 15:27:45 +01:00
|
|
|
// Show reset button if search is active and input non-empty
|
|
|
|
#{$md-toggle__search--checked} .md-search__input:valid ~ & {
|
|
|
|
transform: scale(1);
|
|
|
|
opacity: 1;
|
2020-02-26 10:03:15 +01:00
|
|
|
pointer-events: initial;
|
2017-03-19 19:49:19 +01:00
|
|
|
|
2017-03-21 15:27:45 +01:00
|
|
|
// Hovered icon
|
|
|
|
&:hover {
|
|
|
|
opacity: 0.7;
|
2017-03-19 19:49:19 +01:00
|
|
|
}
|
2016-10-23 19:31:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Search output container
|
|
|
|
&__output {
|
2016-10-30 10:36:18 +01:00
|
|
|
position: absolute;
|
2020-03-06 15:21:08 +01:00
|
|
|
z-index: 1;
|
2016-10-23 19:31:54 +02:00
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
2020-03-06 15:21:08 +01:00
|
|
|
border-radius: 0 0 px2rem(2px) px2rem(2px);
|
2016-10-23 19:31:54 +02:00
|
|
|
|
|
|
|
// [tablet portrait -]: Full-screen search bar
|
|
|
|
@include break-to-device(tablet portrait) {
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(48px);
|
2016-10-23 19:31:54 +02:00
|
|
|
bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [tablet landscape +]: Header-embedded search
|
|
|
|
@include break-from-device(tablet landscape) {
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(38px);
|
2016-10-23 19:31:54 +02:00
|
|
|
opacity: 0;
|
2020-03-06 15:21:08 +01:00
|
|
|
transition: opacity 400ms;
|
2016-10-23 19:31:54 +02:00
|
|
|
|
|
|
|
// Show search output in active state
|
2017-03-21 15:27:45 +01:00
|
|
|
#{$md-toggle__search--checked} & {
|
2017-01-15 15:00:38 +01:00
|
|
|
@include z-depth(6);
|
|
|
|
|
2016-10-23 19:31:54 +02:00
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wrapper for scrolling on overflow
|
|
|
|
&__scrollwrap {
|
|
|
|
height: 100%;
|
2020-03-06 15:21:08 +01:00
|
|
|
overflow-y: auto;
|
2020-02-25 20:25:05 +01:00
|
|
|
background-color: var(--md-default-bg-color);
|
2020-02-25 21:04:57 +01:00
|
|
|
box-shadow: inset 0 px2rem(1px) 0 var(--md-default-fg-color--lightest);
|
2020-03-01 00:11:30 +01:00
|
|
|
// Hack: reduce jitter
|
|
|
|
backface-visibility: hidden;
|
2020-02-15 11:49:19 +01:00
|
|
|
scroll-snap-type: y mandatory;
|
2016-12-28 17:13:07 +01:00
|
|
|
-webkit-overflow-scrolling: touch;
|
2016-10-23 19:31:54 +02:00
|
|
|
|
2019-12-19 18:25:13 +01:00
|
|
|
// Mitigiate excessive repaints on non-retina devices
|
|
|
|
@media (max-resolution: 1dppx) {
|
|
|
|
transform: translateZ(0);
|
|
|
|
}
|
|
|
|
|
2016-12-15 15:55:40 +01:00
|
|
|
// [tablet landscape]: Set absolute width to omit unnecessary reflow
|
|
|
|
@include break-at-device(tablet landscape) {
|
2019-02-12 19:13:08 +01:00
|
|
|
width: px2rem(468px);
|
2016-12-15 15:55:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// [screen +]: Set absolute width to omit unnecessary reflow
|
|
|
|
@include break-from-device(screen) {
|
2019-02-12 19:13:08 +01:00
|
|
|
width: px2rem(688px);
|
2016-12-15 15:55:40 +01:00
|
|
|
}
|
|
|
|
|
2016-10-23 19:31:54 +02:00
|
|
|
// [tablet landscape +]: Limit height to viewport
|
|
|
|
@include break-from-device(tablet landscape) {
|
|
|
|
max-height: 0;
|
|
|
|
|
|
|
|
// Expand in active state
|
2017-03-21 15:27:45 +01:00
|
|
|
#{$md-toggle__search--checked} & {
|
2016-10-23 19:31:54 +02:00
|
|
|
max-height: 75vh;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override native scrollbar styles
|
|
|
|
&::-webkit-scrollbar {
|
2019-02-12 19:13:08 +01:00
|
|
|
width: px2rem(4px);
|
|
|
|
height: px2rem(4px);
|
2016-11-05 23:26:07 +01:00
|
|
|
}
|
2016-10-23 19:31:54 +02:00
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Scrollbar thumb
|
2016-11-05 23:26:07 +01:00
|
|
|
&::-webkit-scrollbar-thumb {
|
2020-02-25 20:25:05 +01:00
|
|
|
background-color: var(--md-default-fg-color--lighter);
|
2016-10-23 19:31:54 +02:00
|
|
|
|
2016-11-05 23:26:07 +01:00
|
|
|
// Hovered scrollbar thumb
|
|
|
|
&:hover {
|
2020-02-25 20:25:05 +01:00
|
|
|
background-color: var(--md-accent-fg-color);
|
2016-10-23 19:31:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-09-04 17:11:58 +02:00
|
|
|
}
|
2016-12-16 09:21:31 +01:00
|
|
|
|
|
|
|
// Search result
|
|
|
|
.md-search-result {
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-default-fg-color);
|
2017-03-12 17:58:34 +01:00
|
|
|
word-break: break-word;
|
2016-12-16 09:21:31 +01:00
|
|
|
|
|
|
|
// Search metadata
|
|
|
|
&__meta {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: 0 px2rem(16px);
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-default-fg-color--light);
|
2016-12-16 09:21:31 +01:00
|
|
|
font-size: ms(-1);
|
2019-02-12 19:13:08 +01:00
|
|
|
line-height: px2rem(36px);
|
2020-03-06 15:21:08 +01:00
|
|
|
background-color: var(--md-default-fg-color--lightest);
|
2020-02-15 11:49:19 +01:00
|
|
|
scroll-snap-align: start;
|
2016-12-16 09:21:31 +01:00
|
|
|
|
|
|
|
// [tablet landscape +]: Increase left indent
|
|
|
|
@include break-from-device(tablet landscape) {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-left: px2rem(44px);
|
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-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(44px);
|
2018-01-13 16:54:08 +01:00
|
|
|
padding-left: initial;
|
|
|
|
}
|
2016-12-16 09:21:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// List of items
|
|
|
|
&__list {
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
list-style: none;
|
2020-03-06 15:21:08 +01:00
|
|
|
border-top: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
2016-12-16 09:21:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// List item
|
|
|
|
&__item {
|
2020-02-25 20:25:05 +01:00
|
|
|
box-shadow: 0 px2rem(-1px) 0 var(--md-default-fg-color--lightest);
|
2016-12-16 09:21:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Link inside item
|
|
|
|
&__link {
|
|
|
|
display: block;
|
2020-03-06 15:21:08 +01:00
|
|
|
outline: 0;
|
|
|
|
transition: background 250ms;
|
2020-02-15 11:49:19 +01:00
|
|
|
scroll-snap-align: start;
|
2016-12-16 09:21:31 +01:00
|
|
|
|
2020-02-02 16:19:01 +01:00
|
|
|
// Focused or hovered link
|
|
|
|
&:focus,
|
2016-12-16 09:21:31 +01:00
|
|
|
&:hover {
|
2020-02-26 08:47:53 +01:00
|
|
|
background-color: var(--md-accent-fg-color--transparent);
|
2017-03-21 15:27:45 +01:00
|
|
|
|
|
|
|
// Slightly transparent icon
|
|
|
|
.md-search-result__article::before {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2016-12-16 09:21:31 +01:00
|
|
|
}
|
|
|
|
|
2017-04-08 16:04:09 +02:00
|
|
|
// Add a little spacing on the teaser of the last link
|
|
|
|
&:last-child .md-search-result__teaser {
|
2019-02-12 19:13:08 +01:00
|
|
|
margin-bottom: px2rem(12px);
|
2017-03-12 17:58:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Article - document or section
|
|
|
|
&__article {
|
|
|
|
position: relative;
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: 0 px2rem(16px);
|
2017-03-12 17:58:34 +01:00
|
|
|
overflow: auto;
|
|
|
|
|
2016-12-16 09:21:31 +01:00
|
|
|
// [tablet landscape +]: Increase left indent
|
|
|
|
@include break-from-device(tablet landscape) {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding-left: px2rem(44px);
|
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-02-12 19:13:08 +01:00
|
|
|
padding-right: px2rem(44px);
|
|
|
|
padding-left: px2rem(16px);
|
2018-01-13 16:54:08 +01:00
|
|
|
}
|
2016-12-16 09:21:31 +01:00
|
|
|
}
|
|
|
|
|
2017-03-12 17:58:34 +01:00
|
|
|
// Document
|
|
|
|
&--document {
|
|
|
|
|
|
|
|
// Title
|
|
|
|
.md-search-result__title {
|
2019-02-12 19:13:08 +01:00
|
|
|
margin: px2rem(11px) 0;
|
2017-03-12 17:58:34 +01:00
|
|
|
font-weight: 400;
|
2020-03-06 15:21:08 +01:00
|
|
|
font-size: ms(0);
|
2017-03-12 17:58:34 +01:00
|
|
|
line-height: 1.4;
|
|
|
|
}
|
|
|
|
}
|
2016-12-16 09:21:31 +01:00
|
|
|
}
|
|
|
|
|
2020-02-24 18:07:50 +01:00
|
|
|
// Icon
|
|
|
|
&__icon {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
margin: px2rem(2px);
|
2020-02-27 10:32:42 +01:00
|
|
|
padding: px2rem(8px);
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-default-fg-color--light);
|
2020-02-24 18:07:50 +01:00
|
|
|
|
|
|
|
// Adjust for right-to-left languages
|
|
|
|
[dir="rtl"] & {
|
|
|
|
right: 0;
|
|
|
|
left: initial;
|
2020-02-25 20:25:05 +01:00
|
|
|
|
|
|
|
// Flip icon vertically
|
|
|
|
svg {
|
|
|
|
transform: scaleX(-1);
|
|
|
|
}
|
2020-02-24 18:07:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// [tablet portrait -]: Hide page icon
|
|
|
|
@include break-to-device(tablet portrait) {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-12 17:58:34 +01:00
|
|
|
// Title
|
2016-12-16 09:21:31 +01:00
|
|
|
&__title {
|
2017-03-12 17:58:34 +01:00
|
|
|
margin: 0.5em 0;
|
|
|
|
font-weight: 700;
|
2020-03-06 15:21:08 +01:00
|
|
|
font-size: ms(-1);
|
2016-12-16 09:21:31 +01:00
|
|
|
line-height: 1.4;
|
|
|
|
}
|
|
|
|
|
2017-03-14 18:30:33 +01:00
|
|
|
// stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix
|
|
|
|
|
2017-03-12 17:58:34 +01:00
|
|
|
// Teaser
|
2016-12-16 09:21:31 +01:00
|
|
|
&__teaser {
|
2017-03-14 18:30:33 +01:00
|
|
|
display: -webkit-box;
|
2019-02-12 19:13:08 +01:00
|
|
|
max-height: px2rem(33px);
|
2017-01-01 15:59:44 +01:00
|
|
|
margin: 0.5em 0;
|
2020-03-06 15:21:08 +01:00
|
|
|
overflow: hidden;
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-default-fg-color--light);
|
2016-12-16 09:21:31 +01:00
|
|
|
font-size: ms(-1);
|
|
|
|
line-height: 1.4;
|
2017-03-14 18:30:33 +01:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
|
|
|
// [mobile -]: Increase number of lines
|
|
|
|
@include break-to-device(mobile) {
|
2019-02-12 19:13:08 +01:00
|
|
|
max-height: px2rem(50px);
|
2017-03-14 18:30:33 +01:00
|
|
|
-webkit-line-clamp: 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [tablet landscape]: Increase number of lines
|
|
|
|
@include break-at-device(tablet landscape) {
|
2019-02-12 19:13:08 +01:00
|
|
|
max-height: px2rem(50px);
|
2017-03-14 18:30:33 +01:00
|
|
|
-webkit-line-clamp: 3;
|
|
|
|
}
|
2017-03-12 17:58:34 +01:00
|
|
|
}
|
|
|
|
|
2017-03-14 18:30:33 +01:00
|
|
|
// stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix
|
|
|
|
|
2017-03-21 15:27:45 +01:00
|
|
|
// Search term highlighting
|
2017-03-12 17:58:34 +01:00
|
|
|
em {
|
|
|
|
font-weight: 700;
|
2020-03-06 15:21:08 +01:00
|
|
|
font-style: normal;
|
2017-03-12 17:58:34 +01:00
|
|
|
text-decoration: underline;
|
2016-12-16 09:21:31 +01:00
|
|
|
}
|
|
|
|
}
|