Skip to content

Commit 6be817c

Browse files
authored
Migrate to the Sass module system (#7142)
## Motivation for features / changes `@import` is deprecated in Sass and will be removed from the language in Dart Sass 3.0.0. ## Technical description of changes `@import` rules in Sass code migrated to equivalent `@use` rules using the [Sass migrator](https://sass-lang.com/documentation/cli/migrator/), with namespaces added for any variables/mixins from dependencies. Calls to the global `map-get` and `map-merge` functions have been replaced with the `map.get` and `map.merge` functions in the `sass:map` built-in module, with the `@use` rule added as necessary. ## Screenshots of UI changes (or N/A) N/A, this is a no-op change. ## Detailed steps to verify changes work correctly (as executed by you) This is part of an internal LSC. I don't have the context of how this code is actually used or the bandwidth to set up a full development environment to test, but the migration is straightforward enough that I'm fairly confident your CI would catch anything if it broke. See the internal bug I'm filing for more information and alternatives if this isn't something you're comfortable merging at this time. ## Alternate designs / implementations considered (or N/A) N/A
1 parent 70b76c9 commit 6be817c

58 files changed

Lines changed: 416 additions & 311 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/debugger_component.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
15-
@import 'tensorboard/webapp/theme/tb_theme';
15+
@use 'tensorboard/webapp/theme/tb_theme';
1616

1717
.bottom-section {
1818
box-sizing: border-box;
19-
@include tb-theme-foreground-prop(border-top, border, 1px solid);
19+
@include tb_theme.tb-theme-foreground-prop(border-top, border, 1px solid);
2020
display: flex;
2121
flex-grow: 1;
2222
height: 34%;
@@ -38,7 +38,7 @@ limitations under the License.
3838
}
3939

4040
tf-debugger-v2-alerts {
41-
@include tb-theme-foreground-prop(border-right, border, 1px solid);
41+
@include tb_theme.tb-theme-foreground-prop(border-right, border, 1px solid);
4242
display: inline-block;
4343
margin-right: 10px;
4444
min-width: 160px;
@@ -77,7 +77,7 @@ tf-debugger-v2-timeline {
7777
}
7878

7979
tf-debugger-v2-graph {
80-
@include tb-theme-foreground-prop(border-top, border, 1px solid);
80+
@include tb_theme.tb-theme-foreground-prop(border-top, border, 1px solid);
8181
display: block;
8282
margin-top: 5px;
8383
}

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/common/BUILD

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ licenses(["notice"])
77
sass_library(
88
name = "style_lib",
99
srcs = ["_lib.scss"],
10-
deps = ["//tensorboard/webapp/angular_components:material_sass"],
10+
deps = [
11+
"//tensorboard/webapp/angular_components:material_sass",
12+
"//tensorboard/webapp/theme",
13+
],
1114
)

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/common/_lib.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515
@use '@angular/material' as mat;
16+
@use 'tensorboard/webapp/theme/tb_theme';
1617

1718
@mixin debugger-op-type {
1819
background-color: mat.m2-get-color-from-palette(
1920
mat.$m2-blue-grey-palette,
2021
50
2122
);
22-
@include tb-theme-foreground-prop(border, border, 1px solid);
23+
@include tb_theme.tb-theme-foreground-prop(border, border, 1px solid);
2324
border-radius: 4px;
2425
font-family: 'Roboto Mono', monospace;
2526
font-size: 10px;
@@ -28,7 +29,7 @@ limitations under the License.
2829
padding: 1px 3px;
2930
width: max-content;
3031

31-
@include tb-dark-theme {
32+
@include tb_theme.tb-dark-theme {
3233
background-color: mat.m2-get-color-from-palette(
3334
mat.$m2-blue-grey-palette,
3435
700
@@ -39,7 +40,7 @@ limitations under the License.
3940
@mixin debugger-highlight-background {
4041
background-color: #fff099;
4142

42-
@include tb-dark-theme {
43+
@include tb_theme.tb-dark-theme {
4344
background-color: mat.m2-get-color-from-palette(
4445
mat.$m2-orange-palette,
4546
900

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/execution_data/execution_data_component.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515
@use '@angular/material' as mat;
16-
@import 'tensorboard/webapp/theme/tb_theme';
16+
@use 'tensorboard/webapp/theme/tb_theme';
1717

1818
.debug-tensor-values-table {
1919
width: 100%;
@@ -52,7 +52,7 @@ limitations under the License.
5252
padding: 5px;
5353
width: 360px;
5454

55-
@include tb-dark-theme {
55+
@include tb_theme.tb-dark-theme {
5656
background-color: mat.m2-get-color-from-palette(
5757
mat.$m2-orange-palette,
5858
900
@@ -67,7 +67,7 @@ limitations under the License.
6767
}
6868

6969
.output-slot-container {
70-
@include tb-theme-foreground-prop(border-top, border, 1px solid);
70+
@include tb_theme.tb-theme-foreground-prop(border-top, border, 1px solid);
7171
margin-top: 5px;
7272
padding: 2px 0;
7373
vertical-align: top;

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/graph/graph_component.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
15-
@import 'tensorboard/webapp/theme/tb_theme';
16-
@import '../common/lib';
15+
@use 'tensorboard/webapp/theme/tb_theme';
16+
@use '../common/lib';
1717

1818
:host {
1919
overflow-y: auto;
@@ -52,7 +52,7 @@ limitations under the License.
5252
}
5353

5454
.input-slot-header {
55-
@include debugger-highlight-background;
55+
@include lib.debugger-highlight-background;
5656

5757
margin-bottom: 5px;
5858
}

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/graph/graph_op_component.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515
@use '@angular/material' as mat;
16-
@import 'tensorboard/webapp/theme/tb_theme';
17-
@import '../common/lib';
16+
@use 'tensorboard/webapp/theme/tb_theme';
17+
@use '../common/lib';
1818

1919
.op-container,
2020
.op-name {
@@ -23,7 +23,7 @@ limitations under the License.
2323
}
2424

2525
.op-container {
26-
@include tb-theme-foreground-prop(border, border, 2px solid);
26+
@include tb_theme.tb-theme-foreground-prop(border, border, 2px solid);
2727
border-radius: 4px;
2828
box-shadow: 1px 3px #eee;
2929
cursor: pointer;
@@ -33,7 +33,7 @@ limitations under the License.
3333
width: 200px;
3434
$grey-600: mat.m2-get-color-from-palette(mat.$m2-grey-palette, 600);
3535

36-
@include tb-dark-theme {
36+
@include tb_theme.tb-dark-theme {
3737
box-shadow: 1px 3px $grey-600;
3838
}
3939
}
@@ -66,7 +66,7 @@ limitations under the License.
6666
}
6767

6868
.op-type {
69-
@include debugger-op-type;
69+
@include lib.debugger-op-type;
7070
display: inline-block;
7171
margin-top: 3px;
7272
}
@@ -77,5 +77,5 @@ limitations under the License.
7777
}
7878

7979
.slot {
80-
@include tb-theme-foreground-prop(color, secondary-text);
80+
@include tb_theme.tb-theme-foreground-prop(color, secondary-text);
8181
}

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/graph_executions/graph_executions_component.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
15-
@import 'tensorboard/webapp/theme/tb_theme';
16-
@import '../common/lib';
15+
@use 'tensorboard/webapp/theme/tb_theme';
16+
@use '../common/lib';
1717

1818
.graph-executions-container {
19-
@include tb-theme-foreground-prop(border-left, border, 1px solid);
19+
@include tb_theme.tb-theme-foreground-prop(border-left, border, 1px solid);
2020
display: flex;
2121
flex-direction: column;
2222
height: 100%;
@@ -29,7 +29,7 @@ limitations under the License.
2929
}
3030

3131
.graph-execution-index {
32-
@include tb-theme-foreground-prop(color, secondary-text);
32+
@include tb_theme.tb-theme-foreground-prop(color, secondary-text);
3333
display: inline-block;
3434
padding-right: 4px;
3535
text-align: right;
@@ -49,15 +49,15 @@ limitations under the License.
4949
}
5050

5151
.input-of-focus {
52-
@include debugger-highlight-background;
52+
@include lib.debugger-highlight-background;
5353
}
5454

5555
.loading-spinner {
5656
display: inline-block;
5757
}
5858

5959
.op-type {
60-
@include debugger-op-type;
60+
@include lib.debugger-op-type;
6161
direction: rtl;
6262
display: block;
6363
}
@@ -67,7 +67,7 @@ limitations under the License.
6767
}
6868

6969
.tensor-item {
70-
@include tb-theme-foreground-prop(border-bottom, border, 1px solid);
70+
@include tb_theme.tb-theme-foreground-prop(border-bottom, border, 1px solid);
7171
display: flex;
7272
flex-wrap: nowrap;
7373
height: 38px;

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/source_files/source_files_component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
15-
@import 'tensorboard/webapp/theme/tb_theme';
15+
@use 'tensorboard/webapp/theme/tb_theme';
1616

1717
.header-section {
18-
@include tb-theme-foreground-prop(border-bottom, border, 1px solid);
18+
@include tb_theme.tb-theme-foreground-prop(border-bottom, border, 1px solid);
1919
display: flex;
2020
height: 24px;
2121
padding-bottom: 6px;

tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/stack_trace/stack_trace_component.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
15-
@import 'tensorboard/webapp/theme/tb_theme';
16-
@import '../common/lib';
15+
@use 'tensorboard/webapp/theme/tb_theme';
16+
@use '../common/lib';
1717

1818
.focused-file {
1919
font-weight: bold;
@@ -32,7 +32,7 @@ limitations under the License.
3232
}
3333

3434
.op-type {
35-
@include debugger-op-type;
35+
@include lib.debugger-op-type;
3636
}
3737

3838
.stack-frame-array {
@@ -81,7 +81,7 @@ limitations under the License.
8181
}
8282

8383
.stack-trace-container {
84-
@include tb-theme-foreground-prop(border-left, border, 1px solid);
84+
@include tb_theme.tb-theme-foreground-prop(border-left, border, 1px solid);
8585
box-sizing: border-box;
8686
display: flex;
8787
flex-flow: column;

tensorboard/webapp/app_container.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
15-
@import 'tensorboard/webapp/theme/tb_theme';
15+
@use 'tensorboard/webapp/theme/tb_theme';
1616

1717
html,
1818
body {
@@ -34,7 +34,7 @@ app-header {
3434
flex: 0 0;
3535
z-index: 1; /* The box shadow needs to extend out of the app-header. */
3636

37-
@include tb-dark-theme {
37+
@include tb_theme.tb-dark-theme {
3838
box-shadow: 0 1px 3px 3px rgba(#fff, 0.1);
3939
}
4040
}

0 commit comments

Comments
 (0)