From fd5c8d17d3b3cd0a13b0a21a2b78d85010e02e12 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 20 Jun 2023 03:37:45 +0000
Subject: [PATCH] basic search implementation
---
quartz/styles/base.scss | 139 ++++++++++++++++++++++++++++++++--------------
1 files changed, 96 insertions(+), 43 deletions(-)
diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss
index bf89e5b..fe62601 100644
--- a/quartz/styles/base.scss
+++ b/quartz/styles/base.scss
@@ -1,4 +1,5 @@
@import "./syntax.scss";
+@import "./callouts.scss";
html {
scroll-behavior: smooth;
@@ -9,8 +10,6 @@
body {
margin: 0;
- height: 100vh;
- width: 100vw;
max-width: 100%;
box-sizing: border-box;
background-color: var(--light);
@@ -23,7 +22,7 @@
border-radius: 5px;
}
-p, ul, text, a, tr, td, li, ol, ul {
+p, ul, text, a, tr, td, li, ol, ul, .katex {
color: var(--darkgray);
fill: var(--darkgray);
}
@@ -47,11 +46,42 @@
}
.page {
- padding: 4rem 30vw;
- margin: 0 auto;
+ margin: 6rem 35vw 6rem 20vw;
max-width: 1000px;
+ position: relative;
+
+ & .left, & .right {
+ position: fixed;
+ height: 100vh;
+ overflow-y: scroll;
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ top: 0;
+ gap: 2rem;
+ padding: 6rem;
+ }
+
+ & .left {
+ left: 0;
+ padding-left: 10vw;
+ width: 20vw;
+ }
+
+ & .right {
+ right: 0;
+ padding-right: 10vw;
+ width: 35vw;
+ }
+
@media all and (max-width: 1200px) {
- padding: 25px 5vw;
+ margin: 25px 5vw;
+ & .left, & .right {
+ padding: 0;
+ height: initial;
+ max-width: none;
+ position: initial;
+ }
}
& p {
@@ -66,8 +96,7 @@
}
blockquote {
- font-style: italic;
- margin-left: 0;
+ margin: 1rem 0;
border-left: 3px solid var(--secondary);
padding-left: 1rem;
transition: border-color 0.2s ease;
@@ -85,12 +114,26 @@
font-weight: revert;
margin: 2rem 0 0;
- &:hover > .hanchor {
- color: var(--secondary);
- }
-
article > & > a {
- color: var(--dark)
+ color: var(--dark);
+ &.internal {
+ background-color: transparent;
+ }
+ }
+}
+
+h1, h2, h3, h4, h5, h6 {
+ &[id] > a {
+ margin: 0 0.5rem;
+ opacity: 0;
+ transition: opacity 0.2s ease;
+ transform: translateY(-0.1rem);
+ display: inline-block;
+ font-family: var(--codeFont);
+ user-select: none;
+ }
+ &[id]:hover > a {
+ opacity: 1;
}
}
@@ -108,41 +151,41 @@
margin-bottom: -0.8rem;
color: var(--darkgray);
}
+}
- & pre {
- font-family: var(--codeFont);
- padding: 0.5rem 0;
- border-radius: 5px;
- overflow-x: scroll;
- border: 1px solid var(--lightgray);
+pre {
+ font-family: var(--codeFont);
+ padding: 0.5rem;
+ border-radius: 5px;
+ overflow-x: scroll;
+ border: 1px solid var(--lightgray);
- & > code {
- background: none;
- padding: 0;
- font-size: 0.9rem;
- counter-reset: line;
- counter-increment: line 0;
- display: grid;
+ & > code {
+ background: none;
+ padding: 0;
+ font-size: 0.85rem;
+ counter-reset: line;
+ counter-increment: line 0;
+ display: grid;
- & .line {
- padding: 0 0.75rem;
- box-sizing: border-box;
- border-left: 3px solid transparent;
+ & .line {
+ padding: 0 0.25rem;
+ box-sizing: border-box;
+ border-left: 3px solid transparent;
- &.highlighted {
- background-color: var(--highlight);
- border-left: 3px solid var(--secondary);
- }
+ &.highlighted {
+ background-color: var(--highlight);
+ border-left: 3px solid var(--secondary);
+ }
- &::before {
- content: counter(line);
- counter-increment: line;
- width: 1rem;
- margin-right: 1rem;
- display: inline-block;
- text-align: right;
- color: rgba(115, 138, 148, 0.4);
- }
+ &::before {
+ content: counter(line);
+ counter-increment: line;
+ width: 1rem;
+ margin-right: 1rem;
+ display: inline-block;
+ text-align: right;
+ color: rgba(115, 138, 148, 0.4);
}
}
}
@@ -150,6 +193,7 @@
code {
font-size: 0.9em;
+ color: var(--dark);
font-family: var(--codeFont);
border-radius: 5px;
padding: 0.1rem 0.2rem;
@@ -205,3 +249,12 @@
padding: 0 1em
}
}
+
+audio, video {
+ width: 100%;
+ border-radius: 5px;
+}
+
+.spacer {
+ flex: 1 1 auto;
+}
--
Gitblit v1.10.0