/// Default font size
/// @type Number
/// @access public
/// @group @cds/layout
@use "sass:math";

$cds-base-font-size: 16px !default;

/// Convert a given px unit to a rem unit
/// @param {Number} $px - Number with px unit
/// @return {Number} Number with rem unit
/// @access public
/// @group @cds/layout
@function toRem($px) {
  @return math.div($px, $cds-base-font-size) * 1rem;
}

/// Convert a given px unit to a em unit
/// @param {Number} $px - Number with px unit
/// @return {Number} Number with em unit
/// @access public
/// @group @cds/layout
@function toEm($px) {
  @return math.div($px, $cds-base-font-size) * 1em;
}
