Skip to content

Commit 5bf7b04

Browse files
devversionandrewseguin
authored andcommitted
refactor: switch "material" away from cross-package relative Sass imports
1 parent 6c999eb commit 5bf7b04

Some content is hidden

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

75 files changed

+251
-185
lines changed

src/material/BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ filegroup(
1919
srcs = ["//src/material/%s:overview" % name for name in MATERIAL_ENTRYPOINTS],
2020
)
2121

22-
# Makes the theming bundle available in the release output as `angular/material/theming`.
2322
sass_library(
24-
name = "theming_bundle",
23+
name = "sass_lib",
2524
srcs = [
2625
"_index.scss",
2726
"_theming.scss",
@@ -36,7 +35,7 @@ ng_package(
3635
"package.json",
3736
],
3837
data = [
39-
":theming_bundle",
38+
":sass_lib",
4039
"//src/material/core:theming_scss_lib",
4140
"//src/material/prebuilt-themes:deeppurple-amber",
4241
"//src/material/prebuilt-themes:indigo-pink",

src/material/_index.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@
1414
@forward './core/typography/typography-utils' show typography-level,
1515
font-size, line-height, font-weight, letter-spacing, font-family, font-shorthand;
1616

17+
// Private/Internal
18+
@forward './core/density/private/all-density' as private-* show private-all-component-densities;
19+
@forward './core/theming/theming' show private-check-duplicate-theme-styles,
20+
private-legacy-get-theme, private-is-theme-object;
21+
@forward './core/style/layout-common' as private-* show private-fill;
22+
@forward './core/style/private' show private-theme-elevation, private-animation-noop;
23+
@forward './core/style/vendor-prefixes' as private-* show private-user-select,
24+
private-position-sticky, private-color-adjust;
25+
@forward './core/theming/palette' as private-* show $private-dark-primary-text,
26+
$private-dark-disabled-text;
27+
@forward './core/style/variables' as private-* show $private-swift-ease-in-duration,
28+
$private-swift-ease-in-timing-function, $private-swift-ease-out-timing-function,
29+
$private-ease-in-out-curve-function, $private-swift-ease-out-duration, $private-xsmall;
30+
@forward './core/typography/typography' show private-typography-to-2014-config,
31+
private-typography-to-2018-config;
32+
@forward './table/table-flex-styles' show private-table-flex-styles;
33+
@forward './core/style/menu-common' as private-menu-common-*;
34+
@forward './core/style/button-common' as private-button-common-*;
35+
1736
// Structural
1837
@forward './core/core' show core;
1938
@forward './core/ripple/ripple' show ripple;

src/material/autocomplete/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ sass_binary(
4646
name = "autocomplete_scss",
4747
src = "autocomplete.scss",
4848
deps = [
49-
"//src/cdk/a11y:a11y_scss_lib",
49+
"//src/cdk:sass_lib",
5050
"//src/material/core:core_scss_lib",
5151
],
5252
)

src/material/autocomplete/autocomplete.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
@use '@angular/cdk';
2+
13
@use '../core/style/menu-common';
2-
@use '../../cdk/a11y';
34

45
// The max-height of the panel, currently matching mat-select value.
56
$panel-max-height: 256px !default;
@@ -36,7 +37,7 @@ $panel-border-radius: 4px !default;
3637
margin-top: -1px;
3738
}
3839

39-
@include a11y.high-contrast(active, off) {
40+
@include cdk.high-contrast(active, off) {
4041
outline: solid 1px;
4142
}
4243
}

src/material/badge/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sass_library(
3131
name = "badge_scss_lib",
3232
srcs = glob(["**/_*.scss"]),
3333
deps = [
34-
"//src/cdk/a11y:a11y_scss_lib",
34+
"//src/cdk:sass_lib",
3535
"//src/material/core:core_scss_lib",
3636
],
3737
)

src/material/badge/_badge-theme.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
@use 'sass:map';
66
@use 'sass:meta';
77
@use 'sass:math';
8+
@use '@angular/cdk';
9+
810
@use '../core/theming/theming';
911
@use '../core/typography/typography';
1012
@use '../core/typography/typography-utils';
11-
@use '../../cdk/a11y';
1213

1314
$font-size: 12px;
1415
$font-weight: 600;
@@ -166,7 +167,7 @@ $_badge-structure-emitted: false !default;
166167
color: theming.get-color-from-palette($primary, default-contrast);
167168
background: theming.get-color-from-palette($primary);
168169

169-
@include a11y.high-contrast(active, off) {
170+
@include cdk.high-contrast(active, off) {
170171
outline: solid 1px;
171172
border-radius: 0;
172173
}

src/material/bottom-sheet/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sass_library(
4545
sass_binary(
4646
name = "bottom_sheet_container_scss",
4747
src = "bottom-sheet-container.scss",
48-
deps = ["//src/cdk/a11y:a11y_scss_lib"],
48+
deps = ["//src/cdk:sass_lib"],
4949
)
5050

5151
ng_test_library(

src/material/bottom-sheet/bottom-sheet-container.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use '../../cdk/a11y';
1+
@use '@angular/cdk';
22

33
// The bottom sheet minimum width on larger screen sizes is based
44
// on increments of the toolbar, according to the spec. See:
@@ -17,7 +17,7 @@ $container-horizontal-padding: 16px !default;
1717
max-height: 80vh;
1818
overflow: auto;
1919

20-
@include a11y.high-contrast(active, off) {
20+
@include cdk.high-contrast(active, off) {
2121
outline: 1px solid;
2222
}
2323
}

src/material/button-toggle/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sass_binary(
4343
name = "button_toggle_scss",
4444
src = "button-toggle.scss",
4545
deps = [
46-
"//src/cdk/a11y:a11y_scss_lib",
46+
"//src/cdk:sass_lib",
4747
"//src/material/core:core_scss_lib",
4848
],
4949
)

src/material/button-toggle/button-toggle.scss

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
@use '@angular/cdk';
2+
13
@use '../core/style/vendor-prefixes';
24
@use '../core/style/layout-common';
3-
@use '../../cdk/a11y';
45

56
$standard-padding: 0 12px !default;
67
$standard-border-radius: 4px !default;
@@ -22,7 +23,7 @@ $legacy-border-radius: 2px !default;
2223
// Fixes the ripples not being clipped to the border radius on Safari.
2324
transform: translateZ(0);
2425

25-
@include a11y.high-contrast(active, off) {
26+
@include cdk.high-contrast(active, off) {
2627
outline: solid 1px;
2728
}
2829
}
@@ -31,7 +32,7 @@ $legacy-border-radius: 2px !default;
3132
.mat-button-toggle-group-appearance-standard {
3233
border-radius: $standard-border-radius;
3334

34-
@include a11y.high-contrast(active, off) {
35+
@include cdk.high-contrast(active, off) {
3536
outline: 0;
3637
}
3738
}
@@ -60,7 +61,7 @@ $legacy-border-radius: 2px !default;
6061
opacity: 1;
6162

6263
// In high contrast mode `opacity: 1` will show the overlay as solid so we fall back 0.5.
63-
@include a11y.high-contrast(active, off) {
64+
@include cdk.high-contrast(active, off) {
6465
opacity: 0.5;
6566
}
6667
}
@@ -80,7 +81,7 @@ $legacy-border-radius: 2px !default;
8081
&.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay {
8182
opacity: 0.12;
8283

83-
@include a11y.high-contrast(active, off) {
84+
@include cdk.high-contrast(active, off) {
8485
opacity: 0.5;
8586
}
8687
}
@@ -126,7 +127,7 @@ $legacy-border-radius: 2px !default;
126127
// Changing the background color for the selected item won't be visible in high contrast mode.
127128
// We fall back to using the overlay to draw a brighter, semi-transparent tint on top instead.
128129
// It uses a border, because the browser will render it using a brighter color.
129-
@include a11y.high-contrast(active, off) {
130+
@include cdk.high-contrast(active, off) {
130131
.mat-button-toggle-checked & {
131132
border-bottom: solid $legacy-height;
132133
opacity: 0.5;
@@ -135,7 +136,7 @@ $legacy-border-radius: 2px !default;
135136
}
136137
}
137138

138-
@include a11y.high-contrast(active, off) {
139+
@include cdk.high-contrast(active, off) {
139140
.mat-button-toggle-checked.mat-button-toggle-appearance-standard
140141
.mat-button-toggle-focus-overlay {
141142
// In high contrast mode, we use a border for the checked state because backgrounds

0 commit comments

Comments
 (0)