feat(search): add local search (#231)

* feat(search): add local search

* docs: add docs for search
This commit is contained in:
Dillon
2020-04-15 15:46:50 +08:00
committed by GitHub
parent b6ce753ae7
commit 90184ca3e7
92 changed files with 4843 additions and 1214 deletions

View File

@@ -1,6 +1,6 @@
#content-404 {
font-size: 1.8rem;
line-height: 3rem;
transform: translateY(30vh);
@include transform(translateY(30vh));
text-align: center;
}

View File

@@ -1,13 +1,8 @@
/** Home **/
@mixin page-home($profile, $posts) {
.home {
@if $profile {
.home-profile {
-webkit-transform: translateY(if($posts, 0, 16vh));
-moz-transform: translateY(if($posts, 0, 16vh));
-ms-transform: translateY(if($posts, 0, 16vh));
-o-transform: translateY(if($posts, 0, 16vh));
transform: translateY(if($posts, 0, 16vh));
@include transform(translateY(if($posts, 0, 16vh)));
padding: if($posts, 2rem, 0) 0 .5rem;
text-align: center;
@@ -15,27 +10,18 @@
padding: 0.6rem;
img {
display: inline-block;
width: if($posts, 6rem, 8rem);
height: auto;
display: inline-block;
-webkit-border-radius: 100%;
border-radius: 100%;
-webkit-box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05);
box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05);
margin: 0 auto;
-webkit-transition: all ease 0.4s;
-moz-transition: all ease 0.4s;
-o-transition: all ease 0.4s;
transition: all ease 0.4s;
@include border-radius(100%);
@include box-shadow(0 0 0 .3618em rgba(0, 0, 0, .05));
@include transition(all 0.4s ease);
cursor: pointer;
&:hover {
position: relative;
-webkit-transform: translateY(-0.75rem);
-moz-transform: translateY(-0.75rem);
-ms-transform: translateY(-0.75rem);
-o-transform: translateY(-0.75rem);
transform: translateY(-0.75rem);
@include transform(translateY(-.75rem));
cursor: pointer;
}
}
@@ -70,7 +56,7 @@
padding: .4rem;
color: $global-font-secondary-color;
.dark-theme & {
.dark & {
color: $global-font-secondary-color-dark;
}
}

View File

@@ -4,6 +4,8 @@
max-width: 60%;
margin: 0 auto;
padding-top: $page-padding-top-desktop;
@include blur;
}
@import "_single";

View File

@@ -1,4 +1,5 @@
/** Single **/
@import "../_partial/_single/toc";
.single {
.single-title {
margin: 1rem 0 .5rem;
@@ -22,7 +23,7 @@
display: inline-block;
}
.dark-theme & {
.dark & {
color: $global-font-secondary-color-dark;
}
@@ -45,8 +46,6 @@
}
}
@import "../_partial/_single/toc";
.content {
> h2 {
font-size: 1.5rem;
@@ -88,7 +87,7 @@
font-weight: bold;
margin: 1.2rem 0;
.dark-theme & {
.dark & {
font-weight: bolder;
}
}
@@ -103,7 +102,7 @@
margin-right: .3125rem;
color: $single-link-color;
.dark-theme & {
.dark & {
color: $single-link-color-dark;
}
}
@@ -120,7 +119,7 @@
b, strong {
font-weight: bold;
.dark-theme & {
.dark & {
color: #ddd;
}
}
@@ -131,12 +130,12 @@
word-break: break-all;
word-break: break-word;
.dark-theme & b, .dark-theme & strong {
.dark & b, .dark & strong {
color: $single-link-color-dark;
}
}
.dark-theme a:hover b, .dark-theme a:hover strong {
.dark a:hover b, .dark a:hover strong {
color: $single-link-hover-color-dark;
}
@@ -153,7 +152,7 @@
color: $global-font-secondary-color;
}
.dark-theme & {
.dark & {
background: $code-background-color-dark;
rt {
@@ -168,7 +167,7 @@
&::-webkit-scrollbar {
background-color: $table-background-color;
.dark-theme & {
.dark & {
background-color: $table-background-color-dark;
}
}
@@ -181,14 +180,14 @@
background: $table-background-color;
border-collapse: collapse;
.dark-theme & {
.dark & {
background: $table-background-color-dark;
}
thead {
background: $table-thead-color;
.dark-theme & {
.dark & {
background-color: $table-thead-color-dark;
}
}
@@ -197,7 +196,7 @@
padding: .3rem 1rem;
border: 1px double $global-border-color;
.dark-theme & {
.dark & {
border: 1px double $global-border-color-dark;
}
}
@@ -249,14 +248,14 @@
position: absolute;
top: 0em;
left: 50%;
transform: translate(-50%, -50%);
@include transform(translate(-50%, -50%));
width: 3rem;
height: 2rem;
font: 6em/1.08em 'PT Sans', sans-serif;
color: $single-link-color;
text-align: center;
.dark-theme & {
.dark & {
color: $single-link-color-dark;
}
}
@@ -268,12 +267,12 @@
font-size: 0.875em;
color: $single-link-color;
.dark-theme & {
.dark & {
color: $single-link-color-dark;
}
}
.dark-theme & {
.dark & {
border-color: $global-border-color-dark;
}
}
@@ -281,7 +280,7 @@
.footnotes {
color: $global-font-secondary-color;
.dark-theme & {
.dark & {
color: $global-font-secondary-color-dark;
}
@@ -304,7 +303,7 @@
border-top: 1px dashed $global-border-color;
border-bottom: none;
.dark-theme & {
.dark & {
border-top: 1px dashed $global-border-color-dark;
}
}
@@ -315,19 +314,17 @@
background-color: $global-background-color;
border: 1px solid $global-border-color;
border-bottom-color: $global-border-color;
border-radius: 3px;
-webkit-box-shadow: inset 0 -1px 0 $global-border-color;
box-shadow: inset 0 -1px 0 $global-border-color;
@include border-radius(3px);
@include box-shadow(inset 0 -1px 0 $global-border-color);
font-size: .8rem;
font-family: $code-font-family;
color: $code-color;
.dark-theme & {
.dark & {
background-color: $global-background-color-dark;
border: 1px solid $global-border-color-dark;
border-bottom-color: $global-border-color-dark;
-webkit-box-shadow: inset 0 -1px 0 $global-border-color-dark;
box-shadow: inset 0 -1px 0 $global-border-color-dark;
@include box-shadow(inset 0 -1px 0 $global-border-color-dark);
color: $code-color-dark;
}
}