Skip to content

Commit d94af9c

Browse files
committed
refactor(material/core): run sass module migration
1 parent 84f273f commit d94af9c

File tree

342 files changed

+6353
-4808
lines changed

Some content is hidden

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

342 files changed

+6353
-4808
lines changed

src/cdk/a11y/_a11y.import.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
@forward 'a11y';
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: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
@forward 'overlay';
1+
@forward '../a11y/a11y' as cdk-*;
2+
@forward 'overlay' hide $dark-backdrop-background, $z-index-overlay, $z-index-overlay-backdrop,
3+
$z-index-overlay-container, overlay;
4+
@forward 'overlay' as cdk-* hide $cdk-backdrop-animation-duration,
5+
$cdk-backdrop-animation-timing-function, $cdk-dark-backdrop-background;
6+
@forward 'overlay' as cdk-overlay-* hide $cdk-overlay-backdrop-animation-duration,
7+
$cdk-overlay-backdrop-animation-timing-function, $cdk-overlay-z-index-overlay,
8+
$cdk-overlay-z-index-overlay-backdrop, $cdk-overlay-z-index-overlay-container, cdk-overlay-overlay;
9+
10+
@import '../a11y/a11y';

src/cdk/overlay/_overlay.scss

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

33
// We want overlays to always appear over user content, so set a baseline
44
// very high z-index for the overlay container, which is where we create the new
55
// stacking context for all overlays.
6-
$cdk-z-index-overlay-container: 1000 !default;
7-
$cdk-z-index-overlay: 1000 !default;
8-
$cdk-z-index-overlay-backdrop: 1000 !default;
6+
$z-index-overlay-container: 1000 !default;
7+
$z-index-overlay: 1000 !default;
8+
$z-index-overlay-backdrop: 1000 !default;
99

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

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

1717

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

3535
&:empty {
3636
// Hide the element when it doesn't have any child nodes. This doesn't
@@ -46,7 +46,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
4646
.cdk-global-overlay-wrapper {
4747
display: flex;
4848
position: absolute;
49-
z-index: $cdk-z-index-overlay;
49+
z-index: $z-index-overlay;
5050
}
5151

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

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

76-
z-index: $cdk-z-index-overlay-backdrop;
76+
z-index: $z-index-overlay-backdrop;
7777
pointer-events: auto;
7878
-webkit-tap-highlight-color: transparent;
7979
transition: opacity $backdrop-animation-duration $backdrop-animation-timing-function;
@@ -86,14 +86,14 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
8686
// to making it opaque using `opacity`. Note that we can't use the `cdk-high-contrast`
8787
// mixin, because we can't normalize the import path to the _a11y.scss both for the
8888
// source and when this file is distributed. See #10908.
89-
@include cdk-high-contrast(active, off) {
89+
@include a11y.high-contrast(active, off) {
9090
opacity: 0.6;
9191
}
9292
}
9393
}
9494

9595
.cdk-overlay-dark-backdrop {
96-
background: $cdk-overlay-dark-backdrop-background;
96+
background: $dark-backdrop-background;
9797
}
9898

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

115115
// We use `display: flex` on this element exclusively for centering connected overlays.
116116
// 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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
@forward 'text-field';
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,
3+
cdk-textarea-autosize-measuring-base;
4+
@forward 'text-field' as cdk-text-field-* hide cdk-text-field-text-field,
5+
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)