]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
docs(skippy): prevent skip links from overlapping header
authorGaël Poupard <gael.poupard@orange.com>
Tue, 26 May 2020 08:35:43 +0000 (10:35 +0200)
committerMark Otto <otto@github.com>
Mon, 13 Jul 2020 19:36:29 +0000 (12:36 -0700)
site/assets/scss/_skippy.scss
site/layouts/partials/skippy.html

index c573e45484efa223acc42afea4d1e10df223ffed..894db70db4e77a1a593d3bb3952f6e609cc19b96 100644 (file)
@@ -1,13 +1,20 @@
+// stylelint-disable declaration-no-important
+
 .skippy {
-  position: fixed;
-  top: .5rem;
-  left: .5rem;
-  z-index: $zindex-fixed;
-  padding: .5rem;
-  color: $white;
   background-color: $bd-purple;
 
-  &:hover {
+  a {
     color: $white;
   }
+
+  &:focus-within a {
+    position: static !important;
+    width: auto !important;
+    height: auto !important;
+    padding: $spacer / 2 !important;
+    margin: $spacer / 4 !important;
+    overflow: visible !important;
+    clip: auto !important;
+    white-space: normal !important;
+  }
 }
index 8dce2bc4955a7e4996a7573947aecaa8c03725e0..e6bf901a9c94449393626a32908b594fae8d5963 100644 (file)
@@ -1,5 +1,9 @@
-<a class="skippy visually-hidden-focusable" href="#content">Skip to main content</a>
+<div class="skippy overflow-hidden">
+  <div class="container-xl">
+    <a class="visually-hidden-focusable d-inline-flex p-2 m-1" href="#content">Skip to main content</a>
 
-{{ if (eq .Page.Layout "docs") }}
-  <a class="skippy visually-hidden-focusable d-none d-md-block" href="#bd-docs-nav">Skip to docs navigation</a>
-{{- end }}
+    {{ if (eq .Page.Layout "docs") }}
+      <a class="visually-hidden-focusable d-none d-md-inline-flex p-2 m-1" href="#bd-docs-nav">Skip to docs navigation</a>
+    {{- end }}
+  </div>
+</div>