Use table/table-cell display for reliable vertical centering

Wrap text in nested spans using display: inline-table on outer
and display: table-cell with vertical-align: middle on inner.
This is a classic centering technique that html2canvas should handle.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
michael 2026-01-27 15:09:14 -06:00
parent bfee60399c
commit 8ba0f01e20

View file

@ -75,8 +75,10 @@ const RagStatusBadge: React.FC<{ status: RagStatus }> = ({ status }) => {
}
return (
<span style={{ backgroundColor: bgColor, color: textColor, borderRadius: '9999px', fontSize: '12px', fontWeight: 'bold', display: 'inline-block', minWidth: '50px', textAlign: 'center', height: '24px', lineHeight: '24px', verticalAlign: 'middle', paddingLeft: '12px', paddingRight: '12px', paddingTop: '0', paddingBottom: '0', boxSizing: 'border-box' }}>
{status}
<span style={{ backgroundColor: bgColor, borderRadius: '9999px', display: 'inline-table', height: '22px', minWidth: '50px', paddingLeft: '12px', paddingRight: '12px' }}>
<span style={{ display: 'table-cell', verticalAlign: 'middle', textAlign: 'center', color: textColor, fontSize: '12px', fontWeight: 'bold' }}>
{status}
</span>
</span>
);
};