Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// https://github.com/alphagov/govuk-frontend/blob/master/src/components/table/_table.scss
import styled from 'styled-components';
import { FONT_WEIGHTS } from '@govuk-react/constants';
const Caption = styled('caption')({
fontWeight: FONT_WEIGHTS.bold,
display: 'table-caption',
textAlign: 'left',
});
export default Caption;
({ numeric, alignRight = numeric, bold }) => ({
padding: `${SPACING_POINTS[2]}px ${SPACING_POINTS[4]}px ${SPACING_POINTS[2]}px 0`,
borderBottom: `1px solid ${BORDER_COLOUR}`,
textAlign: alignRight ? 'right' : 'left',
fontWeight: bold ? FONT_WEIGHTS.bold : undefined,
':last-child': {
paddingRight: 0,
},
}),
({ numeric, isHeader }) => (numeric && !isHeader ? typography.font({ tabular: true }) : undefined),