Skip to content

Commit

Permalink
fix: remove unneeded focus management
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Feb 2, 2019
1 parent 23a832d commit 37cd58d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,8 @@ exports[`Button scss have to match snapshot 1`] = `
html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):focus, html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):active {
box-shadow: 0 0 0 2px var(--color-emerald-green);
border-color: transparent; }
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):focus:not(.dnb-no-mouse-focus),
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):active:not(.dnb-no-mouse-focus) {
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):focus,
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):active {
box-shadow: none;
color: inherit;
border: none; }
Expand Down
6 changes: 2 additions & 4 deletions packages/dnb-ui-lib/src/components/button/style/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,8 @@
@include fakeFocus();
}

html[data-whatinput='mouse']
&:not([disabled]):focus:not(.dnb-no-mouse-focus),
html[data-whatinput='mouse']
&:not([disabled]):active:not(.dnb-no-mouse-focus) {
html[data-whatinput='mouse'] &:not([disabled]):focus,
html[data-whatinput='mouse'] &:not([disabled]):active {
box-shadow: none;
color: inherit;
border: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,8 @@ exports[`Dropdown scss have to match snapshot 1`] = `
html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):focus, html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):active {
box-shadow: 0 0 0 2px var(--color-emerald-green);
border-color: transparent; }
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):focus:not(.dnb-no-mouse-focus),
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):active:not(.dnb-no-mouse-focus) {
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):focus,
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):active {
box-shadow: none;
color: inherit;
border: none; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,8 @@ exports[`InputMasked scss have to match snapshot 1`] = `
html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):focus, html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):active {
box-shadow: 0 0 0 2px var(--color-emerald-green);
border-color: transparent; }
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):focus:not(.dnb-no-mouse-focus),
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):active:not(.dnb-no-mouse-focus) {
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):focus,
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):active {
box-shadow: none;
color: inherit;
border: none; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,8 @@ exports[`Input scss have to match snapshot 1`] = `
html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):focus, html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):active {
box-shadow: 0 0 0 2px var(--color-emerald-green);
border-color: transparent; }
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):focus:not(.dnb-no-mouse-focus),
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):active:not(.dnb-no-mouse-focus) {
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):focus,
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):active {
box-shadow: none;
color: inherit;
border: none; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,8 @@ exports[`Modal scss have to match snapshot 1`] = `
html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):focus, html[data-whatinput='keyboard'] .dnb-button--reset:not([disabled]):active {
box-shadow: 0 0 0 2px var(--color-emerald-green);
border-color: transparent; }
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):focus:not(.dnb-no-mouse-focus),
html[data-whatinput='mouse']
.dnb-button--reset:not([disabled]):active:not(.dnb-no-mouse-focus) {
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):focus,
html[data-whatinput='mouse'] .dnb-button--reset:not([disabled]):active {
box-shadow: none;
color: inherit;
border: none; }
Expand Down
6 changes: 0 additions & 6 deletions packages/dnb-ui-lib/src/style/core/dnb-core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ body {
}

// Focus management
html[data-whatinput='mouse'] .dnb-spacing *:focus {
outline: none;
}
html[data-whatinput='keyboard'] .dnb-spacing *:not(a):not(div):focus {
@include fakeFocus();
}
.dnb-no-focus {
outline: none;
}
Expand Down

0 comments on commit 37cd58d

Please sign in to comment.