////////////////////////////////////////////////////////////////////////////////
/// Relative Length                                          #is-relative-length
////////////////////////////////////////////////////////////////////////////////

@use 'sass:meta';
@use 'sass:math';
@use 'sass:string';


/// Checks to see if value is a type of unit that can be manipulated relative to parent elements
///
/// @author Hugo Giraudel
///
/// @link https://css-tricks.com/snippets/sass/advanced-type-checking/
///

///
/// @group helpers-checks
///
/// @require {function} is-number
/// @require {variable} relative-lengths
///
/// @return {bool}

@function is-relative-length($value) {
  @return meta.type-of($value) == 'number' and string.index('em' 'ex' 'ch' 'rem' 'vw' 'vh' 'vmin' 'vmax', math.unit($value)) != null;
}
