Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] Add a general round of polish to the API content display #38282

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/src/modules/components/ApiPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ import { ${pageContent.name} } from '${source}';`}
componentName={pageContent.name}
classDescriptions={classDescriptions}
/>
<Divider />
</React.Fragment>
) : null}
<DesignInfo />
Expand Down
6 changes: 3 additions & 3 deletions docs/src/modules/components/ApiPage/ApiItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const Root = styled('div')<{ ownerState: { type?: DescriptionType } }>(
},
'& .MuiApi-item-description': {
padding: '4px 6px',
flexGrow: 1,
textOverflow: 'ellipsis',
overflow: 'hidden',
whiteSpace: 'nowrap',
Expand All @@ -77,9 +76,10 @@ const Root = styled('div')<{ ownerState: { type?: DescriptionType } }>(
placeItems: 'end',
},
'& .MuiApi-item-note': {
padding: '2px 6px',
paddingTop: 5,
fontSize: 11,
letterSpacing: '1px',
lineHeight: 1.6,
textTransform: 'uppercase',
color: `var(--muidocs-palette-success-800, ${lightTheme.palette.success[800]})`,
fontWeight: theme.typography.fontWeightBold,
Expand Down Expand Up @@ -135,7 +135,7 @@ const Root = styled('div')<{ ownerState: { type?: DescriptionType } }>(
backgroundColor: `var(--muidocs-palette-primary-50, ${lightTheme.palette.primary[50]})`,
},
'&>hr': {
margin: '20px 0',
margin: '18px 0',
},
}),
({ theme }) => ({
Expand Down
25 changes: 8 additions & 17 deletions docs/src/modules/components/ApiPage/SlotsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ const StyledApiItem = styled(ApiItem)(
'.slot-classname, .slot-default-element': {
...theme.typography.body2,
fontWeight: theme.typography.fontWeightSemiBold,
},
'& .slot-description-title': {
...theme.typography.body2,
fontWeight: theme.typography.fontWeightSemiBold,
paddingRight: 5,
whiteSpace: 'nowrap',
marginBottom: 8,
},
}),
({ theme }) => ({
Expand Down Expand Up @@ -50,26 +45,22 @@ export default function SlotsList(props: SlotsListProps) {
note=""
type="slots"
>
{slotDescriptions[name] && (
<p
dangerouslySetInnerHTML={{
__html: slotDescriptions[name] || '',
}}
/>
)}
<p className="slot-default-element">
<span>{t('api-docs.default')}:</span> <code className="Api-code">{defaultValue}</code>
</p>

{className && (
<p className="slot-classname">
<span>{t('api-docs.globalClass')}:</span>{' '}
<code dangerouslySetInnerHTML={{ __html: className }} className="Api-code" />
</p>
)}
{slotDescriptions[name] && (
<p>
<span className="slot-description-title">{t('api-docs.description')}:</span>{' '}
<span
dangerouslySetInnerHTML={{
__html: slotDescriptions[name] || '',
}}
/>
</p>
)}
</StyledApiItem>
);
})}
Expand Down
1 change: 0 additions & 1 deletion docs/src/modules/components/PropertiesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const StyledApiItem = styled(ApiItem)(
backgroundColor: `var(--muidocs-palette-primaryDark-800, ${lightTheme.palette.primaryDark[800]})`,
},
},
marginBottom: 36,
}),
({ theme }) => ({
[`:where(${theme.vars ? '[data-mui-color-scheme="dark"]' : '.mode-dark'}) &`]: {
Expand Down