Skip to content

Commit

Permalink
docs(skippy): prevent skip links from overlapping header
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd authored and XhmikosR committed Jul 21, 2020
1 parent 5b71909 commit bf41e05
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
11 changes: 8 additions & 3 deletions site/_includes/skippy.html
@@ -1,3 +1,8 @@
<a class="skippy sr-only sr-only-focusable" href="#content">
<span class="skippy-text">Skip to main content</span>
</a>
<div class="skippy overflow-hidden">
<div class="container-xl">
<a class="sr-only sr-only-focusable d-inline-flex p-2 m-1" href="#content">Skip to main content</a>
{%- if page.layout == "docs" -%}
<a class="sr-only sr-only-focusable d-none d-md-inline-flex p-2 m-1" href="#bd-docs-nav">Skip to docs navigation</a>
{%- endif -%}
</div>
</div>
23 changes: 13 additions & 10 deletions site/docs/4.5/assets/scss/_skippy.scss
@@ -1,17 +1,20 @@
// stylelint-disable declaration-no-important

.skippy {
display: block;
padding: 1em;
color: $white;
text-align: center;
background-color: $bd-purple;
outline: 0;

@include hover() {
a {
color: $white;
}
}

.skippy-text {
padding: .5em;
outline: 1px dotted;
&: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;
}
}

0 comments on commit bf41e05

Please sign in to comment.