@@ -431,82 +431,76 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> {
431431 other => other,
432432 } ;
433433
434- match & parsed_style_order {
435- ParsedStyleOrder :: Conditional {
436- condition,
437- consequent,
438- alternate,
439- } => {
440- // Clone styles for alternate branch before consequent processing mutates them
441- let mut alt_props_styles: Vec < ExtractStyleProp < ' a > > = props_styles
442- . iter ( )
443- . map ( |s| s. clone_in ( self . ast . allocator ) )
444- . collect ( ) ;
445-
446- if let Expression :: ObjectExpression ( obj) =
447- it. arguments [ 1 ] . to_expression_mut ( )
448- {
449- let tailwind_styles = modify_prop_object (
450- & self . ast ,
451- & mut obj. properties ,
452- & mut props_styles,
453- * consequent,
454- style_vars,
455- props,
456- self . split_filename . as_deref ( ) ,
457- Some ( (
458- condition. clone_in ( self . ast . allocator ) ,
459- & mut alt_props_styles,
460- * alternate,
461- ) ) ,
462- ) ;
463- self . styles . extend ( tailwind_styles) ;
464- }
434+ if let ParsedStyleOrder :: Conditional {
435+ condition,
436+ consequent,
437+ alternate,
438+ } = & parsed_style_order
439+ {
440+ // Clone styles for alternate branch before consequent processing mutates them
441+ let mut alt_props_styles: Vec < ExtractStyleProp < ' a > > = props_styles
442+ . iter ( )
443+ . map ( |s| s. clone_in ( self . ast . allocator ) )
444+ . collect ( ) ;
465445
466- // Collect styles from both branches for CSS output
467- props_styles. iter ( ) . rev ( ) . for_each ( |style| {
468- self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
469- if let Some ( order) = consequent {
470- s. set_style_order ( * order) ;
471- }
472- s
473- } ) )
474- } ) ;
475- alt_props_styles. iter ( ) . rev ( ) . for_each ( |style| {
476- self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
477- if let Some ( order) = alternate {
478- s. set_style_order ( * order) ;
479- }
480- s
481- } ) )
482- } ) ;
446+ if let Expression :: ObjectExpression ( obj) = it. arguments [ 1 ] . to_expression_mut ( ) {
447+ let tailwind_styles = modify_prop_object (
448+ & self . ast ,
449+ & mut obj. properties ,
450+ & mut props_styles,
451+ * consequent,
452+ style_vars,
453+ props,
454+ self . split_filename . as_deref ( ) ,
455+ Some ( (
456+ condition. clone_in ( self . ast . allocator ) ,
457+ & mut alt_props_styles,
458+ * alternate,
459+ ) ) ,
460+ ) ;
461+ self . styles . extend ( tailwind_styles) ;
483462 }
484- _ => {
485- let style_order = parsed_style_order. as_static ( ) ;
486- props_styles. iter ( ) . rev ( ) . for_each ( |style| {
487- self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
488- style_order. into_iter ( ) . for_each ( |order| {
489- s. set_style_order ( order) ;
490- } ) ;
491- s
492- } ) )
493- } ) ;
494-
495- if let Expression :: ObjectExpression ( obj) =
496- it. arguments [ 1 ] . to_expression_mut ( )
497- {
498- let tailwind_styles = modify_prop_object (
499- & self . ast ,
500- & mut obj. properties ,
501- & mut props_styles,
502- style_order,
503- style_vars,
504- props,
505- self . split_filename . as_deref ( ) ,
506- None ,
507- ) ;
508- self . styles . extend ( tailwind_styles) ;
509- }
463+
464+ // Collect styles from both branches for CSS output
465+ props_styles. iter ( ) . rev ( ) . for_each ( |style| {
466+ self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
467+ if let Some ( order) = consequent {
468+ s. set_style_order ( * order) ;
469+ }
470+ s
471+ } ) )
472+ } ) ;
473+ alt_props_styles. iter ( ) . rev ( ) . for_each ( |style| {
474+ self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
475+ if let Some ( order) = alternate {
476+ s. set_style_order ( * order) ;
477+ }
478+ s
479+ } ) )
480+ } ) ;
481+ } else {
482+ let style_order = parsed_style_order. as_static ( ) ;
483+ props_styles. iter ( ) . rev ( ) . for_each ( |style| {
484+ self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
485+ style_order. into_iter ( ) . for_each ( |order| {
486+ s. set_style_order ( order) ;
487+ } ) ;
488+ s
489+ } ) )
490+ } ) ;
491+
492+ if let Expression :: ObjectExpression ( obj) = it. arguments [ 1 ] . to_expression_mut ( ) {
493+ let tailwind_styles = modify_prop_object (
494+ & self . ast ,
495+ & mut obj. properties ,
496+ & mut props_styles,
497+ style_order,
498+ style_vars,
499+ props,
500+ self . split_filename . as_deref ( ) ,
501+ None ,
502+ ) ;
503+ self . styles . extend ( tailwind_styles) ;
510504 }
511505 }
512506
@@ -709,72 +703,70 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> {
709703 . rev ( )
710704 . for_each ( |ex| props_styles. push ( ExtractStyleProp :: Static ( ex) ) ) ;
711705
712- match & parsed_style_order {
713- ParsedStyleOrder :: Conditional {
714- condition ,
715- consequent ,
716- alternate ,
717- } => {
718- // Clone styles for alternate branch before consequent processing mutates them
719- let mut alt_props_styles: Vec < ExtractStyleProp < ' a > > = props_styles
720- . iter ( )
721- . map ( |s| s. clone_in ( self . ast . allocator ) )
722- . collect ( ) ;
723-
724- // Process consequent branch
725- let tailwind_styles_con = modify_props (
726- & self . ast ,
727- attrs,
728- & mut props_styles,
729- * consequent,
730- style_vars,
731- props,
732- self . split_filename . as_deref ( ) ,
733- Some ( (
734- condition. clone_in ( self . ast . allocator ) ,
735- & mut alt_props_styles,
736- * alternate,
737- ) ) ,
738- ) ;
739- self . styles . extend ( tailwind_styles_con) ;
706+ if let ParsedStyleOrder :: Conditional {
707+ condition ,
708+ consequent ,
709+ alternate ,
710+ } = & parsed_style_order
711+ {
712+ // Clone styles for alternate branch before consequent processing mutates them
713+ let mut alt_props_styles: Vec < ExtractStyleProp < ' a > > = props_styles
714+ . iter ( )
715+ . map ( |s| s. clone_in ( self . ast . allocator ) )
716+ . collect ( ) ;
717+
718+ // Process consequent branch
719+ let tailwind_styles_con = modify_props (
720+ & self . ast ,
721+ attrs,
722+ & mut props_styles,
723+ * consequent,
724+ style_vars,
725+ props,
726+ self . split_filename . as_deref ( ) ,
727+ Some ( (
728+ condition. clone_in ( self . ast . allocator ) ,
729+ & mut alt_props_styles,
730+ * alternate,
731+ ) ) ,
732+ ) ;
733+ self . styles . extend ( tailwind_styles_con) ;
740734
741- // Collect styles from both branches for CSS output
742- props_styles. iter ( ) . rev ( ) . for_each ( |style| {
743- self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
744- if let Some ( order) = consequent {
745- s. set_style_order ( * order) ;
746- }
747- s
748- } ) )
749- } ) ;
750- alt_props_styles. iter ( ) . rev ( ) . for_each ( |style| {
751- self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
752- if let Some ( order) = alternate {
753- s. set_style_order ( * order) ;
754- }
755- s
756- } ) )
757- } ) ;
758- }
759- _ => {
760- let style_order = parsed_style_order. as_static ( ) ;
761- let tailwind_styles = modify_props (
762- & self . ast ,
763- attrs,
764- & mut props_styles,
765- style_order,
766- style_vars,
767- props,
768- self . split_filename . as_deref ( ) ,
769- None ,
770- ) ;
771- self . styles . extend ( tailwind_styles) ;
735+ // Collect styles from both branches for CSS output
736+ props_styles. iter ( ) . rev ( ) . for_each ( |style| {
737+ self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
738+ if let Some ( order) = consequent {
739+ s. set_style_order ( * order) ;
740+ }
741+ s
742+ } ) )
743+ } ) ;
744+ alt_props_styles. iter ( ) . rev ( ) . for_each ( |style| {
745+ self . styles . extend ( style. extract ( ) . into_iter ( ) . map ( |mut s| {
746+ if let Some ( order) = alternate {
747+ s. set_style_order ( * order) ;
748+ }
749+ s
750+ } ) )
751+ } ) ;
752+ } else {
753+ let style_order = parsed_style_order. as_static ( ) ;
754+ let tailwind_styles = modify_props (
755+ & self . ast ,
756+ attrs,
757+ & mut props_styles,
758+ style_order,
759+ style_vars,
760+ props,
761+ self . split_filename . as_deref ( ) ,
762+ None ,
763+ ) ;
764+ self . styles . extend ( tailwind_styles) ;
772765
773- props_styles
774- . iter ( )
775- . rev ( )
776- . for_each ( |style| self . styles . extend ( style. extract ( ) ) ) ;
777- }
766+ props_styles
767+ . iter ( )
768+ . rev ( )
769+ . for_each ( |style| self . styles . extend ( style. extract ( ) ) ) ;
778770 }
779771
780772 if let Some ( tag) = if let Expression :: StringLiteral ( str) = tag_name {
0 commit comments