Skip to content

Commit

Permalink
fix: correct theme calculation for triggering warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Oct 7, 2022
1 parent 17fd5d5 commit 5576329
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/theme/src/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`
Expand All @@ -327,8 +330,8 @@ export class Theme extends HTMLElement implements ThemeKindProvider {
'You are leveraging an <sp-theme> element and the following issues may disrupt your theme delivery:',
'https://opensource.adobe.com/spectrum-web-components/components/theme/#example',
{
issues
},
issues,
}
);
}
}
Expand Down

0 comments on commit 5576329

Please sign in to comment.