diff options
author | Wolfgang Müller | 2022-04-09 14:51:31 +0200 |
---|---|---|
committer | Wolfgang Müller | 2022-04-09 14:51:31 +0200 |
commit | ca051ddec727780a69cf69afdd33eb9456c49d6b (patch) | |
tree | af9251b4d34acdf499033f82b7ae3446c82284e2 | |
parent | 01285fe6b24c1a012025067bd09a2af54fccda2b (diff) | |
download | zunzuncito-ca051ddec727780a69cf69afdd33eb9456c49d6b.tar.gz |
sass: Always set margin-top for first <p> in <article>
Common elements in <article> usually have their own margin settings. In
a previous CSS rule we make sure to set 'margin-top' for the first
element in <article> 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 <p>, no such margin change will
take effect for the first <p> element. For example, if the first element
is a floating <figure>, the <figure> element will have its margin
modified, whilst the <p> will keep its usual settings, resulting in a
very inconsistent layout.
We assume that the first <p> 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.
-rw-r--r-- | sass/style.sass | 3 |
1 files changed, 3 insertions, 0 deletions
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 |