/// # Math Functions
/// Use these internal math functions
/// to adjust relative sizes in your map.
/// @group math


// Plus
// ----
/// Add two values together in a `$sizes` map.
///
/// @group math
///
/// @param {string | length} $size1 -
///   The name or length of the size you are adding to
/// @param {string | length} $size2 -
///   The name or length of the size being added
/// @return {number} -
///   The calculated results of adding
///   `$size1` and `$size2`
/// @example scss -
///   $sizes: (
///     'text': 16px,
///     'margin': 14px,
///     'spacer': 'text' ('plus': 'margin'),
///   );
@function plus(
  $size1,
  $size2
) {
  @return size($size1) + size($size2);
}


// Add
// ---
/// @alias plus
/// @group math
@function add(
  $size1,
  $size2
) {
  @return plus($size1, $size2);
}



// Minus
// -----
/// Subtract one value from another in a `$sizes` map.
///
/// @group math
///
/// @param {string | length} $size1 -
///   The name or length of the size you are subtracting from
/// @param {string | length} $size2 -
///   The name or length of the size to subtract
/// @return {number} -
///   The calculated results of subtracting
///   `$size2` from `$size1`
/// @example scss -
///   $sizes: (
///     'text': 16px,
///     'margin': 14px,
///     'shim': 'text' ('minus': 'margin'),
///   );
@function minus(
  $size1,
  $size2
) {
  @return size($size1) - size($size2);
}


// Subtract
// --------
/// @alias minus
/// @group math
@function subtract(
  $size1,
  $size2
) {
  @return minus($size1, $size2);
}


// Times
// -----
/// Multiplty two values in a `$sizes` map.
///
/// @group math
///
/// @param {string | length} $size1 -
///   The name or length of the size you are multiplying
/// @param {string | length} $size2 -
///   The name or length of the size to use as a multiple
/// @return {number} -
///   The calculated results of multiplying
///   `$size1` by `$size2`
/// @example scss -
///   $sizes: (
///     'text': 16px,
///     'double': 'text' ('times': 2),
///   );
@function times(
  $size1,
  $size2
) {
  @return size($size1) * size($size2);
}


// Multiply
// --------
/// @alias times
/// @group math
@function multiply(
  $size1,
  $size2
) {
  @return times($size1, $size2);
}


// Divide
// ------
/// Divide two values in a `$sizes` map.
///
/// @group math
///
/// @param {string | length} $size1 -
///   The name or length of the size you are dividing
/// @param {string | length} $size2 -
///   The name or length of the size to use as a division
/// @return {number} -
///   The calculated results of dividing
///   `$size1` by `$size2`
/// @example scss -
///   $sizes: (
///     'text': 16px,
///     'half': 'text' ('divide': 2),
///   );
@function divide(
  $size1,
  $size2
) {
  @return size($size1) / size($size2);
}
