body p:last-of-type + h1, body p:last-of-type + h2, body p:last-of-type + h3, body p:last-of-type + h4, body p:last-of-type + h5, body p:last-of-type + h6
What is the purpose of this styling? It currently only impacts headings that come after a single paragraph (but would fail to target anything in most typical circumstances because a heading rarely ever comes after a final paragraph).
Currently it gets in the way in situations where headings come after an accent heading (which uses a <p> for proper semantic html) in containers where other spacing techniques are used (such as gap/owl).
It seems to have no practical benefit and only causes issues…
You are correct that the rule only applies in sporadic exceptional cases. After consulting with Thomas, we have decided to remove it. We’ll keep the p:last-of-type {margin-bottom: 0;}, because otherwise, you would have the same problems with the browser defaults of the p-tag.
Side note: From my point of view, it is questionable whether the p-tag is the correct element for an “accent heading”, “eyebrow heading”, or “sub-heading”, but the semantics are always debatable.
@Michael Yep, I remembered your post too and realized that my explanation doesn’t make quite as much sense
It was said that this styling was going to be removed. However, it’s two years later now and I see this is still in the frontend-light stylesheet. Why wasn’t it removed? Also, shouldn’t the margin-bottom be applied to a “p” tag using :last-child. Wouldn’t that make more sense? I’m currently in a situation where the last element on my page is an unordered list, not a paragraph. As a result, all the spacing is jacked up.