Demonstration prollyfill for a use-case commmited by the community. Unlike the proposed :local-link() pseud-class which matches a links href against the current URL and allows you to style on how many segments _match_ the proposed :-links-level() allows you to style local links based purely on how many segments they have, such that you can style segments of your site (1st level things vs 2nd level things and so on).
They are 0-based, see below for examples.

These should be blue with a white foreground because they match at the 0 (root) level ... / /index.html http://bkardell.github.io http://bkardell.github.io/ //bkardell.github.io //bkardell.github.io?test //bkardell.github.io?test#ohboy //bkardell.github.io?test#ohboy //bkardell.github.io?test#ohboy/?:: http://bkardell.github.io/selectors-L4-link-prollyfills

These should be green with a white foreground and italic because they match at the 1 level (and 0 and thus inherit) http://bkardell.github.io/selectors-L4-link-prollyfills/prollyfill http://bkardell.github.io/selectors-L4-link-prollyfills/examples http://bkardell.github.io/selectors-L4-link-prollyfills/examples-

These should be orange with a white foreground and italics because they match at the 2 level (and 1 and 0 and thus inherit) http://bkardell.github.io/selectors-L4-link-prollyfills/examples/ http://bkardell.github.io/selectors-L4-link-prollyfills/examples/foo#/test http://bkardell.github.io/selectors-L4-link-prollyfills/examples/bar?test=ok/true

These should be yellow with a white foreground and bold italics because they match at the 3 level (and 1 and 0 and thus inherit) http://bkardell.github.io/selectors-L4-link-prollyfills/examples/local/ http://bkardell.github.io/selectors-L4-link-prollyfills/examples/local/something http://bkardell.github.io/selectors-L4-link-prollyfills/examples/local/somethingomething?test=ok/true http://bkardell.github.io/selectors-L4-link-prollyfills/examples/local/foo/blah.html