summaryrefslogtreecommitdiffstats
path: root/debian/missing-sources/bourbon/app/assets/stylesheets/functions/_px-to-rem.scss
blob: 39be7e4f1ed3d94ff120367dbc917b3ce6dc8533 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Convert pixels to rems
// eg. for a relational value of 12px write rem(12)
// Assumes $em-base is the font-size of <html>

@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;
}