/*------------------------------------*\ #Mixin - function to convert fonts sizes from px to rem; \*------------------------------------*/ /* * Below function converts font size from 'px to rem' * By var(--amadeus-hos-res-font-size-#-px, converted-size); we are exposing '--amadeus-hos-res-font-size-#-px * variable, and setting its default value in 'rem' * if host wants font size in 'px' then it can be overridden using this exposed variable */ @function convertPxToRem($size) { $converted-size: $size / 16px * 1rem; $size-in-rem: var(--amadeus-hos-res-font-size-#{$size}, #{$converted-size}); @return $size-in-rem; } @function getFontSizeByPercentage($sizeInPx, $percentage) { @return calc(#{$sizeInPx} * (#{$percentage} / 100)); }