File tree Expand file tree Collapse file tree 1 file changed +27
-27
lines changed
packages/svelte/src/compiler/print Expand file tree Collapse file tree 1 file changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,33 @@ const css_visitors = {
5656 }
5757 } ,
5858
59+ Block ( node , context ) {
60+ context . write ( '{' ) ;
61+
62+ if ( node . children . length > 0 ) {
63+ context . indent ( ) ;
64+ context . newline ( ) ;
65+
66+ let started = false ;
67+
68+ for ( const child of node . children ) {
69+ if ( started ) {
70+ context . margin ( ) ;
71+ context . newline ( ) ;
72+ }
73+
74+ context . visit ( child ) ;
75+
76+ started = true ;
77+ }
78+
79+ context . dedent ( ) ;
80+ context . newline ( ) ;
81+ }
82+
83+ context . write ( '}' ) ;
84+ } ,
85+
5986 ClassSelector ( node , context ) {
6087 context . write ( `.${ node . name } ` ) ;
6188 } ,
@@ -381,33 +408,6 @@ const svelte_visitors = {
381408 context . write ( '}' ) ;
382409 } ,
383410
384- Block ( node , context ) {
385- context . write ( '{' ) ;
386-
387- if ( node . children . length > 0 ) {
388- context . indent ( ) ;
389- context . newline ( ) ;
390-
391- let started = false ;
392-
393- for ( const child of node . children ) {
394- if ( started ) {
395- context . margin ( ) ;
396- context . newline ( ) ;
397- }
398-
399- context . visit ( child ) ;
400-
401- started = true ;
402- }
403-
404- context . dedent ( ) ;
405- context . newline ( ) ;
406- }
407-
408- context . write ( '}' ) ;
409- } ,
410-
411411 ClassDirective ( node , context ) {
412412 context . write ( `class:${ node . name } ` ) ;
413413 if (
You can’t perform that action at this time.
0 commit comments