From 6205b1b4305d3a4784cc0bcf5d73b1bc2449dc73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ra=C4=8D=C3=A1k?= Date: Thu, 19 Dec 2024 18:43:52 +0100 Subject: [PATCH] Fix padding of headings with multiple children (#4341) This is the case when e.g. part of the heading is italicized. --- site/owid.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/owid.scss b/site/owid.scss index 64244cf421..cf0ddcd6ef 100644 --- a/site/owid.scss +++ b/site/owid.scss @@ -238,7 +238,9 @@ h6 { // doesn't work and programmatically wrapping the last word and the // deep-link in a span with text-wrap: nowrap would be an even bigger hack. &:has(.deep-link) { - > *:first-child { + // Pick the second-to-last child, since the heading can have multiple + // elements as children and the last child is the deep-link. + > *:nth-last-child(2) { padding-right: 2rem; // On touch devices, the deep-link is hidden, so we don't need the