🚨(react) remove sass deprecation warnings
We used some global built-in methods that will be removed in the next major version of Sass so we decide to use the modern api right now to remove those warnings.
This commit is contained in:
committed by
Jean-Baptiste PENRATH
parent
1c1300b9ef
commit
afe05ec883
@@ -1,4 +1,5 @@
|
|||||||
@use "sass:math";
|
@use "sass:math";
|
||||||
|
@use "sass:meta";
|
||||||
|
|
||||||
@function strip-unit($number) {
|
@function strip-unit($number) {
|
||||||
// Divide $number by its own unit to get a unitless number.
|
// Divide $number by its own unit to get a unitless number.
|
||||||
@@ -6,7 +7,7 @@
|
|||||||
// while different unit between numerator and denominator would be kept.
|
// while different unit between numerator and denominator would be kept.
|
||||||
// More to read here https://sass-lang.com/documentation/modules/math#div.
|
// More to read here https://sass-lang.com/documentation/modules/math#div.
|
||||||
// i.e. 16px / 1px = 16
|
// i.e. 16px / 1px = 16
|
||||||
@if type-of($number) == 'number' and not unitless($number) {
|
@if meta.type-of($number) == 'number' and not math.is-unitless($number) {
|
||||||
@return math.div($number, ($number * 0 + 1));
|
@return math.div($number, ($number * 0 + 1));
|
||||||
}
|
}
|
||||||
@return $number;
|
@return $number;
|
||||||
|
|||||||
Reference in New Issue
Block a user