Answers for "sass function convert px to rem"

0

sass function convert px to rem

@use 'sass:math';

@function pxToRem($pxValue) {
    @return math.div($pxValue, 16px) * 1rem; 
}

div {
    width: pxToRem(400px); // → 25rem
}
Posted by: Guest on October-05-2021

Browse Popular Code Answers by Language