Skip to content

Commit

Permalink
Have focus outline appear outside of element rather than covering it. (
Browse files Browse the repository at this point in the history
…#259)

* Add 0 offset to focus outline to fix chrome bug

* Inset focus for search inputs in header

* Make offset smaller to work around 1px border bug on inputs
  • Loading branch information
Ed Horsford authored and robinwhittleton committed Nov 11, 2016
1 parent 842db37 commit 3fc3dfc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions source/assets/stylesheets/_accessibility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,19 @@ a:focus {
input:focus,
textarea:focus,
select:focus,
button:focus,
#global-header input:focus {
button:focus {
outline: 3px solid $focus-colour;
outline-offset: 0;
}

#global-header {

input[type=search]:focus {
outline: 3px solid $focus-colour;
/* Focus appears inside the input */
outline-offset: -2px;

This comment has been minimized.

Copy link
@selfthinker

selfthinker Feb 2, 2017

Contributor

BTW, if we ever use normalize.css, that bit is already part of it: https://github.com/necolas/normalize.css/blob/master/normalize.css#L390

}

h1 a:focus {
background-color: transparent;
outline: none;
Expand Down

0 comments on commit 3fc3dfc

Please sign in to comment.