Skip to content

Commit

Permalink
perf(typography): optimize the line height of post content
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Oct 9, 2022
1 parent 304d75c commit eac3f9b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
16 changes: 6 additions & 10 deletions _sass/addon/commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 --- */
Expand Down Expand Up @@ -440,7 +440,6 @@ img[data-src] {

.post-content {
font-size: 1.08rem;
line-height: 1.8;
margin-top: 2rem;
overflow-wrap: break-word;

Expand All @@ -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;
}
}

Expand All @@ -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);

Expand Down
15 changes: 9 additions & 6 deletions _sass/layout/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,16 @@ img.preview-img {
animation: fade-up 0.8s;
}

#toc li a {
font-size: 0.8rem;

&.nav-link:not(.active) {
color: inherit;
#toc {
ul.nav.navbar-nav {
margin: 0.5rem 0;
padding: 0;

li {
padding-top: 2px;
padding-bottom: 2px;
}
}

}

nav[data-toggle=toc] {
Expand Down

0 comments on commit eac3f9b

Please sign in to comment.