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]) {
_applyStyleProperty(styles, prop, value)
} else if (macros[prop]) {
styles = {
...styles,
// @ts-ignore no index sig, it's fine
...(rawProps[prop] !== false ? macros[prop](value, tokens) : {}),
}
Object.assign(
styles,
rawProps[prop] !== false ? macros[prop](value, tokens) : {},
)
} else if (breakpoints[prop]) {
for (const b of Object.keys(breakpoints)) {
for (const b in breakpoints) {
if (activeBreakpoints.includes(b)) {
// @ts-ignore no index sig, it's fine
const breakpointStyles = rawProps[b] || {}
const r = style(breakpointStyles, activeBreakpoints)
styles = {...styles, ...r.styles}
Object.assign(styles, r.styles || {})
} else {
// @ts-ignore no index sig, it's fine
delete rawProps[b]