basscss.github.io icon indicating copy to clipboard operation
basscss.github.io copied to clipboard

Point frag IDs to #0 instead of just #

Open csswizardry opened this issue 9 years ago • 3 comments

A lot of the links in your demos are pointing to href="#", which has the unwanted (but totally correct) side effect of skipping up to the very top of the page when clicked.

By simply pointing these hrefs to #0 instead, we can remove this behaviour. Because IDs seldom start with a number, we know that id="0" is highly unlikely to appear in our DOM; this means that if we click a link referencing it, nothing will (or can) happen, and we just stay where we are.

Here’s a little demo: https://jsfiddle.net/atwnxo8L/

csswizardry avatar Jul 08 '16 11:07 csswizardry

Thanks! Good point. FWIW all the examples live in the READMEs in the basscss/basscss repo.

jxnblk avatar Jul 08 '16 17:07 jxnblk

Gah, my bad. Sorry!

csswizardry avatar Jul 09 '16 09:07 csswizardry

Haha, it's fine I just didn't want anyone to futz around with this repo if they submitted a PR

jxnblk avatar Jul 09 '16 19:07 jxnblk