Skip to content

Commit f0e66de

Browse files
devversionandrewseguin
authored andcommitted
refactor: rename MDC strong-focus indicator mixin for consistent naming
* refactor: rename MDC strong-focus indicator mixin for consistent naming Recently we renamed all MDC-based mixins from a `-mdc` suffix to the `mat-mdc` prefix. This didn't happen for the MDC focus indicator theme which has been added to the `density-api` WIP branch (to account for the new theming API). To ensure that mixins are all consistent, the mixin name should be updated to the `mat-mdc` prefix. * fix: focus-indicator theme mixin should not throw if color is passed c522351 that landed in the density WIP branch created theme mixins for the strong-focus indicators. It looks like logic for supporting an actual color to be specified is currently broken as we still try to extract the color config from a color variable.
1 parent 3285ff2 commit f0e66de

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/dev-app/theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// Include base styles for strong focus indicators.
2424
.demo-strong-focus {
2525
@include mat-strong-focus-indicators();
26-
@include mat-strong-focus-indicators-mdc();
26+
@include mat-mdc-strong-focus-indicators();
2727
}
2828

2929
// Define the default theme (same as the example above).
@@ -57,7 +57,7 @@ $dark-theme: mat-dark-theme((
5757
// Include the default theme for focus indicators.
5858
.demo-strong-focus {
5959
@include mat-strong-focus-indicators-theme($candy-app-theme);
60-
@include mat-strong-focus-indicators-theme-mdc($candy-app-theme);
60+
@include mat-mdc-strong-focus-indicators-theme($candy-app-theme);
6161
}
6262

6363
// Include the alternative theme styles inside of a block with a CSS class. You can make this
@@ -74,7 +74,7 @@ $dark-theme: mat-dark-theme((
7474
// Include the dark theme for focus indicators.
7575
.demo-unicorn-dark-theme.demo-strong-focus {
7676
@include mat-strong-focus-indicators-theme($dark-theme);
77-
@include mat-strong-focus-indicators-theme-mdc($dark-theme);
77+
@include mat-mdc-strong-focus-indicators-theme($dark-theme);
7878
}
7979

8080
// Create classes for all density scales which are supported by all MDC-based components.

src/material-experimental/mdc-helpers/_focus-indicator.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import '../../material/core/theming/theming';
22
@import '../../material/core/style/layout-common';
3-
@import '../../material/core/focus-indicator/focus-indicator';
3+
@import '../../material/core/focus-indicators/focus-indicators';
44

55

66
/// Mixin that turns on strong focus indicators.
@@ -106,8 +106,10 @@
106106
@if type-of($theme-or-color) != 'map' {
107107
@include _mat-mdc-strong-focus-indicators-border-color($theme-or-color);
108108
}
109-
$color: mat-get-color-config($theme-or-color);
110-
@if $color != null {
111-
@include mat-mdc-strong-focus-indicators-color($color);
109+
@else {
110+
$color: mat-get-color-config($theme-or-color);
111+
@if $color != null {
112+
@include mat-mdc-strong-focus-indicators-color($color);
113+
}
112114
}
113115
}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@
109109
@if type-of($theme-or-color) != 'map' {
110110
@include _mat-strong-focus-indicators-border-color($theme-or-color);
111111
}
112-
$color: mat-get-color-config($theme-or-color);
113-
@if $color != null {
114-
@include mat-strong-focus-indicators-color($color);
112+
@else {
113+
$color: mat-get-color-config($theme-or-color);
114+
@if $color != null {
115+
@include mat-strong-focus-indicators-color($color);
116+
}
115117
}
116118
}

0 commit comments

Comments
 (0)