Skip to content

Instantly share code, notes, and snippets.

@dacook
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacook/9b08a34fb65cfe9c0b04 to your computer and use it in GitHub Desktop.
Save dacook/9b08a34fb65cfe9c0b04 to your computer and use it in GitHub Desktop.
Behaviours that I think should be standard on all web pages

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.

Important

  1. Highlight elements that have been scrolled into view by the URL hash (eg #my-anchor) example
  2. All headings or sections should be linkable anchors (eg #my-heading). This might need a bit more defining.
  3. Any linkable anchors should indicate they're linkable with a hover state, and should be easy to copy the link. example
  4. Disable internal links with no target (ie href="#" -> on click{e.preventDefault()})

Less important

  1. Smooth scroll when following an internal link (eg #my-anchor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment