title: replacing function in stylus
body: <p>I have Stylus file with that code:</p>
  
  <pre><code>body
    background url('/templates/main/img/sprites/ico-soc.png') 100px 100px no-repeat
  </code></pre>
  
  <p>I need function(mixin) <code>background</code> which will remove '/templates/main/' from the image's reference</p>
  
  <pre><code>body
        background url('img/sprites/ico-soc.png') 100px 100px no-repeat
  </code></pre>
  
  <p>Please help me) I think maybe I went in the wrong direction, and there is a simple way to solve the problem.  note that I need the function. Don't offer to create a variable for the directory!</p>
  
  <hr>
  
  <p><strong>That's what I'm doing</strong></p>
  
  <p>I made function</p>
  
  <pre><code>background()
    background arguments
  </code></pre>
  
  <p>then I tried to solve the problem in two ways
  1) I tried to find a replacement function. but failed. 
  Then i tried to use the decision of the documentation (function replace). But it does not fit my case.
  <a href="http://learnboost.github.io/stylus/docs/bifs.html#add-propertyname-expr" rel="nofollow">http://learnboost.github.io/stylus/docs/bifs.html#add-propertyname-expr</a></p>
  
  <p>2) I wrote my function on js through the function use(path) (<a href="http://learnboost.github.io/stylus/docs/bifs.html#usepath" rel="nofollow">http://learnboost.github.io/stylus/docs/bifs.html#usepath</a>).
  But I had the problem the value coming into js function is not correct. There are extra spaces.</p>
  
  <p>style.styl</p>
  
  <pre><code>use("add.js")
  
  background()
    background arguments
  
  body
    background url('img/sprites/ico-soc.png') 100px 100px no-repeat
  </code></pre>
  
  <p>add.js</p>
  
  <pre><code>    var plugin = function(){
      return function(style){
          style.define('add', function(a) {
              console.log(typeof a);
              console.log(a);
          });
      };
  };
  module.exports = plugin;
  </code></pre>