Files
react-test/test/regressions/fixtures/CssBaseline/MaterialCssBaseline.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

32 lines
1.0 KiB
JavaScript

import * as React from 'react';
import { CssVarsProvider, extendTheme } from '@mui/material/styles';
import Box from '@mui/material/Box';
import CssBaseline from '@mui/material/CssBaseline';
const theme = extendTheme({
colorSchemes: { light: true, dark: true },
colorSchemeSelector: '[data-mui-color-scheme="%s"]',
disableCssColorScheme: true,
});
export default function MaterialCssBaseline() {
return (
<CssVarsProvider theme={theme}>
<CssBaseline enableColorScheme />
<Box sx={{ p: 2, display: 'flex', flexDirection: 'column', gap: 2 }}>
<Box sx={{ width: 300, height: 100, overflow: 'scroll', bgcolor: 'background.paper' }}>
{/* The scrollbar should be light */}
<Box sx={{ height: 1000 }} />
</Box>
<Box
data-mui-color-scheme="dark"
sx={{ width: 300, height: 100, overflow: 'scroll', bgcolor: 'background.paper' }}
>
{/* The scrollbar should be dark */}
<Box sx={{ height: 1000 }} />
</Box>
</Box>
</CssVarsProvider>
);
}