From eac3f9b434ca77e3dc64eea9cedea7b93e7b306b Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 8 Oct 2022 20:00:22 +0800 Subject: [PATCH] perf(typography): optimize the line height of post content --- _sass/addon/commons.scss | 16 ++++++---------- _sass/layout/post.scss | 13 ++++++++----- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/_sass/addon/commons.scss b/_sass/addon/commons.scss index 73a0987..c3a4961 100644 --- a/_sass/addon/commons.scss +++ b/_sass/addon/commons.scss @@ -29,11 +29,11 @@ html { } body { - line-height: 1.75rem; background: var(--body-bg); color: var(--text-color); -webkit-font-smoothing: antialiased; font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif; + line-height: 1.75; } /* --- Typography --- */ @@ -440,7 +440,6 @@ img[data-src] { .post-content { font-size: 1.08rem; - line-height: 1.8; margin-top: 2rem; overflow-wrap: break-word; @@ -461,20 +460,17 @@ img[data-src] { > ol, > ul { - $start-padding: 1.25rem; - - padding-inline-start: $start-padding; - margin: 1.25rem 0; + padding-inline-start: 1.75rem; li { - margin: 0.5rem 0; + margin: 0.25rem 0; padding-left: 0.4rem; } ol, ul { - padding-inline-start: $start-padding; - margin: 0.75rem 0; + padding-inline-start: 1.25rem; + margin: 0.5rem 0; } } @@ -484,7 +480,7 @@ img[data-src] { list-style-type: none; > i { /* checkbox icon */ - margin: 0 0.4rem 0.2rem -1.4rem; + margin: 0 0.5rem 0.2rem -1.4rem; vertical-align: middle; color: var(--checkbox-color); diff --git a/_sass/layout/post.scss b/_sass/layout/post.scss index 79a15c4..ad66e27 100644 --- a/_sass/layout/post.scss +++ b/_sass/layout/post.scss @@ -146,13 +146,16 @@ img.preview-img { animation: fade-up 0.8s; } -#toc li a { - font-size: 0.8rem; +#toc { + ul.nav.navbar-nav { + margin: 0.5rem 0; + padding: 0; - &.nav-link:not(.active) { - color: inherit; + li { + padding-top: 2px; + padding-bottom: 2px; + } } - } nav[data-toggle=toc] {