Skip to content

Commit 28019d4

Browse files
committed
chore(styles): migrate foundation sass away from deprecated APIs
1 parent 0da679d commit 28019d4

11 files changed

Lines changed: 58 additions & 52 deletions

File tree

‎m3-foundation/assets/stylesheets/basics/layout.scss‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use 'sass:map';
2+
13
$m3-screen-medium: 600px;
24
$m3-screen-expanded: 840px;
35
$m3-screen-large: 1200px;
@@ -20,16 +22,16 @@ $screen-max: (
2022
);
2123

2224
@function get-screen-min ($keyOrValue) {
23-
@if map-has-key($screen-min, $keyOrValue) {
24-
@return map-get($screen-min, $keyOrValue);
25+
@if map.has-key($screen-min, $keyOrValue) {
26+
@return map.get($screen-min, $keyOrValue);
2527
} @else {
2628
@return $keyOrValue;
2729
}
2830
}
2931

3032
@function get-screen-max ($keyOrValue) {
31-
@if map-has-key($screen-max, $keyOrValue) {
32-
@return map-get($screen-max, $keyOrValue);
33+
@if map.has-key($screen-max, $keyOrValue) {
34+
@return map.get($screen-max, $keyOrValue);
3335
} @else {
3436
@return $keyOrValue;
3537
}

‎m3-foundation/assets/stylesheets/basics/motion.scss‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use 'sass:map';
2+
13
// Duration
24

35
// Short durations
@@ -50,8 +52,8 @@ $m3-sys-motion-duration-map: (
5052
);
5153

5254
@function duration($type) {
53-
@if map-has-key($m3-sys-motion-duration-map, $type) {
54-
@return map-get($m3-sys-motion-duration-map, $type);
55+
@if map.has-key($m3-sys-motion-duration-map, $type) {
56+
@return map.get($m3-sys-motion-duration-map, $type);
5557
} @else {
5658
@warn "Unknown duration `#{$type}`.";
5759
@return null;
@@ -80,8 +82,8 @@ $m3-sys-motion-easing-map: (
8082
);
8183

8284
@function easing($key) {
83-
@if map-has-key($m3-sys-motion-easing-map, $key) {
84-
@return map-get($m3-sys-motion-easing-map, $key);
85+
@if map.has-key($m3-sys-motion-easing-map, $key) {
86+
@return map.get($m3-sys-motion-easing-map, $key);
8587
} @else {
8688
@warn "Unknown key `#{$key}` in easing map.";
8789
@return null;
@@ -114,4 +116,4 @@ $m3-sys-motion-easing-map: (
114116

115117
@function timing-standard-decelerate($property, $duration: 'medium1') {
116118
@return #{$property} + ' ' + #{timing($duration, 'standard-decelerate')}
117-
}
119+
}

‎m3-foundation/assets/stylesheets/basics/shape.scss‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use 'sass:map';
2+
13
$m3-sys-shape-corner-extra-small: 4px;
24
$m3-sys-shape-corner-small: 8px;
35
$m3-sys-shape-corner-medium: 12px;
@@ -11,8 +13,8 @@ $m3-sys-shape-corner-map: (
1113
);
1214

1315
@function get-corner($keyOrValue) {
14-
@if map-has-key($m3-sys-shape-corner-map, $keyOrValue) {
15-
@return map-get($m3-sys-shape-corner-map, $keyOrValue);
16+
@if map.has-key($m3-sys-shape-corner-map, $keyOrValue) {
17+
@return map.get($m3-sys-shape-corner-map, $keyOrValue);
1618
} @else {
1719
@return $keyOrValue;
1820
}
@@ -62,4 +64,4 @@ $m3-sys-shape-corner-map: (
6264
*::after {
6365
box-sizing: border-box;
6466
}
65-
}
67+
}
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
@import 'badge';
2-
@import 'button';
3-
@import 'card';
4-
@import 'checkbox';
5-
@import 'dialog';
6-
@import 'fab-button';
7-
@import 'icon';
8-
@import 'icon-button';
9-
@import 'menu';
10-
@import 'navigation';
11-
@import 'plane-tooltip';
12-
@import 'popper';
13-
@import 'rich-tooltip';
14-
@import 'ripple';
15-
@import 'scrim';
16-
@import 'scroll-box';
17-
@import 'scroll-rail';
18-
@import 'select';
19-
@import 'side-sheet';
20-
@import 'slider';
21-
@import 'switch';
22-
@import 'text-field';
1+
@use 'badge';
2+
@use 'button';
3+
@use 'card';
4+
@use 'checkbox';
5+
@use 'dialog';
6+
@use 'fab-button';
7+
@use 'icon';
8+
@use 'icon-button';
9+
@use 'menu';
10+
@use 'navigation';
11+
@use 'plane-tooltip';
12+
@use 'popper';
13+
@use 'rich-tooltip';
14+
@use 'ripple';
15+
@use 'scrim';
16+
@use 'scroll-box';
17+
@use 'scroll-rail';
18+
@use 'select';
19+
@use 'side-sheet';
20+
@use 'slider';
21+
@use 'switch';
22+
@use 'text-field';

‎m3-foundation/assets/stylesheets/components/navigation/index.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@use '../../basics/shape' as m3-shape;
44
@use '../../basics/typography' as m3-typography;
55

6-
@import './variables';
6+
@use './variables' as *;
77

88
@mixin m3-navigation-drawer {
99
width: $m3-navigation-drawer-width;
@@ -372,4 +372,4 @@
372372
@include m3-layout.screen-from('large') {
373373
padding-left: $m3-navigation-drawer-width;
374374
}
375-
}
375+
}

‎m3-foundation/assets/stylesheets/components/scrim/index.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../../basics/palette";
1+
@use '../../basics/palette' as *;
22

33
.m3-scrim {
44
display: flex;
@@ -9,4 +9,4 @@
99
position: fixed;
1010
left: 0;
1111
top: 0;
12-
}
12+
}

‎m3-foundation/assets/stylesheets/components/text-field/index.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@use '../../basics/motion' as m3-motion;
22
@use '../../basics/typography' as m3-typography;
33

4-
@import './variables.scss';
4+
@use './variables' as *;
55

66
.m3-text-field {
77
display: inline-flex;
@@ -335,4 +335,4 @@
335335
@keyframes m3-text-field-outlined-label-slide-out {
336336
0% { transform: translate3d(0, -28px, 0); }
337337
100% { transform: translate3d(0, 0, 0); }
338-
}
338+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import 'animation';
2-
@import 'transitions';
3-
@import 'layout';
4-
@import 'themes';
5-
@import 'components';
1+
@use 'animation';
2+
@use 'transitions';
3+
@use 'layout';
4+
@use 'themes';
5+
@use 'components';

‎m3-foundation/assets/stylesheets/themes/dark.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../basics/palette";
1+
@use '../basics/palette' as *;
22

33
// Primary
44
$m3-sys-dark-primary: $m3-palette-primary-80;
@@ -94,4 +94,4 @@ $m3-elevation-dark-5: 0 4px 4px 0 rgba(0, 0, 0, 0.30), 0 8px 12px 6px rgba(0, 0,
9494
--m3-elevation-3: #{$m3-elevation-dark-3};
9595
--m3-elevation-4: #{$m3-elevation-dark-4};
9696
--m3-elevation-5: #{$m3-elevation-dark-5};
97-
}
97+
}

‎m3-foundation/assets/stylesheets/themes/index.scss‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import 'dark';
2-
@import 'light';
1+
@use 'dark' as *;
2+
@use 'light' as *;
33

44
:root {
55
@include m3-theme-light;
@@ -13,4 +13,4 @@
1313
.m3-theme-dark,
1414
.m3-theme-dark:root {
1515
@include m3-theme-dark;
16-
}
16+
}

0 commit comments

Comments
 (0)