Skip to content

Doc: fix offset content from fixed navbar when jumping to headings#36280

Closed
julien-deramond wants to merge 2 commits intotwbs:mainfrom
julien-deramond:main-jd-fix-offset-content
Closed

Doc: fix offset content from fixed navbar when jumping to headings#36280
julien-deramond wants to merge 2 commits intotwbs:mainfrom
julien-deramond:main-jd-fix-offset-content

Conversation

@julien-deramond
Copy link
Copy Markdown
Member

@julien-deramond julien-deramond commented May 5, 2022

Closes #36278

This PR is a suggestion to fix the issue #36278.

I've reverted the change from 195440f to include what was there before.

Few changes:

  • Kept the new comment
  • Removed the media-breakpoint-up(md) rule
  • Changed the value from 4rem to use the new value 5rem

Live previews examples

/CC @mdo (maybe there are edge cases that I'm not aware of)

@julien-deramond julien-deramond requested a review from a team as a code owner May 5, 2022 07:09
Comment thread site/assets/scss/_content.scss Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember well, the removal of this property was to avoid the unexpected scrolling while typing into the search bar. (#33993)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see! I put this PR in Draft mode in order to find a better solution. Any help would be helpful if you have some ideas.

Copy link
Copy Markdown
Member Author

@julien-deramond julien-deramond May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased it on main. With the new DocSearch v3 system, we don't have this issue anymore since there is a popup instead of a typeahead. It seems to work pretty well in desktop and mobile modes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicking the version dropdown picker also causes a scrolling issue—each time you click it, the page moves up a bit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh. OK I see it on mobile. Opening the offcanvas menu, each time I click outside of it makes the page moves up a bit.

@julien-deramond julien-deramond marked this pull request as draft May 5, 2022 07:58
@julien-deramond julien-deramond force-pushed the main-jd-fix-offset-content branch from 68ee6ca to 04a5353 Compare May 7, 2022 08:25
@julien-deramond julien-deramond force-pushed the main-jd-fix-offset-content branch from 04a5353 to 4682f6f Compare May 9, 2022 07:01
@julien-deramond julien-deramond marked this pull request as ready for review May 9, 2022 13:05
@julien-deramond julien-deramond marked this pull request as draft May 9, 2022 18:14
}

.bd-content {
> h2:not(:first-child) {
Copy link
Copy Markdown
Member

@louismaximepiton louismaximepiton Jul 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just > h2 could be a quick fix to handle it on a stable version (even if it changes a bit the first h2 margin-top) or maybe add an !important rule to the code above ?

@julien-deramond
Copy link
Copy Markdown
Member Author

Superseded by #38220

@julien-deramond julien-deramond deleted the main-jd-fix-offset-content branch March 20, 2023 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doc: Extra top padding after having clicked on anchor links

3 participants