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

/// Checks if a value is a percentage.
///
/// @param {*} $value - A value to be checked.
///
/// @return {Bool} True if $value is a percentage, false if it is not.
///
/// @access public
/// @group Utilities
@function is-percentage($value) {
  @return meta.type-of($value) == 'number' and math.unit($value) == '%';
}

/// Checks if a value is a percentage.
///
/// @param {*} $value - The value to be checked.
///
/// @return {Bool} True if $value is a percentage, false if it is not.
///
/// @access public
/// @group Utilities
/// @alias is-percentage
@function is-percent($value) {
  @return meta.type-of($value) == 'number' and math.unit($value) == '%';
}
