flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.39k stars 834 forks source link

[2.x] Side nav positioning offset missing #4122

Open YUCLing opened 3 days ago

YUCLing commented 3 days ago

Current Behavior

With AffixedSidebar, the side nav uses position: fixed for side nav's ul to make it fixed on viewport. However, in #3876, the margin-top of ul is moved to the AffixedSidebar's parent element Page-sidebar.

From the top value used below, we can see it only includes the height of header, so the side nav is at a taller position than 1.x.

https://github.com/flarum/framework/blob/4feb4a3820a6c6e3c13fd7034ae583a628d86b30/framework/core/less/common/sideNav.less#L66

Steps to Reproduce

  1. Find a page with a side nav using AffixedSidebar
  2. Scroll down

Expected Behavior

The missing offset provided by margin-top should be still there.

Screenshots

image

Environment

Output of php flarum info

No response

Possible Solution

Backport https://github.com/flarum/framework/pull/4111/commits/11fc74db3f6e76dfcaa2fabdb3213e809e31ddb5 and https://github.com/flarum/framework/pull/4111/commits/ea21ef4c23ac8c7f9541b69905f1af3b69bc8619, which uses position: sticky and adds the missing offset.

Additional Context

No response