File tree Expand file tree Collapse file tree 24 files changed +56
-60
lines changed Expand file tree Collapse file tree 24 files changed +56
-60
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,12 @@ $candy-app-theme: mat.define-light-theme((
32
32
@include experimental .popover-edit-theme ($candy-app-theme );
33
33
34
34
.demo-strong-focus {
35
- // Include base styles for strong focus indicators.
36
- $indicators-config : (border-color : mat .get-color-from-palette ($candy-app-primary ));
37
- @include mat .strong-focus-indicators ($indicators-config );
38
- @include experimental .mdc-strong-focus-indicators ($indicators-config );
35
+ // Note: we can theme the indicators directly through `strong-focus-indicators` as well.
36
+ // Use the theme so we have some coverage over the entire API surface.
37
+ @include mat .strong-focus-indicators ();
38
+ @include mat .strong-focus-indicators-theme ($candy-app-theme );
39
+ @include experimental .mdc-strong-focus-indicators ();
40
+ @include experimental .mdc-strong-focus-indicators-theme ($candy-app-theme );
39
41
}
40
42
41
43
// Include the alternative theme styles inside of a block with a CSS class. You can make this
@@ -57,9 +59,8 @@ $candy-app-theme: mat.define-light-theme((
57
59
58
60
// Include the dark theme colors for focus indicators.
59
61
& .demo-strong-focus {
60
- $indicators-config : (border-color : mat .get-color-from-palette ($dark-primary ));
61
- @include mat .strong-focus-indicators ($indicators-config );
62
- @include experimental .mdc-strong-focus-indicators ($indicators-config );
62
+ @include mat .strong-focus-indicators-theme ($dark-colors );
63
+ @include experimental .mdc-strong-focus-indicators-theme ($dark-colors );
63
64
}
64
65
}
65
66
Original file line number Diff line number Diff line change 113
113
.mat-mdc-unelevated-button ,
114
114
.mat-mdc-raised-button {
115
115
.mat-mdc-focus-indicator ::before {
116
- $default-border-width : mat .$focus-indicators-private -default-border-width ;
116
+ $default-border-width : mat .$private-strong- focus-indicators-default-border-width ;
117
117
$border-width : var (--mat-mdc-focus-indicator-border-width , #{$default-border-width } );
118
118
$offset : calc (#{$border-width } + 2px );
119
119
margin : calc (#{$offset } * -1 );
120
120
}
121
121
}
122
122
123
123
.mat-mdc-outlined-button .mat-mdc-focus-indicator ::before {
124
- $default-border-width : mat .$focus-indicators-private -default-border-width ;
124
+ $default-border-width : mat .$private-strong- focus-indicators-default-border-width ;
125
125
$border-width : var (--mat-mdc-focus-indicator-border-width , #{$default-border-width } );
126
126
$offset : calc (#{$border-width } + 3px );
127
127
margin : calc (#{$offset } * -1 );
Original file line number Diff line number Diff line change 67
67
}
68
68
69
69
.mat-mdc-focus-indicator ::before {
70
- $default-border-width : mat .$focus-indicators-private -default-border-width ;
70
+ $default-border-width : mat .$private-strong- focus-indicators-default-border-width ;
71
71
$border-width : var (--mat-mdc-focus-indicator-border-width , #{$default-border-width } );
72
72
$offset : calc (#{$border-width } + 2px );
73
73
margin : calc (#{$offset } * -1 );
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ sass_binary(
49
49
],
50
50
deps = [
51
51
":mdc_checkbox_scss_lib" ,
52
- "//src/cdk:sass_lib" ,
53
52
"//src/material:sass_lib" ,
54
53
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib" ,
55
54
"//src/material-experimental/mdc-helpers:mdc_scss_deps_lib" ,
Original file line number Diff line number Diff line change 179
179
// For the chip element, default inset/offset values are necessary to ensure that
180
180
// the focus indicator is sufficiently contrastive and renders appropriately.
181
181
.mat-mdc-focus-indicator ::before {
182
- $default-border-width : mat .$focus-indicators-private -default-border-width ;
182
+ $default-border-width : mat .$private-strong- focus-indicators-default-border-width ;
183
183
$border-width : var (--mat-mdc-focus-indicator-border-width , #{$default-border-width } );
184
184
$offset : calc (#{$border-width } + 2px );
185
185
margin : calc (#{$offset } * -1 );
196
196
}
197
197
198
198
& ::before {
199
- $default-border-width : mat .$focus-indicators-private -default-border-width ;
199
+ $default-border-width : mat .$private-strong- focus-indicators-default-border-width ;
200
200
$offset : var (--mat-mdc-focus-indicator-border-width , #{$default-border-width } );
201
201
margin : calc (#{$offset } * -1 );
202
202
228
228
}
229
229
}
230
230
231
- // In the chips the individual actions have focus so we target a different element.
231
+ // The chip has multiple focus targets so we have to put the indicator on
232
+ // a separate element, rather than on the focusable element itself.
232
233
.mat-mdc-chip-action :focus .mat-mdc-focus-indicator ::before {
233
234
content : ' ' ;
234
235
}
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ sass_binary(
43
43
"external/npm/node_modules" ,
44
44
],
45
45
deps = [
46
- "//src/cdk:sass_lib" ,
47
46
"//src/material:sass_lib" ,
48
47
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib" ,
49
48
"//src/material-experimental/mdc-helpers:mdc_scss_deps_lib" ,
Original file line number Diff line number Diff line change 2
2
@use ' sass:map' ;
3
3
@use ' sass:meta' ;
4
4
5
+ $_prefix : ' mat-mdc' ;
6
+
5
7
// stylelint-disable-next-line material/theme-mixin-api
6
8
@mixin color ($config-or-theme-or-color ) {
7
9
@if meta .type-of ($config-or-theme-or-color ) == ' color' {
8
- @include mat .focus-indicators-private-private -customize-focus-indicators ((
10
+ @include mat .private-strong-focus-indicators -customize-focus-indicators ((
9
11
border-color : $config-or-theme-or-color
10
- ), ' mat-mdc ' );
12
+ ), $_prefix );
11
13
}
12
14
@else {
13
15
$config : mat .get-color-config ($config-or-theme-or-color );
14
16
$border-color : mat .get-color-from-palette (map .get ($config , primary ));
15
- @include mat .focus-indicators-private-private -customize-focus-indicators ((
17
+ @include mat .private-strong-focus-indicators -customize-focus-indicators ((
16
18
border-color : $border-color
17
- ), ' mat-mdc ' );
19
+ ), $_prefix );
18
20
}
19
21
}
20
22
21
23
// stylelint-disable-next-line material/theme-mixin-api
22
24
@mixin theme ($theme-or-color-config-or-color ) {
23
25
@if meta .type-of ($theme-or-color-config-or-color ) == ' color' {
24
- @include mat .focus-indicators-private-private -customize-focus-indicators ((
26
+ @include mat .private-strong-focus-indicators -customize-focus-indicators ((
25
27
border-color : $theme-or-color-config-or-color
26
- ), ' mat-mdc ' );
28
+ ), $_prefix );
27
29
}
28
30
@else {
29
31
$theme : mat .private-legacy-get-theme ($theme-or-color-config-or-color );
Original file line number Diff line number Diff line change 11
11
// Merge default config with user config.
12
12
$config : map .merge ($default-config , $config );
13
13
14
- @include mat .focus-indicators-private-private -customize-focus-indicators ($config , ' mat-mdc' );
14
+ @include mat .private-strong-focus-indicators -customize-focus-indicators ($config , ' mat-mdc' );
15
15
}
Original file line number Diff line number Diff line change 59
59
// focus/selected/hover state. Hence, we need to have a separate list-item spanning
60
60
// element that can be used for strong focus indicators.
61
61
.mat-mdc-list-item {
62
- & > .mat-mdc-focus-indicator {
62
+ > .mat-mdc-focus-indicator {
63
63
@include mat .private-fill ();
64
64
pointer-events : none ;
65
65
}
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ sass_binary(
46
46
"external/npm/node_modules" ,
47
47
],
48
48
deps = [
49
- "//src/cdk:sass_lib" ,
50
49
"//src/material:sass_lib" ,
51
50
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib" ,
52
51
"//src/material-experimental/mdc-helpers:mdc_scss_deps_lib" ,
You can’t perform that action at this time.
0 commit comments