Skip to content

Commit d120e33

Browse files
committed
better table styles
1 parent cb15f0c commit d120e33

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/MarkdownRenderer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {Heading} from 'grommet/components/Heading';
1313
import {Box} from 'grommet/components/Box';
1414
import {Text} from 'grommet/components/Text';
1515
import {ResponsiveContext} from 'grommet/contexts/ResponsiveContext';
16+
import {Table, TableHeader, TableBody, TableRow, TableCell} from 'grommet';
1617
import emoji from './emoji';
1718
import {fetchTokenInfo, defaultThemeColors} from './lib/codeHighlight';
1819
import {isPromise} from 'relay-runtime';
@@ -359,6 +360,11 @@ const defaultRenderers = ({
359360
linkReference(props) {
360361
return <div {...props} />;
361362
},
363+
table: Table,
364+
tableHead: TableHeader,
365+
tableBody: TableBody,
366+
tableRow: TableRow,
367+
tableCell: TableCell,
362368
footnoteReference: function FootnoteReference(props) {
363369
// This should be ok because we will always call these in the same order
364370
// eslint-disable-next-line react-hooks/rules-of-hooks

src/lib/theme.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@ const theme = deepMerge(generate(24, 10), {
3434
`;
3535
},
3636
},
37+
table: {
38+
header: {
39+
align: 'start',
40+
pad: {horizontal: 'small', vertical: 'xsmall'},
41+
border: 'small',
42+
style: {fontSize: '.85em', fontWeight: 'bold'},
43+
},
44+
body: {
45+
border: 'small',
46+
align: 'start',
47+
pad: {horizontal: 'small', vertical: 'xsmall'},
48+
style: {fontSize: '.85em'},
49+
},
50+
footer: {
51+
align: 'start',
52+
pad: {horizontal: 'small', vertical: 'xsmall'},
53+
border: 'small',
54+
style: {fontSize: '.85em'},
55+
},
56+
},
3757
});
3858

3959
export default theme;

0 commit comments

Comments
 (0)