Skip to content

Commit

Permalink
fix: chromatic avoid apply color on main
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Apr 18, 2024
1 parent 90c95bd commit 0024b06
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/storybook/testing/with-background-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ export const withBackgroundDecorator = makeDecorator({
if (!backgroundColor) {
return getStory(context);
} else {
return html`<div style="background-color: ${backgroundColor(context)}">
${getStory(context)}
</div>`;
const isChromaticStoriesMain = !(
getStory(context) as { strings: string[] }
).strings[0].includes('outline');

return !isChromaticStoriesMain
? html`<div style="background-color: ${backgroundColor(context)}">
${getStory(context)}
</div>`
: getStory(context);
}
} else {
// For standard case we manipulate the body
Expand Down

0 comments on commit 0024b06

Please sign in to comment.