Perf improvements

This commit is contained in:
Eric Bailey
2023-12-20 14:45:44 -06:00
parent e84d035e86
commit 47587de0b2
+6 -7
View File
@@ -341,18 +341,17 @@ export const createTheme = <
if (properties[prop]) { if (properties[prop]) {
_applyStyleProperty(styles, prop, value) _applyStyleProperty(styles, prop, value)
} else if (macros[prop]) { } else if (macros[prop]) {
styles = { Object.assign(
...styles, styles,
// @ts-ignore no index sig, it's fine rawProps[prop] !== false ? macros[prop](value, tokens) : {},
...(rawProps[prop] !== false ? macros[prop](value, tokens) : {}), )
}
} else if (breakpoints[prop]) { } else if (breakpoints[prop]) {
for (const b of Object.keys(breakpoints)) { for (const b in breakpoints) {
if (activeBreakpoints.includes(b)) { if (activeBreakpoints.includes(b)) {
// @ts-ignore no index sig, it's fine // @ts-ignore no index sig, it's fine
const breakpointStyles = rawProps[b] || {} const breakpointStyles = rawProps[b] || {}
const r = style(breakpointStyles, activeBreakpoints) const r = style(breakpointStyles, activeBreakpoints)
styles = {...styles, ...r.styles} Object.assign(styles, r.styles || {})
} else { } else {
// @ts-ignore no index sig, it's fine // @ts-ignore no index sig, it's fine
delete rawProps[b] delete rawProps[b]