Files
react-test/docs/data/material/customization/container-queries/ResizableDemo.js
how2ice 005cf56baf
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
init project
2025-12-12 14:26:25 +09:00

48 lines
1006 B
JavaScript

import { styled } from '@mui/material/styles';
import Box from '@mui/material/Box';
const Line = styled('div')(({ theme }) => ({
position: 'absolute',
height: '100vh',
top: 0,
transform: 'translateY(-400px)',
left: 0,
borderLeft: '1px dashed',
borderColor: (theme.vars || theme).palette.divider,
color: (theme.vars || theme).palette.text.secondary,
fontSize: '0.75rem',
fontFamily: 'Menlo, monospace',
'& span': {
position: 'absolute',
top: 'calc(400px - 1em)',
left: 4,
},
}));
export default function ResizableDemo({ children }) {
return (
<Box
sx={{
position: 'relative',
paddingBlock: 2,
ml: 2,
mr: 'auto',
'*:has(> &)': {
overflow: 'hidden',
},
}}
>
<Line>
<span>0px</span>
</Line>
<Line sx={{ left: 350 }}>
<span>350px</span>
</Line>
<Line sx={{ left: 500 }}>
<span>500px</span>
</Line>
{children}
</Box>
);
}