File tree Expand file tree Collapse file tree 5 files changed +19
-17
lines changed
src/material-experimental/mdc-chips Expand file tree Collapse file tree 5 files changed +19
-17
lines changed Original file line number Diff line number Diff line change 2
2
@import ' ../mdc-helpers/mdc-helpers' ;
3
3
@import ' @material/theme/functions' ;
4
4
5
+ // Selector for the element that has a background color and opacity applied to its ::before and
6
+ // ::after for state interactions (hover, active, focus). Their API calls this their
7
+ // "ripple target", but we do not use it as our ripple, just state color.
8
+ $mat-chip-state-target : ' .mdc-chip__ripple' ;
9
+
5
10
@mixin mat-chips-theme-mdc ($theme ) {
6
11
@include mdc-chip-set-core-styles ($query : $mat-theme-styles-query );
7
12
@include mdc-chip-without-ripple ($query : $mat-theme-styles-query );
Original file line number Diff line number Diff line change
1
+ < span class ="mdc-chip__ripple "> </ span >
1
2
< ng-content select ="mat-chip-avatar, [matChipAvatar] "> </ ng-content >
2
3
< svg *ngIf ="_chipListMultiple " class ="mdc-chip__checkmark-svg " viewBox ="-2 -3 30 30 ">
3
4
< path class ="mdc-chip__checkmark-path " fill ="none " stroke ="black "
Original file line number Diff line number Diff line change 1
1
< div role ="gridcell ">
2
2
< div #chipContent tabindex ="-1 " class ="mat-chip-row-focusable-text-content ">
3
+ < span class ="mdc-chip__ripple "> </ span >
3
4
< ng-content select ="mat-chip-avatar, [matChipAvatar] "> </ ng-content >
4
5
< span class ="mdc-chip__text "> < ng-content > </ ng-content > </ span >
5
6
< ng-content select ="mat-chip-trailing-icon,[matChipTrailingIcon] "> </ ng-content >
Original file line number Diff line number Diff line change
1
+ < span class ="mdc-chip__ripple "> </ span >
1
2
< ng-content select ="mat-chip-avatar, [matChipAvatar] "> </ ng-content >
2
3
< div class ="mdc-chip__text mdc-chip__action--primary "> < ng-content > </ ng-content > </ div >
3
4
< ng-content select ="mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon] "> </ ng-content >
Original file line number Diff line number Diff line change 1
1
@import ' @material/chips/mixins' ;
2
+ @import ' ../../material/core/style/layout-common' ;
2
3
@import ' ../../material/core/style/noop-animation' ;
3
4
@import ' ../../cdk/a11y/a11y' ;
4
5
@import ' ../mdc-helpers/mdc-helpers' ;
28
29
// The MDC chip styles related to hover and focus states are intertwined with the MDC ripple styles.
29
30
// We currently don't use the MDC ripple due to size concerns, therefore we need to add some
30
31
// additional styles to restore these states.
31
- .mat-mdc-chip :not (.mat-mdc-chip-disabled ) {
32
- & :hover , & :focus , div :focus {
33
- .mdc-chip__text ::after {
34
- content : ' ' ;
35
- position : absolute ;
36
- width : 100% ;
37
- height : 100% ;
38
-
39
- // Note that we use a `background` and `opacity`, instead of an `rgba` background, because
40
- // `rgba` backgrounds get converted into solid colors in high contrast mode.
41
- background : #000 ;
42
- opacity : 0.2 ;
43
- top : 0 ;
44
- left : 0 ;
45
- pointer-events : none ;
46
- }
47
- }
32
+ .mdc-chip__ripple ::after , .mdc-chip__ripple ::before {
33
+ @include mat-fill ;
34
+ content : ' ' ;
35
+ pointer-events : none ;
36
+ opacity : 0 ;
48
37
}
49
38
50
39
// Angular Material supports disabled chips, which MDC does not.
55
44
.mat-mdc-chip-trailing-icon , .mat-chip-row-focusable-text-content {
56
45
pointer-events : none ;
57
46
}
47
+
48
+ // Do not show state interactions for disabled chips.
49
+ .mdc-chip__ripple ::after , .mdc-chip__ripple ::before {
50
+ display : none ;
51
+ }
58
52
}
59
53
60
54
// Angular Material supports vertically-stacked chips, which MDC does not.
You can’t perform that action at this time.
0 commit comments