diff --git a/docs/src/modules/components/ApiPage.js b/docs/src/modules/components/ApiPage.js index abf1775d1768fd..f51d320ae6294c 100644 --- a/docs/src/modules/components/ApiPage.js +++ b/docs/src/modules/components/ApiPage.js @@ -53,11 +53,13 @@ function Heading(props) { return ( - {getTranslatedHeader(t, hash)} - - - - + + {getTranslatedHeader(t, hash)} +
+ + + +
); diff --git a/docs/src/modules/components/ApiPage/sections/ClassesSection.tsx b/docs/src/modules/components/ApiPage/sections/ClassesSection.tsx index bc09404849b40c..63588a4ff1f28a 100644 --- a/docs/src/modules/components/ApiPage/sections/ClassesSection.tsx +++ b/docs/src/modules/components/ApiPage/sections/ClassesSection.tsx @@ -93,16 +93,18 @@ export default function ClassesSection(props: ClassesSectionProps) { - {t(title)} - - - + {t(title)} +
+ + + +
- {t(title)} - - - + {t(title)} +
+ + + +
- {t(title)} - - - +
+ {t(title)} + + + +
- {getTranslatedHeader(t, hash, text)} - - - - + + {getTranslatedHeader(t, hash, text)} +
+ + + +
); diff --git a/docs/src/modules/components/HooksApiContent.js b/docs/src/modules/components/HooksApiContent.js index ded5a05f01e5fa..acb36479c6dd62 100644 --- a/docs/src/modules/components/HooksApiContent.js +++ b/docs/src/modules/components/HooksApiContent.js @@ -27,11 +27,13 @@ function Heading(props) { return ( - {getTranslatedHeader(t, hash, text)} - - - - + + {getTranslatedHeader(t, hash, text)} +
+ + + +
); diff --git a/docs/src/modules/components/MarkdownElement.js b/docs/src/modules/components/MarkdownElement.js index 7554dd0820ceac..371da06d34a5cd 100644 --- a/docs/src/modules/components/MarkdownElement.js +++ b/docs/src/modules/components/MarkdownElement.js @@ -134,26 +134,33 @@ const Root = styled('div')( // Remove scroll on small screens. wordBreak: 'break-all', }, - '& .anchor-link': { + '& .title-link-to-anchor': { + color: 'inherit', + textDecoration: 'none', + position: 'relative', + display: 'flex', + alignItems: 'center', + }, + '& .anchor-icon': { // To prevent the link to get the focus. display: 'inline-flex', alignItems: 'center', visibility: 'hidden', }, - '& a:not(.anchor-link):hover': { + '& a:not(.title-link-to-anchor):hover': { color: 'currentColor', border: 'none', boxShadow: '0 1px 0 0 currentColor', textDecoration: 'none', }, - '& .anchor-link, & .comment-link': { + '& .anchor-icon, & .comment-link': { padding: 0, cursor: 'pointer', alignItems: 'center', justifyContent: 'center', flexShrink: 0, textAlign: 'center', - marginLeft: 4, + marginLeft: 8, height: 26, width: 26, backgroundColor: `var(--muidocs-palette-primary-50, ${lightTheme.palette.grey[50]})`, @@ -174,7 +181,7 @@ const Root = styled('div')( verticalAlign: 'middle', }, }, - '&:hover .anchor-link': { + '&:hover .anchor-icon': { visibility: 'visible', }, '& .comment-link': { @@ -415,7 +422,7 @@ const Root = styled('div')( // Remove link arrow for ads display: 'none', }, - '& a, & a code': { + '& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': { // Style taken from the Link component color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`, fontWeight: theme.typography.fontWeightMedium, @@ -425,7 +432,7 @@ const Root = styled('div')( textDecorationColor: 'inherit', }, }, - '& a code': { + '& a:not(.title-link-to-anchor) code': { color: darken(lightTheme.palette.primary.main, 0.2), }, '& img, & video': { @@ -670,7 +677,7 @@ const Root = styled('div')( color: `var(--muidocs-palette-grey-400, ${darkTheme.palette.grey[400]})`, }, '& h1, & h2, & h3, & h4': { - '&:hover .anchor-link, & .comment-link': { + '&:hover .anchor-icon, & .comment-link': { color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primaryDark[300]})`, borderColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`, backgroundColor: alpha(darkTheme.palette.primaryDark[700], 0.5), @@ -773,10 +780,10 @@ const Root = styled('div')( }, }, }, - '& a, & a code': { + '& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': { color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primary[300]})`, }, - '& a code': { + '& a:not(.title-link-to-anchor) code': { color: `var(--muidocs-palette-primary-light, ${darkTheme.palette.primary.light})`, }, '& kbd.key': { diff --git a/packages/markdown/parseMarkdown.js b/packages/markdown/parseMarkdown.js index a9848f583dce47..00a20879f5f958 100644 --- a/packages/markdown/parseMarkdown.js +++ b/packages/markdown/parseMarkdown.js @@ -364,11 +364,7 @@ function createRender(context) { } return [ - ``, - headingHtml, - ``, - '', - '', + `${headingHtml}
`, ``, diff --git a/packages/markdown/parseMarkdown.test.js b/packages/markdown/parseMarkdown.test.js index 20cf39596a17ab..63ce3631d831ee 100644 --- a/packages/markdown/parseMarkdown.test.js +++ b/packages/markdown/parseMarkdown.test.js @@ -295,9 +295,9 @@ authors: ).to.equal( [ `

Accordion

`, - `

Basic features 🧪

`, - `

Using slots and slotProps

`, - `

Specific example

`, + `

Basic features 🧪

`, + `

Using slots and slotProps

`, + `

Specific example

`, ].join(''), );