@@ -11,7 +11,6 @@ module.exports = Compiler;
11
11
12
12
function Compiler ( options ) {
13
13
options = options || { } ;
14
- this . compress = options . compress ;
15
14
this . indentation = options . indent ;
16
15
}
17
16
@@ -22,7 +21,7 @@ function Compiler(options) {
22
21
Compiler . prototype . compile = function ( node ) {
23
22
return node . stylesheet
24
23
. rules . map ( this . visit , this )
25
- . join ( this . compress ? '' : '\n\n' ) ;
24
+ . join ( '\n\n' ) ;
26
25
} ;
27
26
28
27
/**
@@ -38,7 +37,6 @@ Compiler.prototype.visit = function(node){
38
37
*/
39
38
40
39
Compiler . prototype . comment = function ( node ) {
41
- if ( this . compress ) return '' ;
42
40
return this . indent ( ) + '/*' + node . comment + '*/' ;
43
41
} ;
44
42
@@ -55,14 +53,6 @@ Compiler.prototype.import = function(node){
55
53
*/
56
54
57
55
Compiler . prototype . media = function ( node ) {
58
- if ( this . compress ) {
59
- return '@media '
60
- + node . media
61
- + '{'
62
- + node . rules . map ( this . visit , this ) . join ( '' )
63
- + '}' ;
64
- }
65
-
66
56
return '@media '
67
57
+ node . media
68
58
+ ' {\n'
@@ -79,13 +69,6 @@ Compiler.prototype.media = function(node){
79
69
Compiler . prototype . document = function ( node ) {
80
70
var doc = '@' + ( node . vendor || '' ) + 'document ' + node . document ;
81
71
82
- if ( this . compress ) {
83
- return doc
84
- + '{'
85
- + node . rules . map ( this . visit , this ) . join ( '' )
86
- + '}' ;
87
- }
88
-
89
72
return doc + ' '
90
73
+ ' {\n'
91
74
+ this . indent ( 1 )
@@ -99,10 +82,6 @@ Compiler.prototype.document = function(node){
99
82
*/
100
83
101
84
Compiler . prototype . charset = function ( node ) {
102
- if ( this . compress ) {
103
- return '@charset ' + node . charset + ';' ;
104
- }
105
-
106
85
return '@charset ' + node . charset + ';\n' ;
107
86
} ;
108
87
@@ -125,16 +104,6 @@ Compiler.prototype.supports = function(node){
125
104
*/
126
105
127
106
Compiler . prototype . keyframes = function ( node ) {
128
- if ( this . compress ) {
129
- return '@'
130
- + ( node . vendor || '' )
131
- + 'keyframes '
132
- + node . name
133
- + '{'
134
- + node . keyframes . map ( this . visit , this ) . join ( '' )
135
- + '}' ;
136
- }
137
-
138
107
return '@'
139
108
+ ( node . vendor || '' )
140
109
+ 'keyframes '
@@ -153,13 +122,6 @@ Compiler.prototype.keyframes = function(node){
153
122
Compiler . prototype . keyframe = function ( node ) {
154
123
var decls = node . declarations ;
155
124
156
- if ( this . compress ) {
157
- return node . values . join ( ',' )
158
- + '{'
159
- + decls . map ( this . visit , this ) . join ( '' )
160
- + '}' ;
161
- }
162
-
163
125
return this . indent ( )
164
126
+ node . values . join ( ', ' )
165
127
+ ' {\n'
@@ -194,15 +156,6 @@ Compiler.prototype.rule = function(node){
194
156
var indent = this . indent ( ) ;
195
157
var decls = node . declarations ;
196
158
197
- if ( this . compress ) {
198
- if ( ! decls . length ) return '' ;
199
-
200
- return node . selectors . join ( ',' )
201
- + '{'
202
- + decls . map ( this . visit , this ) . join ( '' )
203
- + '}' ;
204
- }
205
-
206
159
return node . selectors . map ( function ( s ) { return indent + s } ) . join ( ',\n' )
207
160
+ ' {\n'
208
161
+ this . indent ( 1 )
@@ -216,10 +169,6 @@ Compiler.prototype.rule = function(node){
216
169
*/
217
170
218
171
Compiler . prototype . declaration = function ( node ) {
219
- if ( this . compress ) {
220
- return node . property + ':' + node . value + ';' ;
221
- }
222
-
223
172
return this . indent ( ) + node . property + ': ' + node . value + ';' ;
224
173
} ;
225
174
0 commit comments