Skip to content

Commit 064f731

Browse files
authored
Add transparent outline to input control BackdropUI focus style. (#50772)
* Add transparent outline to input control BackdropUI focus style. * Add changelog entry.
1 parent ce29b86 commit 064f731

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/components/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
- `DropdownMenu`: Convert to TypeScript ([#50187](https://github.com/WordPress/gutenberg/pull/50187)).
1313
- Added experimental v2 of `DropdownMenu` ([#49473](https://github.com/WordPress/gutenberg/pull/49473)).
1414

15+
### Bug Fix
16+
17+
- `InputControl`: Fix focus style to support Windows High Contrast mode ([#50772](https://github.com/WordPress/gutenberg/pull/50772)).
1518

1619
## 24.0.0 (2023-05-10)
1720

@@ -22,7 +25,7 @@
2225
### Bug Fix
2326

2427
- `NavigableContainer`: do not trap focus in `TabbableContainer` ([#49846](https://github.com/WordPress/gutenberg/pull/49846)).
25-
- Update `<Button>` component to have a transparent background for its tertiary disabled state, to match its enabled state. ([#50496](https://github.com/WordPress/gutenberg/pull/50496)).
28+
- Update `<Button>` component to have a transparent background for its tertiary disabled state, to match its enabled state. ([#50496](https://github.com/WordPress/gutenberg/pull/50496)).
2629

2730
### Internal
2831

packages/components/src/input-control/styles/input-control-styles.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,14 @@ const backdropFocusedStyles = ( {
270270
let borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border;
271271

272272
let boxShadow;
273+
let outline;
274+
let outlineOffset;
273275

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

278283
if ( disabled ) {
@@ -284,6 +289,8 @@ const backdropFocusedStyles = ( {
284289
borderColor,
285290
borderStyle: 'solid',
286291
borderWidth: 1,
292+
outline,
293+
outlineOffset,
287294
} );
288295
};
289296

0 commit comments

Comments
 (0)