Skip to content

Commit 5befbe0

Browse files
committed
bug(focus indicators): Turns out we can rely upon mat-core being before component styles.
1 parent 1187b85 commit 5befbe0

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

src/material-experimental/mdc-slide-toggle/slide-toggle.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
// the host element.
2323
pointer-events: none;
2424
}
25-
26-
// The thumb underlay needs additional specificity to override the focus indicator's relative
27-
// positioning.
28-
.mdc-switch__thumb-underlay {
29-
position: absolute;
30-
}
31-
3225
// The MDC switch styles related to the hover state are intertwined with the MDC ripple styles.
3326
// We currently don't use the MDC ripple due to size concerns, therefore we need to add some
3427
// additional styles to restore the hover state.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
// is present.
6868
.mat-focus-indicator.mat-option.mat-active::before,
6969

70-
// The focus indicator in the calendar is placed on an element inside the cell.
70+
// For calendar cells, render the focus indicator when the parent cell is
71+
// focused.
7172
.mat-calendar-body-cell:focus .mat-focus-indicator::before,
7273

7374
// For all other components, render the focus indicator on focus.

src/material/datepicker/calendar-body.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ $mat-calendar-range-end-body-cell-size:
153153
}
154154

155155
.mat-calendar-body-cell-content {
156+
position: absolute;
156157
top: $mat-calendar-body-cell-content-margin;
157158
left: $mat-calendar-body-cell-content-margin;
158159
z-index: 1;
@@ -174,12 +175,6 @@ $mat-calendar-range-end-body-cell-size:
174175
// Choosing a value clearly larger than the height ensures we get the correct capsule shape.
175176
border-radius: $mat-calendar-body-cell-radius;
176177

177-
// Apply this style with additional specificity to override the focus indicator's relative
178-
// positioning.
179-
.mat-calendar-body-cell & {
180-
position: absolute;
181-
}
182-
183178
@include cdk-high-contrast(active, off) {
184179
border: none;
185180
}

0 commit comments

Comments
 (0)