File tree Expand file tree Collapse file tree 4 files changed +69
-0
lines changed Expand file tree Collapse file tree 4 files changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ @-moz-document url-prefix() {
2
+ .icon-spin {
3
+ height : .9em
4
+ }
5
+
6
+ .btn .icon-spin {
7
+ height : auto
8
+ }
9
+
10
+ .icon-spin .icon-large {
11
+ height : 1.25em
12
+ }
13
+
14
+ .btn .icon-spin .icon-large {
15
+ height : .75em
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+
2
+ /**
3
+ * Module dependencies.
4
+ */
5
+
6
+ var parse = require ( 'css-parse' )
7
+ , stringify = require ( '..' )
8
+ , fs = require ( 'fs' )
9
+ , read = fs . readFileSync
10
+ , css = read ( 'examples/document.css' , 'utf8' ) ;
11
+
12
+ console . log ( stringify ( parse ( css ) , { compress : false } ) ) ;
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ Compiler.prototype.compile = function(node){
36
36
*/
37
37
38
38
Compiler . prototype . visit = function ( node ) {
39
+ if ( node . document ) return this . document ( node ) ;
39
40
if ( node . comment ) return this . comment ( node ) ;
40
41
if ( node . charset ) return this . charset ( node ) ;
41
42
if ( node . keyframes ) return this . keyframes ( node ) ;
@@ -83,6 +84,28 @@ Compiler.prototype.media = function(node){
83
84
+ '\n}' ;
84
85
} ;
85
86
87
+ /**
88
+ * Visit document node.
89
+ */
90
+
91
+ Compiler . prototype . document = function ( node ) {
92
+ var doc = '@' + ( node . vendor || '' ) + 'document ' + node . document ;
93
+
94
+ if ( this . compress ) {
95
+ return doc
96
+ + '{'
97
+ + node . rules . map ( this . visit , this ) . join ( '' )
98
+ + '}' ;
99
+ }
100
+
101
+ return doc + ' '
102
+ + ' {\n'
103
+ + this . indent ( 1 )
104
+ + node . rules . map ( this . visit , this ) . join ( '\n\n' )
105
+ + this . indent ( - 1 )
106
+ + '\n}' ;
107
+ } ;
108
+
86
109
/**
87
110
* Visit charset node.
88
111
*/
Original file line number Diff line number Diff line change
1
+ @-moz-document url-prefix() {
2
+ .icon-spin {
3
+ height : .9em
4
+ }
5
+
6
+ .btn .icon-spin {
7
+ height : auto
8
+ }
9
+
10
+ .icon-spin .icon-large {
11
+ height : 1.25em
12
+ }
13
+
14
+ .btn .icon-spin .icon-large {
15
+ height : .75em
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments