]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Use `scroll-margin-top` instead of pseudo hack
authorMartijn Cuppens <martijn.cuppens@gmail.com>
Sun, 23 Feb 2020 15:23:55 +0000 (16:23 +0100)
committerXhmikosR <xhmikosr@gmail.com>
Thu, 12 Mar 2020 15:56:16 +0000 (17:56 +0200)
site/assets/js/application.js
site/assets/scss/_content.scss

index 0cf4199c96590ab55771f8460267991914163b0d..d5a68c7e123673e93411f3154e369cf37e062865 100644 (file)
   }
   anchors.add('.bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5')
 
-  // Wrap inner
-  makeArray(document.querySelectorAll('.bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5'))
-    .forEach(function (hEl) {
-      hEl.innerHTML = '<span class="bd-content-title">' + hEl.innerHTML + '</span>'
-    })
-
   bsCustomFileInput.init()
 })()
index f264b523570b2d56699ad4ef8df07091cf8c1da3..b01547758dfbacc5e5117e2fff84d24b88b1f24b 100644 (file)
@@ -5,20 +5,11 @@
 .bd-content {
   order: 1;
 
-  // Hack the sticky header
-  // stylelint-disable selector-no-qualifying-type
-  > h2[id],
-  > h3[id],
-  > h4[id] {
-    pointer-events: none;
-
-    &::before {
-      display: block;
-      height: 6rem;
-      margin-top: -6rem;
-      content: "";
+  // Offset for the sticky header
+  > * {
+    @include media-breakpoint-up(md) {
+      scroll-margin-top: 4rem;
     }
-    // stylelint-enable selector-no-qualifying-type
   }
 
   > h2:not(:first-child) {
   }
 }
 
-.bd-content-title {
-  display: block;
-  pointer-events: auto;
-}
-
 .bd-title {
   @include font-size(3rem);
 }