Skip to content

Commit 3da2298

Browse files
committed
Update prop table styles
1 parent 9a47dea commit 3da2298

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

packages/docusaurus-theme/src/components/prop_table/prop_table.tsx

+28-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
EuiTitle,
1010
useEuiMemoizedStyles,
1111
EuiLink,
12+
EuiPanel,
1213
} from '@elastic/eui';
1314
import {
1415
ProcessedComponent,
@@ -51,6 +52,10 @@ const getPropTableStyles = ({ euiTheme }: UseEuiTheme) => ({
5152
font-weight: ${euiTheme.font.weight.semiBold};
5253
`,
5354
description: css`
55+
p {
56+
font-size: var(--eui-font-size-s);
57+
}
58+
5459
p:first-child {
5560
margin-block-start: 0;
5661
}
@@ -73,6 +78,9 @@ const getPropTableStyles = ({ euiTheme }: UseEuiTheme) => ({
7378
display: inline-block;
7479
}
7580
`,
81+
tableCell: css`
82+
vertical-align: text-top;
83+
`,
7684
});
7785

7886
export const PropTable = ({
@@ -173,6 +181,14 @@ export const PropTable = ({
173181
[definition.displayName]
174182
);
175183

184+
const cellProps = useCallback(
185+
(item: ProcessedComponentProp) => ({
186+
id: getPropId(item, definition.displayName),
187+
css: styles.tableCell,
188+
}),
189+
[definition.displayName]
190+
);
191+
176192
return (
177193
<EuiFlexGroup
178194
aria-label={`Component properties table for ${definition.displayName}`}
@@ -182,19 +198,23 @@ export const PropTable = ({
182198
>
183199
<header css={styles.header}>
184200
{showTitle && (
185-
<EuiTitle size="m">
201+
<EuiTitle size="s">
186202
<HeadingLevel>{definition.displayName}</HeadingLevel>
187203
</EuiTitle>
188204
)}
189205
<PropTableExtendedTypes definition={definition} />
190206
</header>
191-
<EuiBasicTable
192-
css={styles.table}
193-
width="100%"
194-
items={tableItems}
195-
columns={columns}
196-
rowProps={rowProps}
197-
/>
207+
<EuiPanel color="plain" hasBorder>
208+
<EuiBasicTable
209+
css={styles.table}
210+
width="100%"
211+
items={tableItems}
212+
columns={columns}
213+
rowProps={rowProps}
214+
cellProps={cellProps}
215+
compressed
216+
/>
217+
</EuiPanel>
198218
</EuiFlexGroup>
199219
);
200220
};

0 commit comments

Comments
 (0)