Skip to content

Commit

Permalink
Add story for MDX dark mode docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Tortolero committed Mar 17, 2021
1 parent d44ad0a commit 2322e1c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/official-storybook/stories/addon-docs/mdx.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { DocsContainer } from '@storybook/addon-docs/blocks';
import { themes } from '@storybook/theming';
import markdown from './markdown.stories.mdx';

export default {
Expand All @@ -15,3 +16,16 @@ export const Typography = () => {
const Docs = markdown.parameters.docs.page;
return <Docs />;
};

export const DarkModeDocs = () => {
const Docs = markdown.parameters.docs.page;
return <Docs />;
};

DarkModeDocs.decorators = [
(storyFn) => (
<DocsContainer context={{ parameters: { docs: { theme: themes.dark } } }}>
{storyFn()}
</DocsContainer>
),
];

0 comments on commit 2322e1c

Please sign in to comment.