You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace sibling broadening warning with inline code comment
When CSS `+` (adjacent sibling) is transformed to StyleX's
`siblingBefore()` (which emits `~`, general sibling), emit a
`// NOTE:` comment on the computed key property instead of an
info-level warning. This makes the semantic broadening visible
directly in the generated code where it matters.
https://claude.ai/code/session_01NACR4DTcJGrJ3xu7sWWQC9
type: "Sibling selector broadened: & + & (adjacent) becomes general sibling (~) in StyleX — interleaved non-matching elements will no longer block the match",
696
-
});
691
+
// No info warning — the broadening note is emitted as a code comment instead
Copy file name to clipboardExpand all lines: src/internal/logger.ts
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -103,8 +103,6 @@ export type WarningType =
103
103
|"Unsupported css`` mixin: nested contextual conditions in after-base mixin"
104
104
|"Unsupported css`` mixin: cannot infer base default for after-base contextual override (base value is non-literal)"
105
105
|"css`` helper function interpolation references closure variable that cannot be hoisted"
106
-
|"Sibling selector broadened: & + & (adjacent) becomes general sibling (~) in StyleX — interleaved non-matching elements will no longer block the match"
107
-
|"Sibling selector broadened: + (adjacent) becomes general sibling (~) in StyleX — interleaved non-matching elements will no longer block the match"
108
106
|"Using styled-components components as mixins is not supported; use css`` mixins or strings instead"
109
107
|"styled(ImportedComponent) wraps a component whose file contains internal styled-components — convert the base component's file first to avoid CSS cascade conflicts"
110
108
|"Transient $-prefixed props renamed on exported component — update consumer call sites to use the new prop names"
Copy file name to clipboardExpand all lines: src/internal/lower-rules/process-rules.ts
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -681,14 +681,8 @@ export function processDeclRules(ctx: DeclProcessingState): void {
681
681
break;
682
682
}
683
683
684
-
// Emit info warning for `+` since adjacent becomes general sibling
685
-
if(combinator==="+"){
686
-
warnings.push({
687
-
severity: "info",
688
-
type: "Sibling selector broadened: + (adjacent) becomes general sibling (~) in StyleX — interleaved non-matching elements will no longer block the match",
// Emit info warning for `& + &` since adjacent becomes general sibling
2082
+
// Track adjacent combinator so we can annotate the emitted computed keys
2082
2083
constisAdjacent=/\+/.test(selector);
2083
-
if(isAdjacent){
2084
-
warnings.push({
2085
-
severity: "info",
2086
-
type: "Sibling selector broadened: & + & (adjacent) becomes general sibling (~) in StyleX — interleaved non-matching elements will no longer block the match",
0 commit comments