Skip to content

Add a prefix comment for M2 Sass APIs to allow transformations to occur internally #6991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ limitations under the License.
@use '@angular/material' as mat;

@mixin debugger-op-type {
background-color: mat.get-color-from-palette(mat.$blue-grey-palette, 50);
background-color: /*m2*/ mat.get-color-from-palette(
/*m2$*/ mat.$blue-grey-palette,
50
);
@include tb-theme-foreground-prop(border, border, 1px solid);
border-radius: 4px;
font-family: 'Roboto Mono', monospace;
Expand All @@ -26,13 +29,19 @@ limitations under the License.
width: max-content;

@include tb-dark-theme {
background-color: mat.get-color-from-palette(mat.$blue-grey-palette, 700);
background-color: /*m2*/ mat.get-color-from-palette(
/*m2$*/ mat.$blue-grey-palette,
700
);
}
}

@mixin debugger-highlight-background {
background-color: #fff099;
@include tb-dark-theme {
background-color: mat.get-color-from-palette(mat.$orange-palette, 900);
background-color: /*m2*/ mat.get-color-from-palette(
/*m2$*/ mat.$orange-palette,
900
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ limitations under the License.
}

.focus-execution-container {
background-color: mat.get-color-from-palette(mat.$orange-palette, 200);
background-color: /*m2*/ mat.get-color-from-palette(
/*m2$*/ mat.$orange-palette,
200
);
border-radius: 4px;
font-size: 12px;
height: 120px;
padding: 5px;
width: 360px;

@include tb-dark-theme {
background-color: mat.get-color-from-palette(mat.$orange-palette, 900);
background-color: /*m2*/ mat.get-color-from-palette(
/*m2$*/ mat.$orange-palette,
900
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ limitations under the License.
padding: 2px 6px;
text-align: right;
width: 200px;
$grey-600: /*m2*/ mat.get-color-from-palette(mat.$gray-palette, 600);
@include tb-dark-theme {
box-shadow: 1px 3px mat.get-color-from-palette(mat.$gray-palette, 600);
box-shadow: 1px 3px $grey-600;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ limitations under the License.

.message {
.warning {
color: mat.get-color-from-palette($tb-warn);
color: /*m2*/ mat.get-color-from-palette($tb-warn);
}
margin-bottom: 16px;
}

.note-1 {
color: mat.get-color-from-palette($tb-accent);
color: /*m2*/ mat.get-color-from-palette($tb-accent);
}

.scrolling-page {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ $_title-to-heading-gap: 12px;
}

:host ::ng-deep .mat-slider-min-value .mat-slider-thumb {
background-color: mat.get-color-from-palette($tb-primary);
background-color: /*m2*/ mat.get-color-from-palette($tb-primary);
}

:host ::ng-deep .hide-slider.mat-slider-horizontal .mat-slider-track-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,13 @@ $_data_table_initial_height: 100px;
align-items: center;

.expand-button {
color: mat.get-color-from-palette($tb-foreground, secondary-text);
color: /*m2*/ mat.get-color-from-palette($tb-foreground, secondary-text);

@include tb-dark-theme {
color: mat.get-color-from-palette($tb-dark-foreground, secondary-text);
color: /*m2*/ mat.get-color-from-palette(
$tb-dark-foreground,
secondary-text
);
background-color: map-get($tb-dark-background, background);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ limitations under the License.
@import 'tensorboard/webapp/theme/tb_theme';

:host {
color: mat.get-color-from-palette(
map-get(mat.get-color-config($tb-theme), warn),
color: /*m2*/ mat.get-color-from-palette(
map-get(/*m2*/ mat.get-color-config($tb-theme), warn),
700
);
height: 1em;
line-height: 0;
display: inline-flex;

@include tb-dark-theme {
color: mat.get-color-from-palette(
map-get(mat.get-color-config($tb-dark-theme), warn),
color: /*m2*/ mat.get-color-from-palette(
map-get(/*m2*/ mat.get-color-config($tb-dark-theme), warn),
700
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tb-filter-input {
@include tb-theme-foreground-prop(color, text);

&:not(.valid) {
$_error-color: mat.get-color-from-palette($tb-warn, 800);
$_error-color: /*m2*/ mat.get-color-from-palette($tb-warn, 800);

color: $_error-color;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ mat-button-toggle-group.filter-view {
.main,
.sidebar {
contain: strict;
background-color: mat.get-color-from-palette($tb-background, background);
background-color: /*m2*/ mat.get-color-from-palette(
$tb-background,
background
);
overflow-x: hidden;
overflow-y: auto;
will-change: transform, scroll-position;
Expand All @@ -97,7 +100,7 @@ mat-button-toggle-group.filter-view {
}

.main {
background-color: mat.get-color-from-palette($tf-slate, 200);
background-color: /*m2*/ mat.get-color-from-palette($tf-slate, 200);
flex: 1 1;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -153,16 +156,19 @@ mat-button-toggle-group.filter-view {

/** TODO(psybuzz): consider making a tb-button instead. */
:host .settings-button {
color: mat.get-color-from-palette($tb-foreground, secondary-text);
color: /*m2*/ mat.get-color-from-palette($tb-foreground, secondary-text);
display: inline-flex;

@include tb-dark-theme {
color: mat.get-color-from-palette($tb-dark-foreground, secondary-text);
color: /*m2*/ mat.get-color-from-palette(
$tb-dark-foreground,
secondary-text
);
}

&.checked {
@include tb-theme-background-prop(background-color, selected-button);
border-color: mat.get-color-from-palette(mat.$gray-palette, 300);
border-color: /*m2*/ mat.get-color-from-palette(mat.$gray-palette, 300);
}

::ng-deep .mat-button-wrapper {
Expand All @@ -176,7 +182,10 @@ mat-button-toggle-group.filter-view {
}

.slide-out-menu {
background-color: mat.get-color-from-palette($tb-background, background);
background-color: /*m2*/ mat.get-color-from-palette(
$tb-background,
background
);
// Make the menu the full height minus the size of the toolbar.
height: calc(100% - 49px);
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mat-icon {

.new-card-pinned {
animation: pinned-view-fade-out 3s linear;
background: mat.get-color-from-palette(mat.$red-palette, 500);
background: /*m2*/ mat.get-color-from-palette(mat.$red-palette, 500);
border-radius: 5px;
color: #fff;
display: inline-block;
Expand Down
18 changes: 13 additions & 5 deletions tensorboard/webapp/metrics/views/metrics_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ limitations under the License.

.notice {
background-color: rgba(
mat.get-color-from-palette(mat.$yellow-palette, 200),
/*m2*/ mat.get-color-from-palette(mat.$yellow-palette, 200),
0.85
);
border-bottom: 1px solid mat.get-color-from-palette(mat.$yellow-palette, 500);
$yellow-500: /*m2*/ mat.get-color-from-palette(mat.$yellow-palette, 500);
border-bottom: 1px solid $yellow-500;
color: map-get($tb-foreground, text);
display: block;
flex: 0 0;
Expand All @@ -41,14 +42,21 @@ tb-dashboard-layout {
}

nav {
background-color: mat.get-color-from-palette($tb-background, background);
border-right: 1px solid mat.get-color-from-palette($tb-foreground, border);
background-color: /*m2*/ mat.get-color-from-palette(
$tb-background,
background
);
$border: /*m2*/ mat.get-color-from-palette($tb-foreground, border);
border-right: 1px solid $border;
flex: none;
width: 340px;

@include tb-dark-theme {
background-color: map-get($tb-dark-background, background);
border-right-color: mat.get-color-from-palette($tb-dark-foreground, border);
border-right-color: /*m2*/ mat.get-color-from-palette(
$tb-dark-foreground,
border
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
@use '@angular/material' as mat;
@import 'tensorboard/webapp/theme/tb_theme';

$_accent: map-get(mat.get-color-config($tb-theme), accent);
$_accent: map-get(/*m2*/ mat.get-color-config($tb-theme), accent);

:host ::ng-deep .mat-tab-label {
min-width: 0;
Expand All @@ -39,15 +39,15 @@ $_accent: map-get(mat.get-color-config($tb-theme), accent);
}

.highlighted {
background-color: mat.get-color-from-palette(mat.$gray-palette, 200);
background-color: /*m2*/ mat.get-color-from-palette(mat.$gray-palette, 200);
}

.highlight-bottom {
border-bottom: 2px solid mat.get-color-from-palette($_accent);
border-bottom: 2px solid /*m2*/ mat.get-color-from-palette($_accent);
}

.highlight-top {
border-top: 2px solid mat.get-color-from-palette($_accent);
border-top: 2px solid /*m2*/ mat.get-color-from-palette($_accent);
}

.footer {
Expand All @@ -60,19 +60,26 @@ $_accent: map-get(mat.get-color-config($tb-theme), accent);
align-items: center;
justify-content: flex-end;
padding: 4px;
border-top: 1px solid mat.get-color-from-palette($tb-foreground, border);
$border: /*m2*/ mat.get-color-from-palette($tb-foreground, border);
border-top: 1px solid $border;

@include tb-dark-theme {
border-color: mat.get-color-from-palette($tb-dark-foreground, border);
border-color: /*m2*/ mat.get-color-from-palette(
$tb-dark-foreground,
border
);
}
}

.close-button {
color: mat.get-color-from-palette($tb-foreground, secondary-text);
color: /*m2*/ mat.get-color-from-palette($tb-foreground, secondary-text);
width: 84px;

@include tb-dark-theme {
color: mat.get-color-from-palette($tb-dark-foreground, secondary-text);
color: /*m2*/ mat.get-color-from-palette(
$tb-dark-foreground,
secondary-text
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ section .control-row:not(:has(+ .control-row > mat-checkbox)):not(:last-child) {

.slider-input {
background-color: inherit;
border: 1px solid mat.get-color-from-palette($tf-slate, 500);
border: 1px solid /*m2*/ mat.get-color-from-palette($tf-slate, 500);
border-radius: 2px;
box-sizing: border-box;
color: inherit;
Expand All @@ -67,7 +67,7 @@ section .control-row:not(:has(+ .control-row > mat-checkbox)):not(:last-child) {
padding: 0 4px;

@include tb-dark-theme {
border-color: mat.get-color-from-palette($tf-slate, 700);
border-color: /*m2*/ mat.get-color-from-palette($tf-slate, 700);
}
}
}
Expand Down Expand Up @@ -127,9 +127,15 @@ mat-slider {
align-items: center;
}
&.toggle-opened {
background-color: mat.get-color-from-palette(mat.$grey-palette, 200);
background-color: /*m2*/ mat.get-color-from-palette(
/*m2$*/ mat.$grey-palette,
200
);
@include tb-dark-theme {
background-color: mat.get-color-from-palette(mat.$grey-palette, 800);
background-color: /*m2*/ mat.get-color-from-palette(
/*m2$*/ mat.$grey-palette,
800
);
}
}
mat-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ limitations under the License.

.red-dot {
$_dim: 10px;
background-color: mat.get-color-from-palette(mat.$red-palette, 700);
background-color: /*m2*/ mat.get-color-from-palette(mat.$red-palette, 700);
border-radius: $_dim * 0.5;
height: $_dim;
position: absolute;
Expand Down Expand Up @@ -52,7 +52,7 @@ limitations under the License.
}

.category-icon {
color: mat.get-color-from-palette(mat.$blue-palette, 700);
color: /*m2*/ mat.get-color-from-palette(mat.$blue-palette, 700);
height: 15px;
margin-right: 6px;
vertical-align: middle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $_circle-size: 20px;

.run-color-swatch {
border-radius: 100%;
border: 1px solid mat.get-color-from-palette($tb-foreground, border);
border: 1px solid /*m2*/ mat.get-color-from-palette($tb-foreground, border);
height: $_circle-size;
width: $_circle-size;
outline: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
font-size: 16px;

.label {
color: mat.get-color-from-palette($tb-foreground, secondary-text);
color: /*m2*/ mat.get-color-from-palette($tb-foreground, secondary-text);
font-size: 0.9em;
margin: 10px 0;
padding: 0 16px;
Expand Down
Loading