title: Style object to string
body: <p>I'm trying to convert my generated style object to a style-string. 
  Basically what jQuery does by applying <code>$(elem).css(styleObject)</code>, but without a target element.</p>
  
  <p>Is there anyway to transform an object like </p>
  
  <pre><code>bodyStyle = {
     lineHeight: 10,
     backgroundColor: '#444',
     height: 50
  }
  </code></pre>
  
  <p>to a string like</p>
  
  <pre><code>line-height: 10px; background-color: #444; height:50px;
  </code></pre>
  
  <p>What I'm doing now doesn't seem to be the most elegant solution: </p>
  
  <pre><code>if(styleObj) {
      var style = $('&lt;div&gt;').css(styleObj).attr('style');
      return style;
  }
  </code></pre>