Skip to content

Commit d8c3f12

Browse files
committed
fix(sass): use math.div instead of division since it's deprecated
1 parent 126fb5a commit d8c3f12

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

packages/app-bar/src/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $rmd-app-bar-keyline: 1rem !default;
4848
/// @require $rmd-button-icon-size
4949
/// @type Number
5050
$rmd-app-bar-nav-margin: $rmd-app-bar-keyline -
51-
(($rmd-button-icon-size - $rmd-icon-size) / 2);
51+
(($rmd-button-icon-size - $rmd-icon-size) * 0.5);
5252

5353
/// The keyline for the `AppBarTitle` to use when used with the `AppBarNav` or
5454
/// the `offset` prop is enabled.

packages/form/src/toggle/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ $rmd-switch-container-vertical-padding: 0.5rem !default;
128128
/// enough so that the ball does not overlap the label or other elements.
129129
///
130130
/// @type Number
131-
$rmd-switch-container-horizontal-padding: $rmd-switch-ball-size / 2 !default;
131+
$rmd-switch-container-horizontal-padding: $rmd-switch-ball-size * 0.5 !default;
132132

133133
/// The color to use for the switch's ball when it is toggled on and disabled.
134134
///

packages/media/src/_mixins.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/// @group media
33
////
44

5+
@use "sass:math";
6+
57
@import '~@react-md/theme/dist/mixins';
68
@import '~@react-md/utils/dist/functions';
79
@import './variables';
@@ -25,7 +27,7 @@
2527
/// @param {Number} width - The width to enforce for the responsive media
2628
/// @param {Number} height - The height to enforce for the responsive media
2729
@mixin rmd-media-aspect-ratio($width, $height) {
28-
padding-bottom: percentage($height / $width);
30+
padding-bottom: percentage(math.div($height, $width));
2931
}
3032

3133
/// Creates the styles for a media container that should enforce a specific

packages/media/src/_variables.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/// @group media
33
////
44

5+
@use "sass:math";
6+
57
@import '~@react-md/theme/dist/color-palette';
68

79
/// The background color for a media overlay.
@@ -21,7 +23,7 @@ $rmd-media-selectors: (img '>svg' iframe video embed object) !default;
2123
/// enforced.
2224
///
2325
/// @type Number
24-
$rmd-media-default-aspect-ratio: percentage(9 / 16) !default;
26+
$rmd-media-default-aspect-ratio: percentage(math.div(9, 16)) !default;
2527

2628
/// A Map including the default aspect ratios to create for responsive media
2729
/// with a forced aspect ratio. Each key must be a string for a class name

packages/progress/src/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ $rmd-circular-progress-start-offset: $rmd-circular-progress-dasharray !default;
242242
/// The ending dashoffset for the ciruclar progress animation. This will be used
243243
/// for the `50%` value in the animation keyframes by default.
244244
/// @type Number
245-
$rmd-circular-progress-end-offset: $rmd-circular-progress-dasharray / 4 !default;
245+
$rmd-circular-progress-end-offset: $rmd-circular-progress-dasharray * 0.25 !default;
246246

247247
/// The circular progress styles to apply for the rotation transition. Each key
248248
/// in this map will be set immediately at the root of the `keyframes` and then

packages/theme/src/_color-a11y.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/// @group theme
33
////
44

5+
@use "sass:math";
6+
57
@import './color-palette';
68

79
/// This is the default contrast ratio to use for color accessibility between
@@ -190,8 +192,10 @@ $rmd-theme-linear-channel-values: (
190192
$back-luminance: rmd-theme-luminance($back) + 0.05;
191193
$front-luminance: rmd-theme-luminance($front) + 0.05;
192194

193-
@return max($back-luminance, $front-luminance) /
194-
min($back-luminance, $front-luminance);
195+
@return math.div(
196+
max($back-luminance, $front-luminance),
197+
min($back-luminance, $front-luminance)
198+
);
195199
}
196200

197201
/// Determines if a provided color is considered light or dark.

packages/typography/src/_variables.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/// @group typography
33
////
44

5+
@use "sass:math";
6+
57
/// Gets the global variable value for a provided typography style name. This
68
/// assumes that the global variable exists already.
79
///
@@ -76,7 +78,7 @@
7678
/// @param {Number} font-size - The font size to use
7779
/// @return {Number} the letter spacing value in em
7880
@function rmd-typography-get-letter-spacing($tracking, $font-size) {
79-
@return $tracking / ($font-size * 16) * 1em;
81+
@return math.div($tracking, $font-size * 16) * 1em;
8082
}
8183

8284
/// The font family to use throughout the entire application.

0 commit comments

Comments
 (0)