From 26c26dd61bb5500eaa129534807ad77f07c576cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Fri, 9 Aug 2024 11:12:53 +0200 Subject: [PATCH] Reduce body _pollution_ with design tokens --- packages/components/src/utilities/theme/applyTheme.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/components/src/utilities/theme/applyTheme.ts b/packages/components/src/utilities/theme/applyTheme.ts index 1651b179..69f4be65 100644 --- a/packages/components/src/utilities/theme/applyTheme.ts +++ b/packages/components/src/utilities/theme/applyTheme.ts @@ -219,8 +219,7 @@ export function applyJupyterTheme(): void { } } } - baseLayerLuminance.setValueFor( - document.body, + baseLayerLuminance.withDefault( isDark_ ? StandardLuminance.DarkMode : StandardLuminance.LightMode ); @@ -234,7 +233,7 @@ export function applyJupyterTheme(): void { isDark_ ); if (parsedValue !== null) { - toolkitTokenName.token.setValueFor(document.body, parsedValue); + toolkitTokenName.token.withDefault(parsedValue); } else { console.error( `Fail to parse value '${value}' for '${jpTokenName}' as FAST design token.`