title: Nokogiri CSS normalization
body: <p>I have some attributes like:</p>
  
  <pre><code>&lt;span style="font:22px Arial"&gt;...&lt;/span&gt;
  </code></pre>
  
  <p>and others like:</p>
  
  <pre><code>&lt;span style="font-size:22px;font-family:Arial"&gt;...&lt;/span&gt;
  </code></pre>
  
  <p>Now I can get the style attribute with nokogiri, but what I'd want is to the following information:</p>
  
  <ul>
  <li>font-family</li>
  <li>font-size</li>
  <li>color</li>
  <li>text-decoration</li>
  <li>font-weight</li>
  <li>font-style</li>
  </ul>
  
  <p>Some attributes like color are easy to get, but some others, like font-size, require quite some tinkering with the css string.</p>
  
  <p>Before digging into a solution of my own, I was wondering if nokogiri, or perhaps a specialized css gem would be able to normalize the css string and let me query the css attributes one by one. It would be even more convenient if I could get the computed css (for example an element with no font-size inside an element with a font-size of 10 would give me 10 when I ask for the font-size on the child element), but this last part is easy to implement with a hash and a stack, so it's not very important.</p>