Skip to content

Commit

Permalink
FIX background transparent on Preview causing the addons to be visisb…
Browse files Browse the repository at this point in the history
…le, when they are not supposed to be

Thanks to glitchperfect's #6042
  • Loading branch information
ndelangen committed Mar 15, 2019
1 parent 11e8a43 commit 5592373
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions addons/backgrounds/src/containers/BackgroundSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react';
import memoize from 'memoizerific';

import { Combo, Consumer } from '@storybook/api';
import { Global } from '@storybook/theming';
import { Global, Theme } from '@storybook/theming';

import { Icons, IconButton, WithTooltip, TooltipLinkList } from '@storybook/components';

Expand Down Expand Up @@ -123,11 +123,14 @@ export class BackgroundSelector extends Component<{}, State> {
<Fragment>
{selectedBackgroundColor ? (
<Global
styles={{
styles={(theme: Theme) => ({
[`#${iframeId}`]: {
background: selectedBackgroundColor,
background:
selectedBackgroundColor === 'transparent'
? theme.background.content
: selectedBackgroundColor,
},
}}
})}
/>
) : null}
<WithTooltip
Expand Down

0 comments on commit 5592373

Please sign in to comment.