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 17:04:56 +03:00
committed by GitHub
co-authored by Alex Khomenko
parent 801b61c963
commit fb59702c74
@@ -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>
);
};