@@ -23,17 +23,39 @@ limitations under the License.
23
23
overflow : hidden ;
24
24
}
25
25
26
- mat-form-field {
27
- flex : 0 0 ;
28
- /* visually center align with _text_ of the select to the center. */
29
- margin-top : 5px ;
30
- /* default width is 180px */
31
- width : 130px ;
26
+ :host mat-form-field ::ng-deep {
27
+ // Default width is calculated by the contents of the longest value in the
28
+ // select. We override both the trigger and panel widths to be a bit shorter
29
+ // than what we see in practice.
30
+ // TODO: In Angular 16+ use the panelWidth attribute to set the width of the
31
+ // panel to be different than the trigger. (We would likely want the
32
+ // trigger to be shorter and the panel to be longer).
33
+ width : 144px ;
34
+
35
+ .mdc-text-field {
36
+ @include tb-theme-background-prop (background-color , app- bar);
37
+ // Default padding is "0 16px".
38
+ padding : 0 4px ;
39
+ }
40
+
41
+ label .mdc-floating-label.mat-mdc-floating-label ,
42
+ .mat-mdc-select ,
43
+ .mat-mdc-select-value ,
44
+ .mat-mdc-select-arrow {
45
+ // Inherit from `color` on the toolbar.
46
+ color : inherit ;
47
+ }
48
+
49
+ .mdc-text-field--filled :not (.mdc-text-field--disabled ) .mdc-line-ripple ::before {
50
+ // Inherit from `border-color` on the toolbar.
51
+ border-color : inherit ;
52
+ }
32
53
}
33
54
34
55
mat-label ,
35
56
mat-select ,
36
57
mat-option {
58
+ font-size : 14px ;
37
59
font-weight : 500 ;
38
60
text-transform : uppercase ;
39
61
}
@@ -53,83 +75,64 @@ mat-option {
53
75
width : 100% ;
54
76
}
55
77
56
- // TODO(tensorboard-team): Can probably remove after migrating away from Legacy Material components.
57
- // These styles exist in `mat-toolbar` already, but the combination of the
58
- // dark theme selector being `body.dark-theme` and the legacy select component
59
- // being used causes the styles to be overwritten in a dark theme.
60
- :host ::ng-deep .mat-form-field.mat-form-field.mat-form-field {
61
- .mat-form-field-underline ,
62
- .mat-form-field-ripple ,
63
- & .mat-focused .mat-form-field-ripple {
64
- background-color : currentColor ;
65
- }
66
-
67
- .mat-select-value ,
68
- .mat-select-arrow ,
69
- & .mat-focused .mat-form-field-label ,
70
- & .mat-focused .mat-select-arrow {
71
- color : inherit ;
72
- }
73
- }
74
-
75
78
:host ::ng-deep .active-plugin-list {
76
79
// Override mat-tab styling. By default, mat-tab has the right styling but,
77
80
// here, we are using it under dark header background. Must invert the color.
78
81
79
- & .mat-primary .mat-tab-list .mat-ink-bar {
80
- background -color : currentColor ;
82
+ .mat-mdc-tab :not ( .mat-mdc- tab-disabled ) .mdc-tab-indicator__content--underline {
83
+ border -color : currentColor ;
81
84
}
82
85
83
- .mat-tab-label ,
84
- .mat-tab-link {
85
- // Inherit from `color` on the toolbar.
86
- color : inherit ;
87
- // default is .6 and it is too dark against dark background.
88
- opacity : 0.7 ;
86
+ .mat-mdc-tab :not (.mat-mdc-tab-disabled ) {
89
87
90
- & .mat-tab-label-active {
91
- opacity : 1 ;
88
+ .mdc-tab__text-label {
89
+ // Inherit from `color` on the toolbar.
90
+ color : inherit ;
91
+ // default is .6 and it is too dark against dark background.
92
+ opacity : 0.7 ;
92
93
}
93
- }
94
94
95
- .mat-tab-header-pagination-chevron {
96
- border-color : currentColor ;
95
+ & .mdc-tab--active .mdc-tab__text-label {
96
+ // Repeat color with more-specific selector to override dark-mode styling.
97
+ // Inherit from `color` on the toolbar.
98
+ color : inherit ;
99
+ opacity : 1 ;
100
+ }
97
101
}
98
102
99
- .mat-tab-header-pagination-disabled {
103
+ .mat-mdc- tab-header-pagination-disabled {
100
104
visibility : hidden ;
101
105
}
102
106
103
- .mat-tab-disabled {
107
+ .mat-mdc- tab-disabled {
104
108
display : none ;
105
109
}
106
110
107
- mat-tab-list ,
108
- .mat-tab-header ,
109
- .mat-tab-labels ,
110
- .mat-tab-label {
111
+ mat-mdc-tab-list ,
112
+ .mat-mdc-tab-header ,
113
+ .mat-mdc-tab-labels ,
114
+ // Extra-specific selector to override dark-mode styling.
115
+ .mat-mdc-tab-header .mat-mdc-tab ,
116
+ .mdc-tab__text-label {
111
117
height : 100% ;
112
118
}
113
119
114
- .mat-tab-label {
115
- min-width : 48px ; /* default is 160px which is too big for us */
120
+ .mat-mdc-tab {
121
+ letter-spacing : 0.25px ;
122
+ min-width : 48px ; /* default is 90px which is too big for us */
116
123
padding : 0 ; /* default is 24px */
117
124
text-transform : uppercase ;
118
125
}
119
126
120
- .mat-tab-label-content {
121
- height : 100% ;
122
- }
123
-
124
127
mat-tab-header {
125
- .mat-tab-list {
128
+ .mat-mdc- tab-list {
126
129
// 36px is the size of the chevron. Please see [1] for the reason.
127
130
padding : 0 36px ;
128
131
}
129
132
130
133
> {
131
134
:first-child ,
132
- .mat-tab-label-container ,
135
+ .mat-mdc- tab-label-container ,
133
136
:last-child {
134
137
// [1]: Reason for customizing the mat-tab-header.
135
138
//
@@ -150,16 +153,16 @@ mat-option {
150
153
}
151
154
152
155
:first-child ,
153
- .mat-tab-label-container {
156
+ .mat-mdc- tab-label-container {
154
157
left : 0 ;
155
158
}
156
159
157
160
:last-child ,
158
- .mat-tab-label-container {
161
+ .mat-mdc- tab-label-container {
159
162
right : 0 ;
160
163
}
161
164
162
- .mat-tab-header-pagination {
165
+ .mat-mdc- tab-header-pagination {
163
166
@include tb-theme-background-prop (background-color , app- bar);
164
167
}
165
168
}
0 commit comments