Skip to content

Commit

Permalink
fix: changed double focus to outline and box-shadow (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-bongiovanni authored Oct 9, 2024
1 parent d392496 commit 46fdcb5
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
14 changes: 10 additions & 4 deletions src/theme/ItaliaTheme/Blocks/common/_searchBlockFilters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
min-width: 150px;

&:focus-within {
border: 2px solid $inner-focus-border !important;
box-shadow: 0 0 0 2px $outer-focus-outline !important;
outline: 2px solid $outer-focus-outline !important;
outline-offset: 2px;

border: none !important;
box-shadow: 0 0 0 2px $inner-focus-shadow !important;
}

.react-select__control {
Expand Down Expand Up @@ -58,8 +61,11 @@
}

&.DateInput_input__focused {
border: 2px solid $inner-focus-border !important;
box-shadow: 0 0 0 2px $outer-focus-outline !important;
outline: 2px solid $outer-focus-outline !important;
outline-offset: 2px;

border: none !important;
box-shadow: 0 0 0 2px $inner-focus-shadow !important;
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/theme/ItaliaTheme/Widgets/_reactSelect.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
.react-select__control,
.react-select__control:hover {
&.react-select__control--is-focused {
border: 2px solid $inner-focus-border !important;
box-shadow: 0 0 0 2px $outer-focus-outline !important;
outline: 2px solid $outer-focus-outline !important;
outline-offset: 2px;

border: none !important;
box-shadow: 0 0 0 2px $inner-focus-shadow !important;
}
}
8 changes: 5 additions & 3 deletions src/theme/ItaliaTheme/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
button.btn,
button.rounded-right {
&:focus {
border: 2px solid $inner-focus-border !important;
box-shadow: 0 0 0 2px $outer-focus-outline !important;
outline: none;
outline: 2px solid $outer-focus-outline !important;
outline-offset: 2px;

border: none !important;
box-shadow: 0 0 0 2px $inner-focus-shadow !important;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/theme/_site-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ $ribbon-width: calc($spacer * 2);

// accessible focus colors
$outer-focus-outline: #000 !default;
$inner-focus-border: #fff !default;
$inner-focus-shadow: #fff !default;
7 changes: 5 additions & 2 deletions src/theme/bootstrap-override/bootstrap-italia/_focus.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
:focus:not(.focus--mouse),
%focus {
box-shadow: 0 0 0 2px $outer-focus-outline !important;
border: 2px solid $inner-focus-border !important;
outline: 2px solid $outer-focus-outline !important;
outline-offset: 2px;

border: none !important;
box-shadow: 0 0 0 2px $inner-focus-shadow !important;
}

.skiplinks a:focus:not(.focus--mouse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
border: $header-center-bg-color 2px solid !important;

&:focus {
outline: 2.5px solid $inner-focus-border !important;
box-shadow: 0 0 0 5px $outer-focus-outline !important;
outline: 2px solid $outer-focus-outline !important;
outline-offset: 2px;

border: none !important;
box-shadow: 0 0 0 2px $inner-focus-shadow !important;
}
}
}
Expand Down

0 comments on commit 46fdcb5

Please sign in to comment.