Skip to content

Commit d6ad97e

Browse files
authored
Bug Fix: Allow icons to be sized by both width and height (#6709)
## Motivation for features / changes During the mdc-migration I restyled all the buttons via #6608 and only recently noticed that the `mat-calendar` component (which is only used internally) looked pretty off... To resolve this I am allowing button widths and heights to be set separately then overriding them in the internal date picker component (Googlers see cl/601592566). ## Screenshots of UI changes (or N/A) Before - https://screenshot.googleplex.com/AKuAQqzf9g6K2GF After - https://screenshot.googleplex.com/7s6vm8SsajKg9v7
1 parent 4d7e337 commit d6ad97e

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

tensorboard/webapp/theme/_tb_theme.template.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ $tb-dark-theme: map_merge(
310310

311311
a,
312312
button.mat-mdc-button-base {
313-
--tb-icon-size: 24px;
313+
--tb-icon-width: 24px;
314+
--tb-icon-height: 24px;
314315
--mdc-text-button-label-text-tracking: normal;
315316
--mdc-filled-button-label-text-tracking: normal;
316317
--mdc-outlined-button-label-text-tracking: normal;
@@ -335,9 +336,9 @@ $tb-dark-theme: map_merge(
335336

336337
mat-icon.mat-icon,
337338
svg {
338-
width: var(--tb-icon-size);
339-
height: var(--tb-icon-size);
340-
line-height: var(--tb-icon-size);
339+
width: var(--tb-icon-size, var(--tb-icon-width));
340+
height: var(--tb-icon-size, var(--tb-icon-height));
341+
line-height: var(--tb-icon-size, var(--tb-icon-height));
341342
}
342343
}
343344
}

tensorboard/webapp/widgets/data_table/header_cell_component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ $_icon_padding: 4px;
5555
&.context-menu-container {
5656
width: $_icon_size + $_icon_padding;
5757
height: $_icon_size + $_icon_padding;
58-
--tb-icon-size: #{$_icon_size};
58+
--tb-icon-width: #{$_icon_size};
59+
--tb-icon-height: #{$_icon_size};
5960
border-radius: 5px;
6061
font-size: 12px;
6162
padding: $_icon_padding;

tensorboard/webapp/widgets/line_chart_v2/sub_view/line_chart_axis_view.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ text {
3434
width: 100%;
3535

3636
.extent-edit-button {
37-
--tb-icon-size: 16px;
37+
--tb-icon-width: 16px;
38+
--tb-icon-height: 16px;
3839
height: 24px;
3940
position: absolute;
4041
right: 5px;

0 commit comments

Comments
 (0)