hugo-theme-zzo/assets/sass/components/_search.scss

276 lines
6.3 KiB
SCSS
Raw Normal View History

2019-11-04 13:09:44 +00:00
.search {
position: relative;
border-radius: 0.25rem;
height: 35px;
2019-11-04 13:09:44 +00:00
z-index: z('search');
2019-11-20 06:55:05 +00:00
margin-bottom: 0.5rem;
2019-11-04 13:09:44 +00:00
@include box-shadow(0, 0, 0, 3px, transparent);
@include transition(all, 0.15s, ease-in);
2019-11-04 13:09:44 +00:00
@include flexbox();
@include align-items(center);
@include themify($themes) {
2019-11-20 06:55:05 +00:00
border: 2px solid themed('search-border-color');
2019-11-04 13:09:44 +00:00
background-color: themed("search-background-color");
&:focus-within {
border: 2px solid themed('search-border-active-color');
@include box-shadow(0, 0, 0, 3px, themed('search-border-outline-color'));
}
2019-11-04 13:09:44 +00:00
}
.icon {
padding: 0.25rem;
@include flexbox();
@include themify($themes) {
color: themed("search-icon-color");
}
}
.input {
width: 100%;
font-size: 0.9rem;
border: none;
outline: none;
padding-right: 1rem;
@include truncate($grid_main_side_width + $grid_main_side_unit);
2019-11-04 13:09:44 +00:00
@include themify($themes) {
color: themed("search-color");
background-color: inherit;
2019-11-04 13:09:44 +00:00
@include input-placeholder {
font-family: $title-font;
2019-11-04 13:09:44 +00:00
color: themed("search-placeholder-color");
}
}
}
&-content {
margin-top: 0.25rem;
2019-11-25 13:53:34 +00:00
max-height: 350px;
overflow: auto;
2019-11-04 13:09:44 +00:00
a {
text-decoration: none !important;
&:not(:last-child) {
@include themify($themes) {
font-family: $title-font;
border-bottom: 2px dashed themed("search-placeholder-color");
}
}
2019-11-04 13:09:44 +00:00
}
}
&__highlight {
@include themify($themes) {
color: themed('search-highlight-color');
}
}
2019-11-04 13:09:44 +00:00
}
.menu-item {
padding: 0.25rem;
&__title {
font-size: 1rem;
@include themify($themes) {
2019-11-20 06:55:05 +00:00
color: themed('body-color');
2019-11-04 13:09:44 +00:00
}
}
&__desc {
font-size: 0.8rem;
padding: 0.25rem 0.5rem;
@include truncate($grid_main_side_width + $grid_main_side_unit);
2019-11-04 13:09:44 +00:00
@include themify($themes) {
color: themed('search-color');
}
}
}
#search-results {
@include themify($themes) {
// @include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
}
2019-11-04 13:09:44 +00:00
&.dropdown {
display: none;
&.is-active {
display: inline-block;
margin-top: 0.25rem;
position: absolute;
top: 35px;
2019-11-04 13:09:44 +00:00
width: 100%;
border-radius: 0.1rem;
@include box-shadow(0, 1px, 3px, 0, rgba(0, 0, 0, 0.4));
@include themify($themes) {
color: themed('search-content-color');
background-color: themed('search-content-background-color');
}
}
}
2019-11-04 13:09:44 +00:00
.dropdown {
&-content {
@include themify($themes) {
@include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
@include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
}
2019-11-04 13:09:44 +00:00
@include flexbox();
@include flex-direction(column);
}
&-item {
font-size: 1rem;
padding: 0.125rem;
@include on-event {
@include themify($themes) {
background-color: themed('search-hover-background-color');
}
border-bottom-left-radius: 0.1rem;
border-bottom-right-radius: 0.1rem;
}
&.is-active {
@include themify($themes) {
background-color: themed('search-hover-background-color');
}
}
}
}
}
.mobile-search {
position: absolute;
2019-11-20 06:55:05 +00:00
z-index: z('modal');
width: 100%;
overflow: hidden;
@include themify($themes) {
@include webkit-scrollbars2(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
}
2019-11-20 06:55:05 +00:00
&__top {
width: 100%;
height: $grid_navbar_height;
text-align: right;
position: relative;
2019-11-20 06:55:05 +00:00
@include flexbox();
@include align-items(center);
@include themify($themes) {
border-bottom: 1px solid themed('navbar-border-bottom-color');
background-color: themed('navbar-background-color');
}
&--icon {
width: 50px;
height: $grid_navbar_height;
cursor: pointer;
position: absolute;
right: 0;
2019-11-20 06:55:05 +00:00
@include flexbox();
@include align-items(center);
@include justify-content(center);
@include themify($themes) {
color: themed('burger-menu-color');
@include on-event {
color: themed('link-hover');
}
}
}
&--input {
width: calc(100% - 70px);
height: 70%;
outline: none;
border: none;
border-radius: 0.25rem;
padding: 0 1rem;
font-size: 1.1rem;
@include themify($themes) {
color: themed('body-color');
background-color: themed('navbar-background-color');
@include input-placeholder {
font-family: $title-font;
2019-11-20 06:55:05 +00:00
color: themed("search-placeholder-color");
}
}
}
}
&__body {
width: 100%;
height: 100vh;
overflow-y: auto;
2019-11-20 06:55:05 +00:00
@include themify($themes) {
color: themed('body-color');
background-color: themed('body-background-color');
@include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
2019-11-20 06:55:05 +00:00
}
}
&__btn {
position: absolute;
top: 0;
right: 35px;
width: 35px;
height: $grid_navbar_height;
padding: 0.25rem;
2019-11-20 06:55:05 +00:00
cursor: pointer;
display: none;
z-index: z('search-btn');
2019-11-20 06:55:05 +00:00
@include animation('slide-in-down .5s .25s 1 ease both');
2019-11-20 06:55:05 +00:00
@include themify($themes) {
color: themed('burger-menu-color');
@include on-event {
color: themed('link-hover');
}
}
2019-12-08 14:29:02 +00:00
@media only screen and (max-width: 769px) {
@include flexbox();
@include align-items(center);
@include justify-content(center);
}
2019-11-20 06:55:05 +00:00
}
&__content {
a {
text-decoration: none !important;
}
}
2019-11-20 06:55:05 +00:00
&__item {
padding: 0.5rem;
&--title {
font-size: 1.2rem;
@include themify($themes) {
color: themed('body-color');
}
}
&--desc {
font-size: 0.9rem;
padding: 0.25rem 0.5rem;
@include truncate(960px);
2019-11-20 06:55:05 +00:00
@include themify($themes) {
color: themed('search-color');
}
}
@include on-event {
@include themify($themes) {
background-color: themed('search-hover-background-color');
}
}
}
}