// -------------------------------------------------------------------------- \\
// File: Stylesheet.js                                                        \\
// Module: DOM                                                                \\
// Requires: Core, Element.js                                                 \\
// Author: Neil Jenkins                                                       \\
// License: © 2010-2015 FastMail Pty Ltd. MIT Licensed.                       \\
// -------------------------------------------------------------------------- \\

/*global document */

"use strict";

( function ( NS ) {

/**
    Namespace: O.Stylesheet

    The O.Stylesheet namespace contains helper functions for dealing with CSS
    stylesheets.
*/
NS.Stylesheet = {
    /**
        Function: O.Stylesheet.create

        Injects CSS into the document by creating a new stylesheet and appending
        it to the document.

        Parameters:
            id  - {String} The id to give the node in the document.
            css - {String} The CSS to insert into the stylesheet.

        Returns:
            {Element} The <style> node that was created.
    */
    create: function ( id, css ) {
        var doc = document,
            head = doc.documentElement.firstChild,
            style = NS.Element.create( 'style', {
                type: 'text/css',
                id: id
            });

        style.appendChild( doc.createTextNode( css ) );
        head.appendChild( style );
        return style;
    }
};

}( O ) );

@@ -613,16 +613,26 @@
 ion ( NS
+, document
  ) %7B%0A%0A/*
@@ -1222,87 +1222,8 @@
 var 
-doc = document,%0A            head = doc.documentElement.firstChild,%0A            
 styl
@@ -1268,20 +1268,16 @@
         
-    
 type: 't
@@ -1286,20 +1286,16 @@
 t/css',%0A
-    
         
@@ -1304,16 +1304,17 @@
   id: id
+,
 %0A       
@@ -1322,66 +1322,27 @@
     
-%7D);%0A%0A        style.appendChild( doc.createTextNode( css ) 
+text: css%0A        %7D
 );%0A 
@@ -1348,16 +1348,25 @@
         
+document.
 head.app
@@ -1420,12 +1420,22 @@
 %7D;%0A%0A
-
 %7D( O
+, document
  ) )

Tidy Stylesheet module