////////////////////////////////////////////////////////////////////////////////
/// Absolute Length                                          #is-absolute-length
////////////////////////////////////////////////////////////////////////////////

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

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

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

@function absolute-length($value) {
  @return meta.type-of($value) == 'number' and string.index('cm' 'mm' 'in' 'px' 'pt' 'pc', math.unit($value)) != null;
}
