/**
 * Get range limits for section width based on unit type.
 *
 * @param {string} unit - Unit type like 'px', '%', 'vw', 'em', 'rem'.
 * @returns {{ min: number, max: number }}
 */
export function getRangeLimitsByUnitForWidth( unit = 'px' ) {

  // Get the range limits based on the unit type.
  switch ( unit ) {

    // If the unit is % or vw, return the range limits.
    case '%':
    case 'vw':
      return { min: 0, max: 100 };

    // If the unit is em or rem, return the range limits.
    case 'em':
    case 'rem':
      return { min: 0.1, max: 100 };

    // If the unit is not %, vw, em, or rem, return the range limits.
    default:
      return { min: 0, max: 2000 };
  }
}

/**
 * Get range limits for font size based on unit type.
 *
 * @param {string} unit - Unit type like 'px', '%', 'vw', 'em', 'rem'.
 * @returns {{ min: number, max: number }}
 */
export function getRangeLimitsByUnitForFont( unit = 'px' ) {

  // Get the range limits based on the unit type.
  switch ( unit ) {

    // If the unit is % or vw, return the range limits.
    case '%':
    case 'vw':
      return { min: 0, max: 200 };

    // If the unit is em or rem, return the range limits.
    case 'em':
    case 'rem':
      return { min: 0.1, max: 10 };

    // If the unit is not %, vw, em, or rem, return the range limits.
    default:
      return { min: 0, max: 200 };
  }
}
