diary-website

Website for diary
git clone https://git.in0rdr.ch/diary-website.git
Log | Files | Refs | Pull requests |Archive | README | LICENSE

_px-to-rem.scss (336B)


      1 // Convert pixels to rems
      2 // eg. for a relational value of 12px write rem(12)
      3 // Assumes $em-base is the font-size of <html>
      4 
      5 @function rem($pxval) {
      6   @if not unitless($pxval) {
      7     $pxval: strip-units($pxval);
      8   }
      9 
     10   $base: $em-base;
     11   @if not unitless($base) {
     12     $base: strip-units($base);
     13   }
     14   @return ($pxval / $base) * 1rem;
     15 }