@@ -207,6 +207,51 @@ const MdHr = styled.hr.withConfig(commonCfg)(({ theme }) => ({
207207 margin : `${ theme . spacing . medium } px ${ theme . spacing . large } px 0` ,
208208} ) )
209209
210+ const MdTable = styled . table ( ( { theme } ) => ( {
211+ paddingTop : theme . spacing . medium ,
212+ borderCollapse : 'separate' ,
213+ borderSpacing : 0 ,
214+ tableLayout : 'fixed' ,
215+ width : '100%' ,
216+ } ) )
217+
218+ const MdTh = styled . th ( ( { theme } ) => ( {
219+ padding : theme . spacing . small ,
220+ height : 40 ,
221+ textAlign : 'left' ,
222+ backgroundColor : theme . colors [ 'fill-one' ] ,
223+ border : theme . borders [ 'fill-two' ] ,
224+ borderBottom : theme . borders . default ,
225+ // top rounded table corners
226+ 'tr:first-child &' : {
227+ '&:first-child' : { borderTopLeftRadius : theme . borderRadiuses . large } ,
228+ '&:last-child' : { borderTopRightRadius : theme . borderRadiuses . large } ,
229+ } ,
230+ // remove inner borders
231+ '&:not(:last-child)' : { borderRight : 'none' } ,
232+ '&:not(:first-child)' : { borderLeft : 'none' } ,
233+ } ) )
234+
235+ const MdTd = styled . td ( ( { theme } ) => ( {
236+ backgroundColor : theme . colors [ 'fill-zero-selected' ] ,
237+ padding : `${ theme . spacing . xsmall } px ${ theme . spacing . small } px` ,
238+ color : theme . colors [ 'text-light' ] ,
239+ height : 40 ,
240+ border : theme . borders [ 'fill-two' ] ,
241+ borderBottom : theme . borders . default ,
242+ borderTop : 'none' ,
243+ textAlign : 'left' ,
244+ // bottom row stronger border, rounded corners
245+ 'tr:last-child &' : {
246+ borderBottom : theme . borders [ 'fill-two' ] ,
247+ '&:first-child' : { borderBottomLeftRadius : theme . borderRadiuses . large } ,
248+ '&:last-child' : { borderBottomRightRadius : theme . borderRadiuses . large } ,
249+ } ,
250+ // remove inner borders
251+ '&:not(:last-child)' : { borderRight : 'none' } ,
252+ '&:not(:first-child)' : { borderLeft : 'none' } ,
253+ } ) )
254+
210255function MarkdownImage ( {
211256 src,
212257 gitUrl,
@@ -299,6 +344,9 @@ function Markdown({ text, gitUrl, mainBranch }: MarkdownProps) {
299344 code : render ( { component : InlineCode } ) ,
300345 pre : render ( { component : MarkdownPreformatted } ) ,
301346 hr : render ( { component : MdHr } ) ,
347+ th : render ( { component : MdTh } ) ,
348+ td : render ( { component : MdTd } ) ,
349+ table : render ( { component : MdTable } ) ,
302350 } }
303351 >
304352 { text }
0 commit comments