okkur / syna

Highly customizable open source theme for Hugo based static websites
https://syna.okkur.org/demo/
Apache License 2.0
250 stars 134 forks source link

Fix sticky sidebar issues #788

Closed mpourismaiel closed 4 years ago

mpourismaiel commented 4 years ago

What this PR does / why we need it:

Which issue this PR fixes: fixes #700 fixes #601

Release note:

- content: Fix sticky sidebar issues
mpourismaiel commented 4 years ago

I forgot to mention, please scroll the docs page with some of the articles expanded, in a long page with browser height set to 400px for example. The sidebar should stay in place while you scroll until it meets the header.

The code is implemented in a way that the two fragments stay independent and ignorant of each other. The content fragment only applies the scroll code if there is an active sidebar and should not break if there is a navbar or not.

mpourismaiel commented 4 years ago

Fixed the bug that was causing the failing test and then fixed a faulty test that failed occasionally. It was failing for this PR so pushed the commit here, let me know if you want me to separate it.

stp-ip commented 4 years ago

Like the scrolling, but the position doesn't seem perfect. This is more a side effect of #513 I guess. As we are overwriting the height. Would that be something we would like to fix here as well or am I missing something?

Screenshot_2020-06-25 Multilingual Mode

stp-ip commented 4 years ago

Edgecase, that should probably get a dev/ page and maybe a test. What happens with 2 sidebars? Do we need an additional note for the "sticky" config for the content fragment?

stp-ip commented 4 years ago

What do you think about a dev/ page for manual testing and probably also automated testing?

mpourismaiel commented 4 years ago

@stp-ip Added tests and dev pages accordingly.