Skip to content

Commit

Permalink
style clean-ups around the HighlightedCode component
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal committed Apr 26, 2024
1 parent 19e8967 commit 2e71ae3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
4 changes: 1 addition & 3 deletions docs/src/components/action/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ const FrameInfo = React.forwardRef<HTMLDivElement, BoxProps>(function FrameInfo(
borderColor: 'primaryDark.700',
borderTop: 0,
colorScheme: 'dark',
'* pre, code': {
bgcolor: 'common.black',
},
overflow: 'clip',
...props.sx,
}}
/>
Expand Down
5 changes: 2 additions & 3 deletions docs/src/components/productBaseUI/BaseUIComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ export default function BaseUIComponents() {
<Frame.Info
data-mui-color-scheme="dark"
sx={{
height: 360,
position: 'relative',
overflow: 'hidden',
p: 0,
pt: 5,
height: 360,
position: 'relative',
}}
>
<Box
Expand Down
10 changes: 3 additions & 7 deletions docs/src/components/productBaseUI/BaseUICustomization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { styled } from '@mui/system';
import clsx from 'clsx';
import { Switch as SwitchUnstyled } from '@mui/base/Switch';
import { useSwitch, UseSwitchParameters } from '@mui/base/useSwitch';
import Box from '@mui/material/Box';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
Expand Down Expand Up @@ -301,15 +300,12 @@ export default function BaseUICustomization() {
ref={infoRef}
sx={{
maxHeight: 450,
position: 'relative',
overflow: 'auto',
}}
>
<Box sx={{ position: 'relative', '&& pre': { bgcolor: 'transparent' } }}>
<Box sx={{ position: 'relative', zIndex: 1 }}>
<HighlightedCode copyButtonHidden plainStyle code={code} language="jsx" />
</Box>
<FlashCode startLine={startLine[index]} endLine={endLine[index]} sx={{ mx: -1 }} />
</Box>
<HighlightedCode copyButtonHidden plainStyle code={code} language="jsx" />
<FlashCode startLine={startLine[index]} endLine={endLine[index]} sx={{ mx: 1 }} />
</Frame.Info>
</Frame>
</Grid>
Expand Down
1 change: 0 additions & 1 deletion docs/src/components/productMaterial/MaterialComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ export default function MaterialComponents() {
minHeight: 220,
maxHeight: demo === 'Table' ? 260 : 'none',
position: 'relative',
overflow: 'hidden',
p: 0,
pt: 5,
}}
Expand Down
9 changes: 3 additions & 6 deletions docs/src/components/productMaterial/MaterialStyling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,11 @@ export default function MaterialStyling() {
sx={{
maxHeight: index === 2 ? 282 : 400,
overflow: 'auto',
position: 'relative',
}}
>
<Box sx={{ position: 'relative', '&& pre': { bgcolor: 'transparent' } }}>
<Box sx={{ position: 'relative', zIndex: 1 }}>
<HighlightedCode copyButtonHidden plainStyle code={code} language="jsx" />
</Box>
<FlashCode startLine={startLine[index]} endLine={endLine[index]} sx={{ mx: -1 }} />
</Box>
<HighlightedCode copyButtonHidden plainStyle code={code} language="jsx" />
<FlashCode startLine={startLine[index]} endLine={endLine[index]} sx={{ mx: 1 }} />
</Frame.Info>
</Frame>
</Grid>
Expand Down

0 comments on commit 2e71ae3

Please sign in to comment.