docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.4k stars 5.67k forks source link

Option to disable animated scroll-to-anchor #1040

Open jasonkuhrt opened 4 years ago

jasonkuhrt commented 4 years ago

Feature request

What problem does this feature solve?

When in development, working on content at an anchor point in a long document, every change causes a refresh that must then go through a scroll. This becomes quite annoying. If there was an option to have the anchor be jumped to (no scroll) I would turn it on during my development sessions. Some users might also want this to be the experience for the website itself too. But my motivation right now is a development one. My use-case could be solved by hot-reloading as well I suspect, but seems way more complicated of a solution.

Are you willing to work on this yourself?

Maybe

anikethsaha commented 4 years ago

PR welcome just a note that the default one should be animated. If you want to add a new options (which I think is required for this, please update the docs as well)

jasonkuhrt commented 4 years ago

@anikethsaha any pointers? No clue about it right now myself.

anikethsaha commented 4 years ago

you need to dig the core !

The animation I think currently is due to transition property from the CSS You need to move those transitions to a class and make then opt-in. so suppose a class transition when added to any element will make it animated. so, If in scroll read the config and check for the option about the scroll animation. if it's false, remove the transition class

This will need a lot of styling change. and if we see the work to use case ratio, it's pretty small and generally not adviseable to change it! but if you are taking the lead, go on, I will try to help if required whenever I gets time

jasonkuhrt commented 4 years ago

Thanks for the warning, I indeed don't have the time right now for such a small nitpick. But at least this issue exists now if I or someone else can return to take it up. Thanks @anikethsaha

anikethsaha commented 4 years ago

ndeed don't have the time right now for such a small nitpick. But at least this issue exists now if I or someone else can return to

Sure, I will keep it open.