File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1311,15 +1311,17 @@ class QualifiedRule extends CSSParserRule {
1311
1311
}
1312
1312
toSource ( indent = 0 ) {
1313
1313
let s = printIndent ( indent ) ;
1314
- s += this . prelude . map ( x => x . toSource ( ) ) . join ( "" ) ;
1315
- s += "{\n" ;
1316
- if ( this . declarations . length ) {
1317
- s += this . declarations . map ( x => x . toSource ( indent + 1 ) ) . join ( "\n" ) + "\n" ;
1318
- }
1319
- if ( this . rules . length ) {
1320
- s += this . rules . map ( x => x . toSource ( indent + 1 ) ) . join ( "\n" ) + "\n" ;
1314
+ let prelude = this . prelude . map ( x => x . toSource ( ) ) . join ( "" ) ;
1315
+ while ( prelude . endsWith ( ' ' ) ) { prelude = prelude . slice ( 0 , - 1 ) ; }
1316
+ s += prelude + " " ;
1317
+ if ( this . declarations . length || this . rules . length ) {
1318
+ s += "{\n" +
1319
+ this . declarations . map ( x => x . toSource ( indent + 1 ) + "\n" ) . join ( "" ) +
1320
+ this . rules . map ( x => x . toSource ( indent + 1 ) + "\n" ) . join ( "" ) +
1321
+ printIndent ( indent ) + "}" ;
1322
+ } else {
1323
+ s += "{ }" ;
1321
1324
}
1322
- s += printIndent ( indent ) + "}" ;
1323
1325
return s ;
1324
1326
}
1325
1327
}
You can’t perform that action at this time.
0 commit comments