Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#346 Make mdx docs readable for dark theme by applying styles on Canvas wrapper #347

Merged
merged 2 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ import { ColorTokensPallete } from './components/ColorTokens';

List of available color tokens. Click on token to copy it's value to clipboard.

<ColorTokensPallete />
<Canvas
style={{
color: 'var(--content-default)',
backgroundColor: 'var(--background)',
}}
>
<ColorTokensPallete />
</Canvas>
9 changes: 8 additions & 1 deletion packages/react-components/src/stories/Icons.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ import { IconsShowcase } from './components/IconsShowcase';

List of the icons available in the design system.

<IconsShowcase />
<Canvas
style={{
color: 'var(--content-default)',
backgroundColor: 'var(--background)',
}}
>
<IconsShowcase />
</Canvas>
18 changes: 14 additions & 4 deletions packages/react-components/src/stories/Typography.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Canvas, ArgsTable } from "@storybook/addon-docs";
import { Meta, Canvas, ArgsTable } from '@storybook/addon-docs';

import { Heading, Text } from "../components/Typography";
import { Heading, Text } from '../components/Typography';

<Meta title="Foundations/Typography" />

Expand All @@ -22,7 +22,12 @@ You can modify the output element via `as` prop. For example if you want to rend

<ArgsTable of={Heading} />

<Canvas style={{ color: "var(--content-default)" }}>
<Canvas
style={{
color: 'var(--content-default)',
backgroundColor: 'var(--background)',
}}
>
<Heading size="xl">Heading XLarge</Heading>
<Heading size="lg">Heading Large</Heading>
<Heading size="md">Heading Medium</Heading>
Expand All @@ -42,7 +47,12 @@ You can modify the output element via `as` prop. For example if you want to rend

<ArgsTable of={Text} />

<Canvas style={{ color: "var(--content-default)" }}>
<Canvas
style={{
color: 'var(--content-default)',
backgroundColor: 'var(--background)',
}}
>
<Text>Paragraph Medium</Text>
<Text bold>Paragraph Medium Bold</Text>
<Text underline>Paragraph Medium Underline</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const CONTENT = {
};

export const ColorTokensPallete: React.FC = () => (
<div style={{ color: 'var(--content-default)' }}>
<React.Fragment>
{Object.entries(CONTENT).map(([section, { heading, content }]) => (
<React.Fragment key={section}>
<h2>{heading}</h2>
Expand Down Expand Up @@ -95,5 +95,5 @@ export const ColorTokensPallete: React.FC = () => (
</ul>
</React.Fragment>
))}
</div>
</React.Fragment>
);
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
display: grid;
gap: 10px;
grid-auto-rows: minmax(100px, auto);
grid-template-columns: repeat(8, 1fr);
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}