Skip to content

Commit 3d03bf3

Browse files
authored
fix(focus indicators): Improve styles that determine when focus indicators should render on selection controls. (#19546)
1 parent 2a97418 commit 3d03bf3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/material/core/focus-indicators/_focus-indicators.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@
5858
// Render the focus indicator on focus. Defining a pseudo element's
5959
// content will cause it to render.
6060

61-
// For checkboxes, radios, and slide toggles, render the focus indicator
62-
// when the class .cdk-focused is present.
63-
.cdk-focused.mat-checkbox .mat-focus-indicator::before,
64-
.cdk-focused.mat-radio-button .mat-focus-indicator::before,
65-
.cdk-focused.mat-slide-toggle .mat-focus-indicator::before,
61+
// Checkboxes, radios, and slide toggles render focus indicators when the
62+
// associated visually-hidden input is focused.
63+
.mat-checkbox-input:focus ~ .mat-focus-indicator::before,
64+
.mat-radio-input:focus ~ .mat-focus-indicator::before,
65+
.mat-slide-toggle-input:focus ~ .mat-slide-toggle-thumb-container .mat-focus-indicator::before,
6666

6767
// For options, render the focus indicator when the class .mat-active
6868
// is present.

0 commit comments

Comments
 (0)