From 8bc4183f4a00b902f4929615a36ec4c6c2c27651 Mon Sep 17 00:00:00 2001
From: Kevin Paxman <kpaxman@uwaterloo.ca>
Date: Tue, 7 Mar 2023 10:38:03 -0500
Subject: [PATCH] Switch to negative top margin for headers instead of line
 height for alignment

---
 src/patterns/03-layouts/block/_block.scss | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/patterns/03-layouts/block/_block.scss b/src/patterns/03-layouts/block/_block.scss
index 8f530799..85c566ef 100644
--- a/src/patterns/03-layouts/block/_block.scss
+++ b/src/patterns/03-layouts/block/_block.scss
@@ -17,8 +17,7 @@
   & > {
     h2:first-child,
     .uw-admin-label + h2 {
-      line-height: 1em; /* using EMs because we want it to be the height of the text, regardless of what the font size is */
-      margin: 0 0 var(--size-2);
+      margin-top: -0.25em; /* Using ems so it adjusts to font size. */
       padding-top: 0;
     }
   }
@@ -29,8 +28,7 @@
   .uw-admin-label + .contextual + .uw-copy-text,
   .uw-copy-text:first-child {
     .uw-copy-text__wrapper > :where(h2, h3, h4, h5, h6):first-child {
-      line-height: 1em; /* using EMs because we want it to be the height of the text, regardless of what the font size is */
-      margin: 0 0 var(--size-2);
+      margin-top: -0.25em; /* Using ems so it adjusts to font size. */
       padding-top: 0;
     }
   }
-- 
GitLab