From 557632990faca6f96e6a019180586ae5e9a1624b Mon Sep 17 00:00:00 2001 From: Westbrook Johnson Date: Thu, 29 Sep 2022 10:26:54 -0400 Subject: [PATCH] fix: correct theme calculation for triggering warnings --- packages/theme/src/Theme.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/theme/src/Theme.ts b/packages/theme/src/Theme.ts index 2cb193e451..55667fb312 100644 --- a/packages/theme/src/Theme.ts +++ b/packages/theme/src/Theme.ts @@ -311,7 +311,10 @@ export class Theme extends HTMLElement implements ThemeKindProvider { } else if ( !Theme.themeFragmentsByKind .get(name) - ?.get(resolvedValue + themeModifier) + ?.get( + resolvedValue + + (name === 'theme' ? '' : themeModifier) + ) ) { issues.push( `You have set "${name}='${resolvedValue}'" but the associated theme fragment has not been loaded.` @@ -327,8 +330,8 @@ export class Theme extends HTMLElement implements ThemeKindProvider { 'You are leveraging an element and the following issues may disrupt your theme delivery:', 'https://opensource.adobe.com/spectrum-web-components/components/theme/#example', { - issues - }, + issues, + } ); } }