title: How do you set a class factory in CSS styles?
body: <p>I've been having trouble setting the item renderer of a Spark DataGrid in CSS and then I remembered the compiler creates a class factory for it. </p>
  
  <p>This CSS does not work:  </p>
  
  <pre><code>.myGrid {
      itemRenderer: ClassReference("myItemRenderer");
  }
  </code></pre>
  
  <p>but declaring it inline it does: </p>
  
  <pre><code>&lt;s:DataGrid itemRenderer="myItemRenderer" /&gt;
  </code></pre>
  
  <p>I found this <code>setStyle</code> code and put it in the constructor but it doesn't work:  </p>
  
  <pre><code>    public function DataGrid() {
          super();
  
          setStyle("itemRenderer", new ClassFactory(myItemRenderer));
      }
  </code></pre>
  
  <p>I've created a new control and I want to use my custom renderer as default. So all the styles are set in the defaults.css. </p>