Skip to content
Merged
Changes from 2 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
2 changes: 1 addition & 1 deletion docs/src/components/productMaterial/MaterialStyling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export default function MaterialStyling() {
overflow: 'auto',
}}
>
<Box sx={{ position: 'relative' }}>
<Box sx={{ position: 'relative', minWidth: 510 }}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't expect to see a hard-coded width. Isn't there a way to make the highlight follow the width of the code content? Perhaps it's in the wrong container?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a way to make the highlight follow the width of the code content?

We can do that with display: 'inline-block'. It lets it size based on its content width. Also, added minWidth: '100%', to ensure it doesn't become smaller that it's container.

<HighlightedCode copyButtonHidden plainStyle code={code} language="jsx" />
<FlashCode startLine={startLine[index]} endLine={endLine[index]} />
</Box>
Expand Down