Skip to content

Commit

Permalink
Add transparent outline to input control BackdropUI focus style.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed May 19, 2023
1 parent a8da93f commit 6554fb3
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,14 @@ const backdropFocusedStyles = ( {
let borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border;

let boxShadow;
let outline;
let outlineOffset;

if ( isFocused ) {
boxShadow = `0 0 0 1px ${ COLORS.ui.borderFocus } inset`;
// Windows High Contrast mode will show this outline, but not the box-shadow.
outline = `2px solid transparent`;
outlineOffset = `-2px`;
}

if ( disabled ) {
Expand All @@ -284,6 +289,8 @@ const backdropFocusedStyles = ( {
borderColor,
borderStyle: 'solid',
borderWidth: 1,
outline,
outlineOffset,
} );
};

Expand Down

0 comments on commit 6554fb3

Please sign in to comment.