Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Doc strange outline love
//detecting tab key press
$('body').on('keydown', function(e) {
var keyCode = e.keyCode || e.which;
if(keyCode == 9) {
GUI.debugging( 'GUI: Tab detected', 'report' );
$('html').addClass('is-keyboarduser');
$('body').off('keydown');
}
});
.outline() {
outline: none;
.is-keyboarduser & {
outline: 2px dotted #000;
outline-offset: 0.5rem;
}
}
.tab-link {
&:focus {
.outline();
}
}
@bfred-it

This comment has been minimized.

Show comment
Hide comment
@bfred-it

bfred-it Nov 11, 2015

Nice idea!

Here's a vanilla js version that you can just inline: https://gist.github.com/bfred-it/ffb6a3fe8303f9330e95

Nice idea!

Here's a vanilla js version that you can just inline: https://gist.github.com/bfred-it/ffb6a3fe8303f9330e95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment