+
+
+
@@ -162,9 +165,6 @@ export default function DemoEditor(props: DemoEditorProps) {
__html: t('editorHint'),
}}
/>
-
-
-
{children}
diff --git a/docs/src/modules/components/HighlightedCode.js b/docs/src/modules/components/HighlightedCode.js
index b07c03b3b9ca8c..e613533f1a7283 100644
--- a/docs/src/modules/components/HighlightedCode.js
+++ b/docs/src/modules/components/HighlightedCode.js
@@ -23,6 +23,11 @@ const HighlightedCode = React.forwardRef(function HighlightedCode(props, ref) {
return (
+ {copyButtonHidden ? null : (
+
+
+
+ )}
- {copyButtonHidden ? null : (
-
-
-
- )}
);
diff --git a/docs/src/modules/components/MarkdownElement.js b/docs/src/modules/components/MarkdownElement.js
index 3f6b857e0b45cf..fec99e40a86ea0 100644
--- a/docs/src/modules/components/MarkdownElement.js
+++ b/docs/src/modules/components/MarkdownElement.js
@@ -133,6 +133,7 @@ const Root = styled('div')(
'& .anchor-link': {
// To prevent the link to get the focus.
display: 'inline-flex',
+ alignItems: 'center',
visibility: 'hidden',
},
'& a:not(.anchor-link):hover': {
@@ -142,6 +143,7 @@ const Root = styled('div')(
textDecoration: 'none',
},
'& .anchor-link, & .comment-link': {
+ padding: 0,
cursor: 'pointer',
alignItems: 'center',
justifyContent: 'center',
@@ -151,18 +153,18 @@ const Root = styled('div')(
height: 26,
width: 26,
backgroundColor: `var(--muidocs-palette-primary-50, ${lightTheme.palette.primary[50]})`,
+ color: `var(--muidocs-palette-grey-600, ${lightTheme.palette.grey[600]})`,
border: '1px solid',
borderColor: `var(--muidocs-palette-divider, ${lightTheme.palette.divider})`,
borderRadius: 8,
- color: `var(--muidocs-palette-text-secondary, ${lightTheme.palette.text.secondary})`,
'&:hover': {
backgroundColor: alpha(lightTheme.palette.primary[100], 0.4),
borderColor: `var(--muidocs-palette-primary-100, ${lightTheme.palette.primary[100]})`,
color: `var(--muidocs-palette-primary-main, ${lightTheme.palette.primary.main})`,
},
'& svg': {
- height: '14px',
- width: '14px',
+ height: 14,
+ width: 14,
fill: 'currentColor',
pointerEvents: 'none',
verticalAlign: 'middle',
@@ -178,8 +180,8 @@ const Root = styled('div')(
duration: theme.transitions.duration.shortest,
}),
'& svg': {
- verticalAlign: 'middle',
fill: 'currentColor',
+ marginRight: 1.5,
},
},
},
@@ -450,6 +452,12 @@ const Root = styled('div')(
// Font size reset to fix a bug with Safari 16.0 when letterSpacing is set
fontSize: 10,
},
+ '& .MuiCode-copy-container': {
+ // This container is only used in demo and highlight code
+ position: 'sticky',
+ zIndex: 1,
+ top: 0,
+ },
'& .MuiCode-copy': {
display: 'inline-flex',
flexDirection: 'row-reverse',
@@ -458,7 +466,7 @@ const Root = styled('div')(
height: 26,
cursor: 'pointer',
position: 'absolute',
- top: theme.spacing(1.5),
+ top: 12,
right: 12,
padding: theme.spacing(0.5),
fontFamily: 'inherit',
@@ -479,16 +487,16 @@ const Root = styled('div')(
flexShrink: 0,
fontSize: '18px',
margin: 'auto',
- opacity: 0.6,
+ opacity: 0.5,
},
'& .MuiCode-copied-icon': {
display: 'none',
},
'&:hover, &:focus': {
+ backgroundColor: lightTheme.palette.primaryDark[600],
'& svg': {
opacity: 1,
},
- backgroundColor: lightTheme.palette.primaryDark[500],
'& .MuiCode-copyKeypress': {
display: 'block',
// Approximate no hover capabilities with no keyboard
@@ -576,9 +584,9 @@ const Root = styled('div')(
},
'& h1, & h2, & h3, & h4': {
'&:hover .anchor-link, & .comment-link': {
- color: `var(--muidocs-palette-primary-200, ${darkTheme.palette.primary[200]})`,
+ color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primaryDark[300]})`,
borderColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`,
- backgroundColor: alpha(darkTheme.palette.primary[900], 0.5),
+ backgroundColor: alpha(darkTheme.palette.primary[900], 0.3),
'&:hover': {
borderColor: `var(--muidocs-palette-primary-900, ${darkTheme.palette.primary[900]})`,
backgroundColor: alpha(darkTheme.palette.primary[900], 0.6),
diff --git a/packages/markdown/prepareMarkdown.js b/packages/markdown/prepareMarkdown.js
index 8af10d4a47c5f8..296a6fdafe3cb4 100644
--- a/packages/markdown/prepareMarkdown.js
+++ b/packages/markdown/prepareMarkdown.js
@@ -169,7 +169,7 @@ ${headers.hooks
rendered.unshift(
`
`,
);