From ca051ddec727780a69cf69afdd33eb9456c49d6b Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sat, 9 Apr 2022 14:51:31 +0200 Subject: sass: Always set margin-top for first

in

Common elements in
usually have their own margin settings. In a previous CSS rule we make sure to set 'margin-top' for the first element in
to a lower value such that we have a consistent margin between the article header and the content itself. However, if the first element is not a

, no such margin change will take effect for the first

element. For example, if the first element is a floating

, the
element will have its margin modified, whilst the

will keep its usual settings, resulting in a very inconsistent layout. We assume that the first

element is at the top of the article in almost all cases, and include a new rule in this commit that applies the margin settings correctly. --- sass/style.sass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sass/style.sass b/sass/style.sass index 3c0ef83..69c0b1c 100644 --- a/sass/style.sass +++ b/sass/style.sass @@ -140,6 +140,9 @@ article > section.post > :first-child margin-top: .5rem + > p:first-of-type + margin-top: .5rem + > p line-height: 1.3 -- cgit v1.2.3-2-gb3c3