title: How do you remove units of measurement from a Sass mixin equation?
body: <p>I've written a very simple Sass mixin for converting pixel values into rem values (see Jonathan Snook's <a href="http://snook.ca/archives/html_and_css/font-size-with-rem">article on the benefits of using rems</a>). Here's the code:</p>
  
  <pre><code>// Mixin Code
  $base_font_size: 10; // 10px
  @mixin rem($key,$px) {
    #{$key}: #{$px}px;
    #{$key}: #{$px/$base_font_size}rem;
  }
  
  // Include syntax
  p {
    @include rem(font-size,14);
  }
  
  // Rendered CSS
  p {
    font-size: 14px;
    font-size: 1.4rem;
  }
  </code></pre>
  
  <p>This mixin works quite well, but I'm a bit unsatisfied with the include syntax for it. See, I would much rather pass a pixel value into the include statement instead of a simple number. This is a small detail, but it would add <em>semantic meaning</em> to the include statement that currently doesn't exist. Here's what I get when I try to pass a pixel value into the include statement:</p>
  
  <pre><code>// Include syntax
  p {
    @include rem(font-size,14px);
  }
  
  // Rendered CSS
  p {
    font-size: 14pxpx;
    font-size: 1.4pxrem;
  }
  </code></pre>
  
  <p>Once Sass sees a pixel value being passed into an equation, it outputs the 'px'. <em>I want to strip that unit of measure out</em> as if I were using parseFloat or parseInt in JavaScript. How does one do so inside of a Sass mixin?</p>