2016-09-04 17:11:58 +02: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 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 {
|
2016-09-23 11:56:25 +02:00
|
|
|
padding: 0.8rem 0.8rem 0;
|
|
|
|
|
2016-09-30 13:29:45 +02:00
|
|
|
// Hide search, in case JavaScript is not available.
|
|
|
|
.no-js & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2016-09-23 11:56:25 +02:00
|
|
|
// [tablet +]: Header-embedded search
|
|
|
|
@include break-from-device(tablet) {
|
|
|
|
padding: 0.4rem;
|
|
|
|
padding-right: 3.2rem;
|
|
|
|
}
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-30 13:29:45 +02:00
|
|
|
// // Search overlay
|
|
|
|
// &__overlay {
|
|
|
|
// display: none;
|
|
|
|
//
|
|
|
|
// // [mobile -]: Only show overlay on mobile
|
|
|
|
// @include break-to-device(mobile) {
|
|
|
|
// display: block;
|
|
|
|
// position: absolute;
|
|
|
|
// top: 0.4rem;
|
|
|
|
// left: 0.4rem;
|
|
|
|
// width: 4.0rem;
|
|
|
|
// height: 4.0rem;
|
|
|
|
// transform-origin: center;
|
|
|
|
// transition: transform 0.3s 0.1s,
|
|
|
|
// opacity 0.2s 0.2s;
|
|
|
|
// border-radius: 2.0rem; // TODO: correct?
|
|
|
|
// background: #EEEEEE;
|
|
|
|
// opacity: 0;
|
|
|
|
// overflow: hidden;
|
|
|
|
// z-index: 0;
|
|
|
|
//
|
|
|
|
// // Expanded overlay
|
|
|
|
// .md-toggle--search:checked ~ .md-header & {
|
|
|
|
// transform: scale(40);
|
|
|
|
// transition: transform 0.4s,
|
|
|
|
// opacity 0.1s;
|
|
|
|
// opacity: 1;
|
|
|
|
// z-index: 1;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Search form
|
2016-09-02 00:33:45 +02:00
|
|
|
&__form {
|
|
|
|
position: relative;
|
2016-10-21 21:15:35 +02:00
|
|
|
border-radius: 0.2rem;
|
2016-09-04 17:11:58 +02:00
|
|
|
text-align: right;
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// [mobile -]: Add drop-shadow on mobile
|
2016-09-02 00:33:45 +02:00
|
|
|
@include break-to-device(mobile) {
|
|
|
|
@include z-depth(2);
|
|
|
|
}
|
2016-09-30 13:29:45 +02:00
|
|
|
|
|
|
|
// [tablet +]: Header-embedded search
|
|
|
|
@include break-from-device(tablet) {
|
|
|
|
width: 23.0rem;
|
|
|
|
transition: width 0.25s cubic-bezier(0.1, 0.7, 0.1, 1.0);
|
|
|
|
|
|
|
|
// Active search field
|
2016-10-21 21:15:35 +02:00
|
|
|
[data-md-locked] & {
|
2016-09-30 13:29:45 +02:00
|
|
|
width: 66.8rem;
|
|
|
|
}
|
|
|
|
}
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Icon
|
2016-09-02 00:33:45 +02:00
|
|
|
&__icon {
|
|
|
|
position: absolute;
|
2016-09-23 11:56:25 +02:00
|
|
|
top: $md-icon-padding;
|
|
|
|
left: $md-icon-padding + $md-icon-margin;
|
2016-09-04 17:11:58 +02:00
|
|
|
transition: color 0.25s;
|
2016-09-23 11:56:25 +02:00
|
|
|
font-size: $md-icon-size;
|
2016-09-02 00:33:45 +02:00
|
|
|
cursor: pointer;
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// [mobile -]: Use back arrow as search icon
|
2016-09-02 00:33:45 +02:00
|
|
|
@include break-to-device(mobile) {
|
|
|
|
top: 1.2rem;
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Hack: @extend doesn't work in media queries, so override manually
|
2016-09-04 17:11:58 +02:00
|
|
|
&::before {
|
2016-09-02 00:33:45 +02:00
|
|
|
content: "arrow_back";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Search field
|
2016-09-02 00:33:45 +02:00
|
|
|
&__input {
|
2016-09-23 11:56:25 +02:00
|
|
|
padding: 0 1.6rem 0 6.4rem;
|
2016-10-21 21:15:35 +02:00
|
|
|
border-radius: 0.2rem;
|
2016-09-13 20:58:28 +02:00
|
|
|
text-overflow: ellipsis;
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Placeholder and icon color in active state
|
2016-09-02 00:33:45 +02:00
|
|
|
+ .md-search__icon,
|
|
|
|
&::placeholder {
|
|
|
|
color: $md-color-black--light;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// [mobile -]: Full-screen search bar
|
2016-09-02 00:33:45 +02:00
|
|
|
@include break-to-device(mobile) {
|
|
|
|
width: 100%;
|
|
|
|
height: 4.8rem;
|
|
|
|
font-size: 1.8rem;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// [tablet +]: Header-embedded search
|
2016-09-02 00:33:45 +02:00
|
|
|
@include break-from-device(tablet) {
|
2016-09-30 13:29:45 +02:00
|
|
|
width: 100%;
|
2016-09-02 00:33:45 +02:00
|
|
|
height: 4.0rem;
|
|
|
|
padding-left: 4.8rem;
|
2016-09-30 13:29:45 +02:00
|
|
|
transition: background-color 0.25s,
|
2016-09-04 17:11:58 +02:00
|
|
|
color 0.25s;
|
2016-09-13 20:58:28 +02:00
|
|
|
background: $md-color-black--lighter;
|
2016-09-02 00:33:45 +02:00
|
|
|
color: $md-color-white;
|
2016-09-04 17:11:58 +02:00
|
|
|
font-size: ms(0);
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Placeholder color
|
2016-09-02 00:33:45 +02:00
|
|
|
+ .md-search__icon,
|
|
|
|
&::placeholder {
|
2016-09-04 17:11:58 +02:00
|
|
|
transition: color 0.25s;
|
2016-09-02 00:33:45 +02:00
|
|
|
color: $md-color-white;
|
|
|
|
}
|
|
|
|
|
2016-09-08 19:43:23 +02:00
|
|
|
// Hovered search field
|
|
|
|
&:hover {
|
2016-09-13 20:58:28 +02:00
|
|
|
background: $md-color-white--lightest;
|
2016-09-08 19:43:23 +02:00
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Active search field
|
2016-10-21 21:15:35 +02:00
|
|
|
[data-md-locked] & {
|
|
|
|
border-radius: 0.3rem 0.3rem 0 0;
|
2016-09-02 00:33:45 +02:00
|
|
|
background: $md-color-white;
|
|
|
|
color: $md-color-black;
|
2016-09-13 20:58:28 +02:00
|
|
|
text-overflow: none;
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Placeholder and icon color in active state
|
2016-09-02 00:33:45 +02:00
|
|
|
+ .md-search__icon,
|
|
|
|
&::placeholder {
|
|
|
|
color: $md-color-black--light;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-09-04 17:11:58 +02:00
|
|
|
}
|