Commit bbee3c4 1 parent 2db756a commit bbee3c4 Copy full SHA for bbee3c4
File tree 2 files changed +20
-0
lines changed
components/src/globals/scss
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ $base-font-size: 16px !default;
22
22
/// @group global-typography
23
23
/// @deprecated (For v10) Use `carbon--rem()`
24
24
@function rem ($px ) {
25
+ @if unit ($px ) != ' px' {
26
+ // TODO: update to @error in v11
27
+ @warn " Expected argument $px to be of type `px`, instead received: `#{unit ($px )} `" ;
28
+ }
29
+
25
30
@return ($px / $base-font-size ) * 1rem ;
26
31
}
27
32
@@ -33,6 +38,11 @@ $base-font-size: 16px !default;
33
38
/// @group global-typography
34
39
/// @deprecated (For v10) Use `carbon--em()`
35
40
@function em ($px ) {
41
+ @if unit ($px ) != ' px' {
42
+ // TODO: update to @error in v11
43
+ @warn " Expected argument $px to be of type `px`, instead received: `#{unit ($px )} `" ;
44
+ }
45
+
36
46
@return ($px / $base-font-size ) * 1em ;
37
47
}
38
48
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ $carbon--base-font-size: 16px !default;
17
17
/// @access public
18
18
/// @group @carbon/layout
19
19
@function carbon--rem ($px ) {
20
+ @if unit ($px ) != ' px' {
21
+ // TODO: update to @error in v11
22
+ @warn " Expected argument $px to be of type `px`, instead received: `#{unit ($px )} `" ;
23
+ }
24
+
20
25
@return ($px / $carbon--base-font-size ) * 1rem ;
21
26
}
22
27
@@ -26,5 +31,10 @@ $carbon--base-font-size: 16px !default;
26
31
/// @access public
27
32
/// @group @carbon/layout
28
33
@function carbon--em ($px ) {
34
+ @if unit ($px ) != ' px' {
35
+ // TODO: update to @error in v11
36
+ @warn " Expected argument $px to be of type `px`, instead received: `#{unit ($px )} `" ;
37
+ }
38
+
29
39
@return ($px / $carbon--base-font-size ) * 1em ;
30
40
}
You can’t perform that action at this time.
0 commit comments