mirror of
https://github.com/primer/css.git
synced 2024-12-29 09:06:07 +03:00
fix <caption> alignment, add borderSpacing
This commit is contained in:
parent
0e4a5decbe
commit
75e37c6640
@ -1,10 +1,11 @@
|
||||
import styled from 'styled-components'
|
||||
import PropTypes from 'prop-types'
|
||||
import {Box} from '@primer/components'
|
||||
|
||||
const Table = styled.table`
|
||||
display: table !important;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0 4px;
|
||||
border-spacing: ${props => props.borderSpacing};
|
||||
|
||||
tr,
|
||||
td,
|
||||
@ -12,8 +13,10 @@ const Table = styled.table`
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
caption,
|
||||
td,
|
||||
th {
|
||||
padding: 4px 8px !important;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -22,6 +25,14 @@ const Table = styled.table`
|
||||
}
|
||||
`
|
||||
|
||||
Table.propTypes = {
|
||||
borderSpacing: PropTypes.string
|
||||
}
|
||||
|
||||
Table.defaultProps = {
|
||||
borderSpacing: '0 4px'
|
||||
}
|
||||
|
||||
Table.Row = styled(Box).attrs({as: 'tr'})``
|
||||
Table.Cell = styled(Box).attrs({as: 'td'})``
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user