Skip to content

Commit 623c53a

Browse files
committed
Theme: explain inline-style vs setProperty asymmetry in ThemeProvider
1 parent 691b0ec commit 623c53a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/theme/src/theme-provider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export const ThemeProvider = ( {
2525

2626
// Mirror the wrapper's custom properties onto `document.documentElement`
2727
// so they reach portals and anything else rendered outside the wrapper
28-
// (e.g. the `html`/`body` background).
28+
// (e.g. the `html`/`body` background). Unlike the wrapper, `html` is a
29+
// shared element, so we set/remove individual properties (preserving any
30+
// prior value) instead of declaratively assigning a full style object.
2931
useLayoutEffect( () => {
3032
if ( ! isRoot || typeof document === 'undefined' ) {
3133
return;

0 commit comments

Comments
 (0)