which are not done by browsers by default. Therefore this list is a potential guide for a boilerplate JS/CSS. TODO: expand into a better format, with examples and reasoning behind each item.
- Highlight elements that have been scrolled into view by the URL hash (eg
#my-anchor
) example - All headings or sections should be linkable anchors (eg
#my-heading
). This might need a bit more defining. - Any linkable anchors should indicate they're linkable with a hover state, and should be easy to copy the link. example
- Disable internal links with no target (ie
href="#"
->on click{e.preventDefault()}
)
- Smooth scroll when following an internal link (eg
#my-anchor
)