|
23 | 23 | }
|
24 | 24 | }
|
25 | 25 |
|
| 26 | + .mat-tab-label, .mat-tab-link { |
| 27 | + color: mat-color($foreground, text); |
| 28 | + |
| 29 | + &.mat-tab-disabled { |
| 30 | + color: mat-color($foreground, disabled-text); |
| 31 | + } |
| 32 | + } |
| 33 | + |
| 34 | + .mat-tab-header-pagination-chevron { |
| 35 | + border-color: mat-color($foreground, text); |
| 36 | + } |
| 37 | + |
| 38 | + .mat-tab-header-pagination-disabled .mat-tab-header-pagination-chevron { |
| 39 | + border-color: mat-color($foreground, disabled-text); |
| 40 | + } |
| 41 | + |
26 | 42 | .mat-tab-group, .mat-tab-nav-bar {
|
27 |
| - .mat-tab-label:focus, .mat-tab-link:focus { |
28 |
| - background-color: mat-color($primary, lighter, 0.3); |
| 43 | + &.mat-primary { |
| 44 | + @include _mat-tabs-color($primary); |
| 45 | + |
| 46 | + &.mat-background-primary { |
| 47 | + @include _mat-tabs-color($primary, $primary); |
| 48 | + } |
| 49 | + |
| 50 | + &.mat-background-accent { |
| 51 | + @include _mat-tabs-color($primary, $accent); |
| 52 | + } |
| 53 | + |
| 54 | + &.mat-background-warn { |
| 55 | + @include _mat-tabs-color($primary, $warn); |
| 56 | + } |
29 | 57 | }
|
30 | 58 |
|
31 | 59 | &.mat-accent {
|
32 |
| - .mat-tab-label:focus, .mat-tab-link:focus { |
33 |
| - background-color: mat-color($accent, lighter, 0.3); |
| 60 | + @include _mat-tabs-color($accent); |
| 61 | + |
| 62 | + &.mat-background-primary { |
| 63 | + @include _mat-tabs-color($accent, $primary); |
| 64 | + } |
| 65 | + |
| 66 | + &.mat-background-accent { |
| 67 | + @include _mat-tabs-color($accent, $accent); |
| 68 | + } |
| 69 | + |
| 70 | + &.mat-background-warn { |
| 71 | + @include _mat-tabs-color($accent, $warn); |
34 | 72 | }
|
35 | 73 | }
|
36 | 74 |
|
37 | 75 | &.mat-warn {
|
38 |
| - .mat-tab-label:focus, .mat-tab-link:focus { |
39 |
| - background-color: mat-color($warn, lighter, 0.3); |
| 76 | + @include _mat-tabs-color($warn); |
| 77 | + |
| 78 | + &.mat-background-primary { |
| 79 | + @include _mat-tabs-color($warn, $primary); |
| 80 | + } |
| 81 | + |
| 82 | + &.mat-background-accent { |
| 83 | + @include _mat-tabs-color($warn, $accent); |
| 84 | + } |
| 85 | + |
| 86 | + &.mat-background-warn { |
| 87 | + @include _mat-tabs-color($warn, $warn); |
40 | 88 | }
|
41 | 89 | }
|
| 90 | + } |
| 91 | +} |
42 | 92 |
|
43 |
| - .mat-ink-bar { |
44 |
| - background-color: mat-color($primary); |
| 93 | +@mixin _mat-tabs-color($color, $background-color: null) { |
| 94 | + |
| 95 | + $tab-focus-color: if($background-color, $background-color, $color); |
| 96 | + |
| 97 | + // Focus the tab label |
| 98 | + .mat-tab-label:focus, .mat-tab-link:focus { |
| 99 | + background-color: mat-color($tab-focus-color, lighter, 0.3); |
| 100 | + } |
| 101 | + |
| 102 | + // Set the ink bar to the theme color or default-contrast if |
| 103 | + // the theme color and background color are the same |
| 104 | + .mat-ink-bar { |
| 105 | + background-color: mat-color($color); |
| 106 | + |
| 107 | + @if $background-color == $color { |
| 108 | + background-color: mat-color($background-color, default-contrast); |
45 | 109 | }
|
| 110 | + } |
46 | 111 |
|
47 |
| - &.mat-accent .mat-ink-bar { |
48 |
| - background-color: mat-color($accent); |
| 112 | + @if $background-color { |
| 113 | + // Set background color for the tab group |
| 114 | + .mat-tab-header, .mat-tab-links { |
| 115 | + background-color: mat-color($background-color); |
49 | 116 | }
|
50 | 117 |
|
51 |
| - &.mat-warn .mat-ink-bar { |
52 |
| - background-color: mat-color($warn); |
| 118 | + // Set labels to contrast against background |
| 119 | + .mat-tab-label, .mat-tab-link { |
| 120 | + color: mat-color($background-color, default-contrast); |
| 121 | + |
| 122 | + &.mat-tab-disabled { |
| 123 | + color: mat-color($background-color, default-contrast, 0.4); |
| 124 | + } |
53 | 125 | }
|
54 | 126 |
|
55 |
| - } |
| 127 | + // Set pagination chevrons to contrast background |
| 128 | + .mat-tab-header-pagination-chevron { |
| 129 | + border-color: mat-color($background-color, default-contrast); |
| 130 | + } |
56 | 131 |
|
57 |
| - .mat-tab-label, .mat-tab-link { |
58 |
| - color: mat-color($foreground, text); |
| 132 | + .mat-tab-header-pagination-disabled .mat-tab-header-pagination-chevron { |
| 133 | + border-color: mat-color($background-color, default-contrast, 0.4); |
| 134 | + } |
59 | 135 |
|
60 |
| - &.mat-tab-disabled { |
61 |
| - color: mat-color($foreground, disabled-text); |
| 136 | + // Remove header border |
| 137 | + .mat-tab-header { |
| 138 | + border-bottom: none; |
| 139 | + border-top: none; |
62 | 140 | }
|
63 | 141 | }
|
64 | 142 | }
|
|
0 commit comments