-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
refactor: introduce Table components for use in Markdown #613 #844
refactor: introduce Table components for use in Markdown #613 #844
Conversation
Codecov Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
thead: { | ||
composes: '$hr', | ||
}, | ||
tbody: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create TableBody
and TableRow
component to make styling possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
|
||
export function TableCellRenderer({ classes, header, children }) { | ||
if (header) { | ||
return <th className={cx(classes.td, classes.th)}>{children}</th>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use JSS composition (like in the original version: composes: '$td'
) and avoid classnames, I this it would be a little bit nicer ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
|
||
const styles = ({ space, color, fontFamily }) => ({ | ||
table: { | ||
...paraStyles({ space, color, fontFamily }).para, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should define color and line-height on td, and then we only need margin from Para
which whould be copied here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Thanks, merged! |
This makes it easier for consumers to override individual components in their styleguide, specifically tables in this PR.