All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gems.bourbon-4.3.2.app.assets.stylesheets.functions._px-to-rem.scss Maven / Gradle / Ivy

There is a newer version: 3.7.2
Show newest version
// Convert pixels to rems
// eg. for a relational value of 12px write rem(12)
// Assumes $em-base is the font-size of 

@function rem($pxval) {
  @if $output-bourbon-deprecation-warnings == true {
    @warn "[Bourbon] [Deprecation] `rem` is deprecated and will be " +
    "removed in 5.0.0.";
  }

  $user-deprecation-warnings-setting: $output-bourbon-deprecation-warnings;
  $output-bourbon-deprecation-warnings: false !global;

  @if not unitless($pxval) {
    $pxval: strip-units($pxval);
  }

  $base: $em-base;
  @if not unitless($base) {
    $base: strip-units($base);
  }

  $output-bourbon-deprecation-warnings: $user-deprecation-warnings-setting !global;

  @return ($pxval / $base) * 1rem;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy