Skip to content

Commit

Permalink
First attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
louismaximepiton committed May 23, 2022
1 parent 1266609 commit 5b22664
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 27 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 @@ -1939,7 +1939,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
16 changes: 13 additions & 3 deletions site/assets/scss/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
//

.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 !important; // stylelint-disable-line declaration-no-important

@include media-breakpoint-up(md) {
padding-top: 10.5rem;
margin-top: -10.5rem !important; // stylelint-disable-line declaration-no-important
}

@include media-breakpoint-up(lg) {
padding-top: 6.875rem;
margin-top: -6.875rem !important; // stylelint-disable-line declaration-no-important
}
}

> h2:not(:first-child) {
Expand Down
1 change: 0 additions & 1 deletion site/content/docs/5.1/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 5b22664

Please sign in to comment.