Skip to content

Commit 73485a6

Browse files
committed
Update addScopes
1 parent a391040 commit 73485a6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/helpers/helpers.config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,18 +220,22 @@ function resolveFallback(fallback, prop, value) {
220220
return isFunction(fallback) ? fallback(prop, value) : fallback;
221221
}
222222

223+
const getScope = (key, parent) => key === true ? parent : resolveObjectKey(parent, key);
224+
223225
function addScopes(set, parentScopes, key, parentFallback) {
224226
for (const parent of parentScopes) {
225-
const scope = key === true ? parent : resolveObjectKey(parent, key);
227+
const scope = getScope(key, parent);
226228
if (scope) {
227229
set.add(scope);
228230
const fallback = scope._fallback;
229231
if (defined(fallback) && fallback !== key && fallback !== parentFallback) {
232+
// When we reach the descriptor that defines a new _fallback, return that.
233+
// The fallback will resume to that new scope.
230234
return fallback;
231235
}
232-
} else if (scope === false && (key === 'interaction' || key === 'animation')) {
233-
// anything that falls to `interaction` or `animation`, with value `false`,
234-
// results to `false`.
236+
} else if (scope === false && key !== 'fill') {
237+
// Fallback to `false` results to `false`, expect for `fill`.
238+
// The special case (fill) should be handled through descriptors.
235239
return null;
236240
}
237241
}

0 commit comments

Comments
 (0)