Skip to content

Commit

Permalink
First attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
louismaximepiton committed Jul 4, 2022
1 parent 64f0eb4 commit 2a217ce
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 28 deletions.
14 changes: 0 additions & 14 deletions scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,8 @@
scroll-behavior: smooth;
}
}

// Boosted mod: Improve focus visibility when fixed/sticky header is used
// See https://caniuse.com/?search=scroll-padding
// scss-docs-start scroll-offset
@if $enable-fixed-header {
scroll-padding-top: $scroll-offset-top * .5;

@include media-breakpoint-up(lg) {
scroll-padding-top: $scroll-offset-top;
}
}
// scss-docs-end scroll-offset
// End mod
}


// Body
//
// 1. Remove the margin in all browsers.
Expand Down
2 changes: 1 addition & 1 deletion scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ $pre-line-height: 1.25 !default;
//

//// Scroll margin
$scroll-offset-top: $spacer * 6 !default; // Matching .navbar computed height
$scroll-offset-top: $spacer * 5 !default; // Matching .navbar computed height

//// Back to top
// scss-docs-start back-to-top
Expand Down
8 changes: 0 additions & 8 deletions site/assets/scss/_boosted.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
// stylelint-disable selector-max-id
:root {
scroll-padding-top: $offset-top / 2;

@include media-breakpoint-up(lg) {
scroll-padding-top: $offset-top;
}
}

html,
body {
min-height: 100vh;
Expand Down
18 changes: 14 additions & 4 deletions site/assets/scss/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
//

.bd-content {
// Offset content from fixed navbar when jumping to headings
// Boosted mod: Offset content from fixed navbar when jumping to headings, values adjusted
> :target {
padding-top: 5rem;
margin-top: -5rem;
padding-top: 7.5rem;
margin-top: -7.5rem;

@include media-breakpoint-up(md) {
padding-top: 10.5rem;
margin-top: -10.5rem;
}

@include media-breakpoint-up(lg) {
padding-top: 6.875rem;
margin-top: -6.875rem;
}
}

> h2:not(:first-child) {
> h2 {
margin-top: 3rem;
}

Expand Down
1 change: 0 additions & 1 deletion site/content/docs/5.2/getting-started/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ When using a fixed (or sticky) header, tabbing backward often hides focused elem
1. `$scroll-offset-top` variable defines the offset,
2. and [`$enable-fixed-header` allows to drop this rule]({{< docsref "/customize/options" >}}) if you don't use a fixed header.

{{< scss-docs name="scroll-offset" file="scss/_reboot.scss" >}}

### Minimum target size

Expand Down

0 comments on commit 2a217ce

Please sign in to comment.