New source found from dndbeyond.com
This commit is contained in:
+9
-2
@@ -64,7 +64,8 @@ export function unstable_createStyleFunctionSx() {
|
||||
var _theme$unstable_sxCon;
|
||||
const {
|
||||
sx,
|
||||
theme = {}
|
||||
theme = {},
|
||||
nested
|
||||
} = props || {};
|
||||
if (!sx) {
|
||||
return null; // Emotion & styled-components will neglect null
|
||||
@@ -105,7 +106,8 @@ export function unstable_createStyleFunctionSx() {
|
||||
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
||||
css[styleKey] = styleFunctionSx({
|
||||
sx: value,
|
||||
theme
|
||||
theme,
|
||||
nested: true
|
||||
});
|
||||
} else {
|
||||
css = merge(css, breakpointsValues);
|
||||
@@ -116,6 +118,11 @@ export function unstable_createStyleFunctionSx() {
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!nested && theme.modularCssLayers) {
|
||||
return {
|
||||
'@layer sx': removeUnusedBreakpoints(breakpointsKeys, css)
|
||||
};
|
||||
}
|
||||
return removeUnusedBreakpoints(breakpointsKeys, css);
|
||||
}
|
||||
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
||||
|
||||
Reference in New Issue
Block a user