@@ -48,37 +48,20 @@ pub(crate) fn resolved_condition_paths(config: &UserConfig, key: &str) -> Option
4848 ( !paths. is_empty ( ) ) . then_some ( paths)
4949}
5050
51- pub ( crate ) fn lower_target_conditions (
52- config : & UserConfig ,
53- target : & LoweredTarget ,
54- conditions : & [ & str ] ,
55- ) -> Vec < LoweredTarget > {
56- // Each condition can expand to multiple paths, so lowering builds the
57- // cartesian product while preserving the caller's condition order.
58- let mut targets = vec ! [ target. clone( ) ] ;
59- for condition in conditions {
60- let mut next = Vec :: new ( ) ;
61- for target in & targets {
62- for path in condition_raw_paths ( config, condition) {
63- let mut target = target. clone ( ) ;
64- for raw in path {
65- apply_raw_condition ( & mut target. selector , & mut target. wrappers , & raw ) ;
66- }
67- next. push ( target) ;
68- }
69- }
70- targets = next;
71- }
72- targets
73- }
74-
7551pub ( crate ) fn lower_selector_conditions (
7652 base : & str ,
7753 conditions : & [ ConditionPaths ] ,
7854) -> Vec < LoweredTarget > {
7955 // Global CSS and token CSS resolve condition keys before they reach this
8056 // point, but still need the same path-product lowering as atom rules.
81- let mut targets = vec ! [ LoweredTarget :: new( base) ] ;
57+ lower_target_resolved_conditions ( & LoweredTarget :: new ( base) , conditions)
58+ }
59+
60+ pub ( crate ) fn lower_target_resolved_conditions (
61+ base : & LoweredTarget ,
62+ conditions : & [ ConditionPaths ] ,
63+ ) -> Vec < LoweredTarget > {
64+ let mut targets = vec ! [ base. clone( ) ] ;
8265 for paths in conditions {
8366 let mut next = Vec :: new ( ) ;
8467 for target in & targets {
0 commit comments