Skip to content

Commit b49c8ec

Browse files
committed
refactor(material/core): run sass module migration
1 parent c64ade8 commit b49c8ec

File tree

336 files changed

+5303
-4270
lines changed

Some content is hidden

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

336 files changed

+5303
-4270
lines changed

src/cdk/a11y/_a11y.import.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@forward 'a11y' hide a11y, high-contrast;
2+
@forward 'a11y' as cdk-* hide cdk-optionally-nest-content;

src/cdk/a11y/_a11y.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@mixin cdk-a11y {
1+
@mixin a11y {
22
.cdk-visually-hidden {
33
border: 0;
44
clip: rect(0 0 0 0);
@@ -42,7 +42,7 @@
4242
/// * `on` - works for `Emulated`, `Native`, and `ShadowDom`
4343
/// * `off` - works for `None`
4444
/// * `any` - works for all encapsulation modes by emitting the CSS twice (default).
45-
@mixin cdk-high-contrast($target: active, $encapsulation: 'any') {
45+
@mixin high-contrast($target: active, $encapsulation: 'any') {
4646
@if ($target != 'active' and $target != 'black-on-white' and $target != 'white-on-black') {
4747
@error 'Unknown cdk-high-contrast value "#{$target}" provided. ' +
4848
'Allowed values are "active", "black-on-white", and "white-on-black"';

src/cdk/a11y/a11y-prebuilt.scss

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

3-
@include cdk-a11y();
3+
@include a11y.a11y();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@forward 'overlay' hide $dark-backdrop-background, $z-index-overlay, $z-index-overlay-backdrop, $z-index-overlay-container, overlay;
2+
@forward 'overlay' as cdk-* hide $cdk-backdrop-animation-duration, $cdk-backdrop-animation-timing-function, $cdk-dark-backdrop-background;
3+
@forward 'overlay' as cdk-overlay-* hide $cdk-overlay-backdrop-animation-duration, $cdk-overlay-backdrop-animation-timing-function, $cdk-overlay-z-index-overlay, $cdk-overlay-z-index-overlay-backdrop, $cdk-overlay-z-index-overlay-container, cdk-overlay-overlay;

src/cdk/overlay/_overlay.scss

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// We want overlays to always appear over user content, so set a baseline
22
// very high z-index for the overlay container, which is where we create the new
33
// stacking context for all overlays.
4-
$cdk-z-index-overlay-container: 1000 !default;
5-
$cdk-z-index-overlay: 1000 !default;
6-
$cdk-z-index-overlay-backdrop: 1000 !default;
4+
$z-index-overlay-container: 1000 !default;
5+
$z-index-overlay: 1000 !default;
6+
$z-index-overlay-backdrop: 1000 !default;
77

88
// Background color for all of the backdrops
9-
$cdk-overlay-dark-backdrop-background: rgba(0, 0, 0, 0.32) !default;
9+
$dark-backdrop-background: rgba(0, 0, 0, 0.32) !default;
1010

1111
// Default backdrop animation is based on the Material Design swift-ease-out.
1212
$backdrop-animation-duration: 400ms !default;
1313
$backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
1414

1515

16-
@mixin cdk-overlay() {
16+
@mixin overlay() {
1717
.cdk-overlay-container, .cdk-global-overlay-wrapper {
1818
// Disable events from being captured on the overlay container.
1919
pointer-events: none;
@@ -28,7 +28,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
2828
// The overlay-container is an invisible element which contains all individual overlays.
2929
.cdk-overlay-container {
3030
position: fixed;
31-
z-index: $cdk-z-index-overlay-container;
31+
z-index: $z-index-overlay-container;
3232

3333
&:empty {
3434
// Hide the element when it doesn't have any child nodes. This doesn't
@@ -44,7 +44,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
4444
.cdk-global-overlay-wrapper {
4545
display: flex;
4646
position: absolute;
47-
z-index: $cdk-z-index-overlay;
47+
z-index: $z-index-overlay;
4848
}
4949

5050
// A single overlay pane.
@@ -54,7 +54,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
5454
position: absolute;
5555
pointer-events: auto;
5656
box-sizing: border-box;
57-
z-index: $cdk-z-index-overlay;
57+
z-index: $z-index-overlay;
5858

5959
// For connected-position overlays, we set `display: flex` in
6060
// order to force `max-width` and `max-height` to take effect.
@@ -71,7 +71,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
7171
left: 0;
7272
right: 0;
7373

74-
z-index: $cdk-z-index-overlay-backdrop;
74+
z-index: $z-index-overlay-backdrop;
7575
pointer-events: auto;
7676
-webkit-tap-highlight-color: transparent;
7777
transition: opacity $backdrop-animation-duration $backdrop-animation-timing-function;
@@ -91,7 +91,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
9191
}
9292

9393
.cdk-overlay-dark-backdrop {
94-
background: $cdk-overlay-dark-backdrop-background;
94+
background: $dark-backdrop-background;
9595
}
9696

9797
.cdk-overlay-transparent-backdrop {
@@ -108,7 +108,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
108108
// overlay element's size to fit within the viewport.
109109
.cdk-overlay-connected-position-bounding-box {
110110
position: absolute;
111-
z-index: $cdk-z-index-overlay;
111+
z-index: $z-index-overlay;
112112

113113
// We use `display: flex` on this element exclusively for centering connected overlays.
114114
// When *not* centering, a top/left/bottom/right will be set which overrides the normal
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@import './overlay';
1+
@use './overlay';
22

3-
@include cdk-overlay();
3+
@include overlay.overlay();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@forward 'text-field' hide $autofill-color-frame-count, autofill-color, text-field;
2+
@forward 'text-field' as cdk-* hide $cdk-autofill-color-frame-count, cdk-autofill-color, cdk-textarea-autosize-measuring-base;
3+
@forward 'text-field' as cdk-text-field-* hide cdk-text-field-text-field, cdk-text-field-textarea-autosize-measuring-base;

src/cdk/text-field/_text-field.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Core styles that enable monitoring autofill state of text fields.
2-
@mixin cdk-text-field {
2+
@mixin text-field {
33
// Keyframes that apply no styles, but allow us to monitor when an text field becomes autofilled
44
// by watching for the animation events that are fired when they start. Note: the /*!*/ comment is
55
// needed to prevent LibSass from stripping the keyframes out.
@@ -52,30 +52,30 @@
5252
}
5353

5454
// Used to generate UIDs for keyframes used to change the text field autofill styles.
55-
$cdk-text-field-autofill-color-frame-count: 0;
55+
$autofill-color-frame-count: 0;
5656

5757
// Mixin used to apply custom background and foreground colors to an autofilled text field.
5858
// Based on: https://stackoverflow.com/questions/2781549/
5959
// removing-input-background-colour-for-chrome-autocomplete#answer-37432260
60-
@mixin cdk-text-field-autofill-color($background, $foreground:'') {
61-
@keyframes cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} {
60+
@mixin autofill-color($background, $foreground:'') {
61+
@keyframes cdk-text-field-autofill-color-#{$autofill-color-frame-count} {
6262
to {
6363
background: $background;
6464
@if $foreground != '' { color: $foreground; }
6565
}
6666
}
6767

6868
&:-webkit-autofill {
69-
animation: cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} both;
69+
animation: cdk-text-field-autofill-color-#{$autofill-color-frame-count} both;
7070
}
7171

7272
&.cdk-text-field-autofill-monitored:-webkit-autofill {
7373
// Since Chrome 80 we need a 1ms delay for cdk-text-field-autofill-start, or the animationstart
7474
// event won't fire.
7575
animation: cdk-text-field-autofill-start 0s 1ms,
76-
cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} both;
76+
cdk-text-field-autofill-color-#{$autofill-color-frame-count} both;
7777
}
7878

79-
$cdk-text-field-autofill-color-frame-count:
80-
$cdk-text-field-autofill-color-frame-count + 1 !global;
79+
$autofill-color-frame-count:
80+
$autofill-color-frame-count + 1 !global;
8181
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@import 'text-field';
1+
@use 'text-field';
22

3-
@include cdk-text-field();
3+
@include text-field.text-field();

src/dev-app/datepicker/datepicker-demo.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../material/datepicker/datepicker-theme';
1+
@use '../../material/datepicker/datepicker-theme';
22

33
mat-calendar {
44
width: 300px;
@@ -9,5 +9,5 @@ mat-calendar {
99
}
1010

1111
.demo-custom-range {
12-
@include mat-date-range-colors(hotpink, teal, yellow, purple);
12+
@include datepicker-theme.date-range-colors(hotpink, teal, yellow, purple);
1313
}

0 commit comments

Comments
 (0)