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
Copy file name to clipboardExpand all lines: packages/core/src/handlers/suggest-fix.ts
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,22 @@ function fixShadowDom(input: SuggestFixInput): FixSuggestion {
157
157
};
158
158
}
159
159
160
+
if(input.issue==='root-scope-token'){
161
+
consttag=tagName??'the-element';
162
+
// Extract token name from the original CSS
163
+
consttokenMatch=original.match(/(--[\w-]+)\s*:/);
164
+
consttoken=tokenMatch?.[1]??'--component-token';
165
+
constvalueMatch=original.match(/:\s*([^;]+)/);
166
+
constvalue=valueMatch?.[1]?.trim()??'value';
167
+
168
+
return{
169
+
original,
170
+
suggestion: `${tag} { ${token}: ${value}; }`,
171
+
explanation: `Component tokens set on :root have no effect through Shadow DOM boundaries. The token "${token}" must be set on the component's host element (<${tag}>) for the shadow root to inherit it.`,
0 commit comments