Skip to content

Commit

Permalink
#346 Make mdx docs readable for dark theme by applying styles on Canv…
Browse files Browse the repository at this point in the history
…as wrapper (#347)

* Make icon columns auto-adjustable
  • Loading branch information
Szymon Graczyk authored Jul 20, 2022
1 parent dc1b4d2 commit 65e3c89
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
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));
}

0 comments on commit 65e3c89

Please sign in to comment.