Remove margin for canvas container
This commit is contained in:
parent
d149866703
commit
7c2123614d
@ -5,7 +5,7 @@ import { useDarkMode } from "storybook-dark-mode";
|
|||||||
import { darkTheme, lightTheme } from "./customTheme";
|
import { darkTheme, lightTheme } from "./customTheme";
|
||||||
import "./static/fonts/WorkSans/font.css";
|
import "./static/fonts/WorkSans/font.css";
|
||||||
|
|
||||||
export const DocsContainer = ({ children, context }) => {
|
export function DocsContainer({ children, context }) {
|
||||||
const isStorybookUiDark = useDarkMode();
|
const isStorybookUiDark = useDarkMode();
|
||||||
|
|
||||||
const theme = isStorybookUiDark ? darkTheme : lightTheme;
|
const theme = isStorybookUiDark ? darkTheme : lightTheme;
|
||||||
@ -58,4 +58,19 @@ export const DocsContainer = ({ children, context }) => {
|
|||||||
</BaseContainer>
|
</BaseContainer>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export function CanvasContainer({ children }) {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<style>{`
|
||||||
|
body {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
`}</style>
|
||||||
|
{children}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
import { darkTheme, lightTheme } from "./customTheme";
|
import { darkTheme, lightTheme } from "./customTheme";
|
||||||
import { DocsContainer } from "./DocsContainer";
|
import { DocsContainer, CanvasContainer } from "./Containers";
|
||||||
|
|
||||||
export const parameters = {
|
export const parameters = {
|
||||||
"actions": { "argTypesRegex": "^on[A-Z].*" },
|
"actions": { "argTypesRegex": "^on[A-Z].*" },
|
||||||
@ -103,6 +103,14 @@ export const parameters = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const decorators = [
|
||||||
|
(Story) => (
|
||||||
|
<CanvasContainer>
|
||||||
|
<Story />
|
||||||
|
</CanvasContainer>
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
const { getHardCodedWeight } = (() => {
|
const { getHardCodedWeight } = (() => {
|
||||||
|
|
||||||
const orderedPagesPrefix = [
|
const orderedPagesPrefix = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user