Skip to content

Commit 1a2d189

Browse files
committed
Split color and cursor style memos
1 parent 9b640e1 commit 1a2d189

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

‎packages/theme/src/use-theme-provider-styles.ts‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export function useThemeProviderStyles( {
200200
[ primary, bg, cursorControl ]
201201
);
202202

203-
const themeProviderStyles = useMemo( () => {
203+
const colorStyles = useMemo( () => {
204204
// Determine which seeds are needed for generating ramps.
205205
const seeds = {
206206
...DEFAULT_SEED_COLORS,
@@ -222,16 +222,21 @@ export function useThemeProviderStyles( {
222222
}
223223
} );
224224

225-
return {
226-
...generateStyles( {
227-
primary: seeds.primary,
228-
computedColorRamps,
229-
} ),
225+
return generateStyles( {
226+
primary: seeds.primary,
227+
computedColorRamps,
228+
} );
229+
}, [ primary, bg ] );
230+
231+
const themeProviderStyles = useMemo(
232+
() => ( {
233+
...colorStyles,
230234
...( cursorControl && {
231235
'--wpds-cursor-control': cursorControl,
232236
} ),
233-
};
234-
}, [ primary, bg, cursorControl ] );
237+
} ),
238+
[ colorStyles, cursorControl ]
239+
);
235240

236241
return {
237242
resolvedSettings,

0 commit comments

Comments
 (0)