Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Extra top padding after having clicked on anchor links #36278

Closed
3 tasks done
julien-deramond opened this issue May 5, 2022 · 3 comments · Fixed by #38220
Closed
3 tasks done

Doc: Extra top padding after having clicked on anchor links #36278

julien-deramond opened this issue May 5, 2022 · 3 comments · Fixed by #38220

Comments

@julien-deramond
Copy link
Member

julien-deramond commented May 5, 2022

Prerequisites

Describe the issue

An extra padding top is created for each section after having clicked on the anchor links in the documentation.

Basic rendering

Rendering after the manipulation (with the extra top padding)

I haven't looked at the issue precisely but this is probably related from near and far to:

.bd-content>:target {
 padding-top:5rem;
 margin-top:-5rem
}

It has changed in 195440f.

Nothing has been tested yet on my side but there was another system in place before apparently based on:

// Offset for the sticky header
@include media-breakpoint-up(md) {
  :root {
    scroll-padding-top: 4rem;

Note: It happens with all breakpoints.

Reduced test cases

1st test case

After having clicked on "Importing", the padding-top stays on top until the page is refreshed.

Peek 2022-05-05 08-43

2nd test case

It is maybe more obvious in this video. We can directly see the extra padding on top of "CSPs and embedded SVGs" that's added even if the content is not near the header.

Peek 2022-05-05 08-43 (2)

What operating system(s) are you seeing the problem on?

Linux

What browser(s) are you seeing the problem on?

Firefox

What version of Bootstrap are you using?

v5.2.0 (current main branch)

@julien-deramond julien-deramond changed the title Doc: Extra padding top after having clicked on anchor links Doc: Extra top padding after having clicked on anchor links May 5, 2022
@Catalyst497

This comment was marked as off-topic.

@julien-deramond
Copy link
Member Author

Hey @Catalyst497 . We don't affect issues but you can create a PR to provide a solution :)

@mdo
Copy link
Member

mdo commented Oct 3, 2022

The problem with the previous implementation using scroll padding was that it moved our scroll on click of any dropdown element, and possibly other elements. Either that's a problem in our JS or it's a bug in Safari with the property. This solution, while annoying in some ways, has worked best for us historically so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
3 participants