commit c884cb53aa78840f354e014c51f762a287087794
parent 2e3d15c9e0bdb464d1b4d445e8afcac383cb2859
Author: gracefu <81774659+gracefuu@users.noreply.github.com>
Date: Sat, 12 Apr 2025 04:38:52 +0800
Tweak first/last child spacing
Diffstat:
5 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/layouts/index.shtml b/layouts/index.shtml
@@ -1,11 +1,16 @@
<extend template="base.shtml">
<head id="head">
+ <style>
+#post-header {
+ margin-block-end: 1.2em;
+}
+ </style>
</head>
<div id="content">
<main>
<article class="hierarchical">
- <header class="non-hierarchical">
- <h1 class="limit-self" :text="$page.title"></h1>
+ <header id="post-header" class="non-hierarchical limit-children">
+ <h1 :text="$page.title"></h1>
</header>
<div class="limit-children" :html="$page.content()"></div>
</article>
diff --git a/layouts/page.shtml b/layouts/page.shtml
@@ -9,7 +9,7 @@
}
#post-header {
- margin-block-end: 1.5em;
+ margin-block-end: 1.2em;
}
#post-header>p>time,
#post-header>p>span {
diff --git a/layouts/post.shtml b/layouts/post.shtml
@@ -10,7 +10,7 @@
}
#post-header {
- margin-block-end: 1.5em;
+ margin-block-end: 1.2em;
}
#post-header>p>time,
#post-header>p>span {
diff --git a/layouts/posts.shtml b/layouts/posts.shtml
@@ -6,7 +6,7 @@
}
.post {
- margin-block: 1.5em;
+ margin-block: 1.6em;
}
</style>
</head>
diff --git a/layouts/templates/base.shtml b/layouts/templates/base.shtml
@@ -115,7 +115,7 @@ h1, h2, h3, h4, h5, h6,
}
:is(
-h1, h2, h3, h4, h5, h6,
+* + :is(h1, h2, h3, h4, h5, h6)
):not(li > *
):is(.hierarchical *:not(.non-hierarchical *), .hierarchical-self) {
margin-block-start: 1.2lh;
@@ -127,8 +127,26 @@ ul, ol, menu, pre, dl,
hr
):not(li > *
):is(.hierarchical *:not(.non-hierarchical *), .hierarchical-self) {
+ margin-block-start: 0.4lh;
+ margin-block-end: 0.4lh;
+}
+
+:is(
+* + :is(blockquote, aside, details,
+ul, ol, menu, pre, dl,
+hr)
+):not(li > *
+):is(.hierarchical *:not(.non-hierarchical *), .hierarchical-self) {
+ margin-block-start: 0.6lh;
+}
+:is(
+blockquote, aside, details,
+ul, ol, menu, pre, dl,
+hr
+):not(:last-child
+):not(li > *
+):is(.hierarchical *:not(.non-hierarchical *), .hierarchical-self) {
margin-block-start: 0.6lh;
- margin-block-end: 0.6lh;
}
</style>