Storybook: use div #root styles on storybook preview instead of additional div wrapper (#55023)

* feat: use styles on #root div instead of additionnal div wrapper

* Update packages/grafana-ui/src/utils/storybook/withTheme.tsx

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
Gregory Quinio 2022-09-16 16:04:56 +02:00 committed by GitHub
parent 801b61c963
commit fb59702c74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,20 +16,19 @@ const ThemeableStory: React.FunctionComponent<{ handleSassThemeChange: SassTheme
handleSassThemeChange(theme);
const css = `#root {
width: 100%;
padding: 20px;
display: flex;
min-height: 100%;
background: ${theme.colors.background.primary};
}`;
return (
<ThemeContext.Provider value={theme}>
<div
style={{
width: '100%',
padding: '20px',
display: 'flex',
minHeight: '100%',
background: `${theme.colors.background.primary}`,
}}
>
<GlobalStyles />
{children}
</div>
<GlobalStyles />
<style>{css}</style>
{children}
</ThemeContext.Provider>
);
};