Skip to content

Commit fdd0e86

Browse files
authored
Merge pull request #2212 from pie-framework/fix/PIE-440
fix: tweak table styling rules to exclude role="presentation" PIE-440
2 parents be73dce + dfefed1 commit fdd0e86

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/render-ui/src/preview-prompt.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,24 @@ import * as color from './color';
55
import { renderMath } from '@pie-lib/math-rendering';
66

77
const StyledPromptContainer = styled('div')(({ theme, tagName }) => ({
8+
// presentation tables should not have any custom style
89
// Base promptTable styles
9-
'&:not(.MathJax) > table': {
10+
'&:not(.MathJax) > table:not([role="presentation"])': {
1011
borderCollapse: 'collapse',
1112
},
1213
// Apply vertical striping when first column is a header (th) and NOT mixed with td
13-
'&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':
14+
'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':
1415
{
1516
backgroundColor: '#f6f8fa',
1617
color: theme.palette.common.black,
1718
},
1819
// Apply horizontal striping for tables where first element is a data cell (td)
19-
'&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td': {
20+
'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td': {
2021
backgroundColor: '#f6f8fa',
2122
color: theme.palette.common.black,
2223
},
2324
// align table content to left as per STAR requirement PD-3687
24-
'&:not(.MathJax) table td, &:not(.MathJax) table th': {
25+
'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th': {
2526
padding: '.6em 1em',
2627
textAlign: 'left',
2728
},

0 commit comments

Comments
 (0)