1
1
// stylelint-disable scss/dimension-no-non-numeric-values
2
2
@use " sass:math" ;
3
+ @use " sass:meta" ;
4
+ @use " sass:string" ;
3
5
4
6
// SCSS RFS mixin
5
7
//
@@ -31,7 +33,7 @@ $rfs-two-dimensional: false !default;
31
33
// Factor of decrease
32
34
$rfs-factor : 10 !default ;
33
35
34
- @if type-of ($rfs-factor ) != number or $rfs-factor <= 1 {
36
+ @if meta . type-of ($rfs-factor ) != number or $rfs-factor <= 1 {
35
37
@error " `#{$rfs-factor } ` is not a valid $rfs-factor, it must be greater than 1." ;
36
38
}
37
39
@@ -191,7 +193,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
191
193
// Helper function to get the formatted non-responsive value
192
194
@function rfs-value ($values ) {
193
195
// Convert to list
194
- $values : if (type-of ($values ) != list , ($values ,), $values );
196
+ $values : if (meta . type-of ($values ) != list , ($values ,), $values );
195
197
196
198
$val : " " ;
197
199
@@ -202,7 +204,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
202
204
}
203
205
@else {
204
206
// Cache $value unit
205
- $unit : if (type-of ($value ) == " number" , math .unit ($value ), false );
207
+ $unit : if (meta . type-of ($value ) == " number" , math .unit ($value ), false );
206
208
207
209
@if $unit == px {
208
210
// Convert to rem if needed
@@ -219,13 +221,13 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
219
221
}
220
222
221
223
// Remove first space
222
- @return unquote (str-slice ($val , 2 ));
224
+ @return string . unquote (str-slice ($val , 2 ));
223
225
}
224
226
225
227
// Helper function to get the responsive value calculated by RFS
226
228
@function rfs-fluid-value ($values ) {
227
229
// Convert to list
228
- $values : if (type-of ($values ) != list , ($values ,), $values );
230
+ $values : if (meta . type-of ($values ) != list , ($values ,), $values );
229
231
230
232
$val : " " ;
231
233
@@ -235,7 +237,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
235
237
$val : $val + " 0" ;
236
238
} @else {
237
239
// Cache $value unit
238
- $unit : if (type-of ($value ) == " number" , math .unit ($value ), false );
240
+ $unit : if (meta . type-of ($value ) == " number" , math .unit ($value ), false );
239
241
240
242
// If $value isn't a number (like inherit) or $value has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
241
243
@if not $unit or $unit != px and $unit != rem {
@@ -275,7 +277,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
275
277
}
276
278
277
279
// Remove first space
278
- @return unquote (str-slice ($val , 2 ));
280
+ @return string . unquote (str-slice ($val , 2 ));
279
281
}
280
282
281
283
// RFS mixin
0 commit comments