title: Returning metadata with CSS
body: <p>I have a CSS stylesheet that's dynamically created on the server, and returned via a <code>&lt;link&gt;</code> tag. Is it possible to return any metadata with this stylesheet, that I could read with JavaScript?</p>
  
  <p>(The use case: the stylesheet I return is a combination of several smaller ones. I want my JavaScript code to be able to detect which smaller ones were included.)</p>
  
  <p>I considered adding some custom properties to an element:</p>
  
  <pre><code>body {
    -my-custom-prop1:0;
    -my-custom-prop2:0;
  }
  </code></pre>
  
  <p>But when I try to read these with:</p>
  
  <pre><code>window.getComputedStyle(document.body)['-my-custom-prop1']
  </code></pre>
  
  <p>they're not returned. Any other ideaas?</p>
  
  <p><strong>EDIT:</strong> I ended up taking a slightly different approach. Instead of adding a <code>&lt;link&gt;</code> tag, I made an AJAX request to get the stylesheet, and added its text to a <code>&lt;style&gt;</code> tag. This way I could use the HTTP response headers to include metadata. Of course, this won't work across domains, like a <code>&lt;link&gt;</code> tag does.</p>