Remove margin for canvas container

This commit is contained in:
garronej 2023-04-20 04:18:17 +02:00
parent d149866703
commit 7c2123614d
2 changed files with 26 additions and 3 deletions

@ -5,7 +5,7 @@ import { useDarkMode } from "storybook-dark-mode";
import { darkTheme, lightTheme } from "./customTheme";
import "./static/fonts/WorkSans/font.css";
export const DocsContainer = ({ children, context }) => {
export function DocsContainer({ children, context }) {
const isStorybookUiDark = useDarkMode();
const theme = isStorybookUiDark ? darkTheme : lightTheme;
@ -58,4 +58,19 @@ export const DocsContainer = ({ children, context }) => {
</BaseContainer>
</>
);
};
}
export function CanvasContainer({ children }) {
return (
<>
<style>{`
body {
padding: 0 !important;
}
`}</style>
{children}
</>
);
}

@ -1,5 +1,5 @@
import { darkTheme, lightTheme } from "./customTheme";
import { DocsContainer } from "./DocsContainer";
import { DocsContainer, CanvasContainer } from "./Containers";
export const parameters = {
"actions": { "argTypesRegex": "^on[A-Z].*" },
@ -103,6 +103,14 @@ export const parameters = {
},
};
export const decorators = [
(Story) => (
<CanvasContainer>
<Story />
</CanvasContainer>
),
];
const { getHardCodedWeight } = (() => {
const orderedPagesPrefix = [