Skip to content

Commit 0202dba

Browse files
committed
fix(compiler): align global css parity
1 parent de6d700 commit 0202dba

7 files changed

Lines changed: 607 additions & 57 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@pandacss/compiler': patch
3+
'@pandacss/compiler-wasm': patch
4+
---
5+
6+
Fix `globalCss` and token-reference parity with extracted styles.
7+
8+
- Expand composition props and nested utility transforms in `globalCss`.
9+
- Resolve token references in raw at-rule conditions.
10+
- Preserve `token(path, fallback)` fallbacks in emitted CSS variables.

crates/pandacss_stylesheet/src/conditions.rs

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
7551
pub(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

Comments
 (0)