Skip to content

Commit be5cc5c

Browse files
authored
MDCMigration: Style right pane dropdowns for MDC migration. (#6614)
This restyles the right-hand pane dropdowns. The end result is: 1. selection trigger looks mostly like current. 2. selection panel is styled similar to current but selection rendering is different and the panel is offset lower and slightly to the right. Here are some sample screenshots but please patch it in locally and give it a try: ![image](https://github.com/tensorflow/tensorboard/assets/17152369/9a03dbd2-36c2-4f82-aa0a-760dffdbb6f3) ![image](https://github.com/tensorflow/tensorboard/assets/17152369/8a7acd25-f099-4bd9-b6c2-180914d70262)
1 parent ad8114d commit be5cc5c

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

tensorboard/webapp/widgets/dropdown/dropdown_component.scss

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ mat-select {
2020
border-radius: 3px;
2121
box-sizing: border-box;
2222
padding: 6px;
23+
24+
// Default is 16px.
25+
font-size: 12px;
26+
// Default is 24px.
27+
line-height: normal;
28+
29+
::ng-deep .mat-mdc-select-arrow-wrapper {
30+
// Default is 24px.
31+
height: 12px;
32+
}
2333
}
2434

2535
mat-select:focus {
@@ -29,21 +39,15 @@ mat-select:focus {
2939
outline-style: auto;
3040
}
3141

32-
::ng-deep .mat-select-panel {
42+
::ng-deep .mat-mdc-select-panel {
3343
max-width: 70vw;
3444
}
3545

3646
// This selector needs relatively more specificity than Angular Material's
3747
// to override the fixed height.
38-
::ng-deep mat-option.mat-option {
39-
height: auto;
40-
}
41-
42-
::ng-deep .mat-option-text {
43-
white-space: normal;
44-
word-break: break-all;
45-
}
46-
47-
.option-content {
48-
white-space: nowrap;
48+
::ng-deep mat-option.mat-mdc-option {
49+
// Default is 48px.
50+
min-height: 32px;
51+
// Default is 16px.
52+
font-size: 12px;
4953
}

tensorboard/webapp/widgets/dropdown/dropdown_component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export interface DropdownOption {
3535
template: `
3636
<mat-select
3737
[value]="value"
38+
[hideSingleSelectionIndicator]="true"
3839
(selectionChange)="selectionChange.emit($event.value)"
3940
>
4041
<mat-option

0 commit comments

Comments
 (0)