Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
878e107
AppBar
siriwatknp May 19, 2022
0f876ce
Chip
siriwatknp May 19, 2022
fd5022b
FilledInput
siriwatknp May 19, 2022
6ce82c9
LinearProgress
siriwatknp May 19, 2022
b64dcf6
OutlinedInput
siriwatknp May 19, 2022
e4d1ec7
Skeleton
siriwatknp May 19, 2022
8eb3c25
Slider
siriwatknp May 19, 2022
df07e92
SnackbarContent
siriwatknp May 19, 2022
328d2bf
StepConnector
siriwatknp May 19, 2022
4f05cce
StepContent
siriwatknp May 19, 2022
2da19e4
Switch
siriwatknp May 19, 2022
14b38da
TableCell
siriwatknp May 19, 2022
626edc0
fix Chip
siriwatknp May 20, 2022
621f8d5
check table cell
siriwatknp May 20, 2022
f7f5a99
add component tokens
siriwatknp May 20, 2022
82286e5
fix tests
siriwatknp May 20, 2022
8e335f4
Merge branch 'master' of https://github.com/mui/material-ui into mate…
siriwatknp May 24, 2022
dd910d8
fix Chip
siriwatknp May 24, 2022
1c4216b
remove optional chaining
siriwatknp May 24, 2022
0b2e29b
move skeleton var to palette
siriwatknp May 24, 2022
17e1c75
Merge branch 'master' of https://github.com/mui/material-ui into mate…
siriwatknp May 28, 2022
d024770
use getColorSchemeSelector util
siriwatknp May 28, 2022
5b87b06
Merge branch 'master' of https://github.com/mui/material-ui into mate…
siriwatknp Jun 7, 2022
3ffaf12
Merge branch 'master' of https://github.com/mui/material-ui into mate…
siriwatknp Jun 13, 2022
448d2b8
replace grey.dark with Tooltip.bgColor
siriwatknp Jun 15, 2022
bd55bf4
add selectedChannel token
siriwatknp Jun 15, 2022
65af214
Merge branch 'master' of https://github.com/mui/material-ui into mate…
siriwatknp Jun 15, 2022
49aa943
rename AppBar
siriwatknp Jun 15, 2022
309414f
fix Chip naming
siriwatknp Jun 15, 2022
a2a3ba5
fix FilledInput nameing
siriwatknp Jun 15, 2022
9c853ed
fix LinearProgress naming
siriwatknp Jun 15, 2022
f28084d
fix Skeleton naming
siriwatknp Jun 15, 2022
6ae67ea
fix SnackbarContent naming
siriwatknp Jun 15, 2022
7aa8424
fix Step naming
siriwatknp Jun 15, 2022
95bf84b
fix table cell naming
siriwatknp Jun 15, 2022
e5f7592
fix Tooltip naming
siriwatknp Jun 15, 2022
9f2d7cf
fix opacity placholder naming
siriwatknp Jun 15, 2022
af6c851
fix tests
siriwatknp Jun 15, 2022
989d1ca
rename --md to --mui
siriwatknp Jun 15, 2022
78093c1
fix AppBar enableColorOnDark
siriwatknp Jun 16, 2022
aca5718
fix types
siriwatknp Jun 16, 2022
44d1e3c
Apply suggestions from code review
siriwatknp Jun 17, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const CustomButton = styled(Button)(({ theme }) => ({

// Custom button using CSS variables
const CssVarsCustomButton = styled(Button)({
'--md-palette-primary-main': '#FF0000',
'--md-palette-primary-dark': '#8B0000',
'--md-palette-primary-mainChannel': colorChannel('#FF0000'), // necessary for calculating the alpha values
'--mui-palette-primary-main': '#FF0000',
'--mui-palette-primary-dark': '#8B0000',
'--mui-palette-primary-mainChannel': colorChannel('#FF0000'), // necessary for calculating the alpha values
});

const useEnhancedEffect =
Expand Down
118 changes: 118 additions & 0 deletions docs/pages/experiments/material-ui/app-bar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import * as React from 'react';
import {
Experimental_CssVarsProvider as CssVarsProvider,
useColorScheme,
} from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import AppBar from '@mui/material/AppBar';
import Box from '@mui/material/Box';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import Button from '@mui/material/Button';
import IconButton from '@mui/material/IconButton';
import MenuIcon from '@mui/icons-material/Menu';
import Container from '@mui/material/Container';
import Moon from '@mui/icons-material/DarkMode';
import Sun from '@mui/icons-material/LightMode';

const ColorSchemePicker = () => {
const { mode, setMode } = useColorScheme();
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return null;
}

return (
<Button
variant="outlined"
onClick={() => {
if (mode === 'light') {
setMode('dark');
} else {
setMode('light');
}
}}
>
{mode === 'light' ? <Moon /> : <Sun />}
</Button>
);
};

export default function CssVarsTemplate() {
return (
<CssVarsProvider>
<CssBaseline />
<Container sx={{ my: 5 }}>
<Box sx={{ pb: 2 }}>
<ColorSchemePicker />
</Box>
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(256px, 1fr))',
gridAutoRows: 'minmax(160px, auto)',
gap: 2,
'& > div': {
placeSelf: 'center',
},
}}
>
<AppBar position="static" color="default" enableColorOnDark>
<Toolbar>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
News
</Typography>
<Button color="inherit">Login</Button>
</Toolbar>
</AppBar>
<AppBar position="static" enableColorOnDark>
<Toolbar>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
News
</Typography>
<Button color="inherit">Login</Button>
</Toolbar>
</AppBar>
<AppBar position="static" color="primary" elevation={12}>
<Toolbar>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
News
</Typography>
<Button color="inherit">Login</Button>
</Toolbar>
</AppBar>
</Box>
</Container>
</CssVarsProvider>
);
}
78 changes: 78 additions & 0 deletions docs/pages/experiments/material-ui/chip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import * as React from 'react';
import {
Experimental_CssVarsProvider as CssVarsProvider,
useColorScheme,
} from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Container from '@mui/material/Container';
import Moon from '@mui/icons-material/DarkMode';
import Sun from '@mui/icons-material/LightMode';
import Chip from '@mui/material/Chip';
import Stack from '@mui/material/Stack';

const ColorSchemePicker = () => {
const { mode, setMode } = useColorScheme();
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return null;
}

return (
<Button
variant="outlined"
onClick={() => {
if (mode === 'light') {
setMode('dark');
} else {
setMode('light');
}
}}
>
{mode === 'light' ? <Moon /> : <Sun />}
</Button>
);
};

export default function CssVarsTemplate() {
return (
<CssVarsProvider>
<CssBaseline />
<Container sx={{ my: 5 }}>
<Box sx={{ pb: 2 }}>
<ColorSchemePicker />
</Box>
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(256px, 1fr))',
gridAutoRows: 'minmax(160px, auto)',
gap: 2,
'& > div': {
placeSelf: 'center',
},
}}
>
<Stack spacing={1} alignItems="center">
<Stack direction="row" spacing={1}>
<Chip label="primary" color="primary" />
<Chip label="success" color="success" />
</Stack>
<Stack direction="row" spacing={1}>
<Chip label="primary" color="primary" variant="outlined" />
<Chip label="success" color="success" variant="outlined" />
</Stack>
<Stack direction="row" spacing={1}>
<Chip label="Deletable" onDelete={() => {}} />
<Chip label="Deletable" variant="outlined" onDelete={() => {}} />
</Stack>
</Stack>
</Box>
</Container>
</CssVarsProvider>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { teal, deepOrange, orange, cyan } from '@mui/material/colors';
const COLORS = ['primary', 'secondary', 'error', 'info', 'warning', 'success'];

const overrideCssVariables = {
'--md-palette-primary-main': '#FF0000',
'--md-palette-primary-mainChannel': '255 0 0',
'--md-palette-primary-dark': '#8b0000',
'--mui-palette-primary-main': '#FF0000',
'--mui-palette-primary-mainChannel': '255 0 0',
'--mui-palette-primary-dark': '#8b0000',
};

const ColorSchemePicker = () => {
Expand Down
72 changes: 72 additions & 0 deletions docs/pages/experiments/material-ui/filled-input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import * as React from 'react';
import {
Experimental_CssVarsProvider as CssVarsProvider,
useColorScheme,
} from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Container from '@mui/material/Container';
import FilledInput from '@mui/material/FilledInput';
import OutlinedInput from '@mui/material/OutlinedInput';
import Moon from '@mui/icons-material/DarkMode';
import Sun from '@mui/icons-material/LightMode';

const ColorSchemePicker = () => {
const { mode, setMode } = useColorScheme();
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return null;
}

return (
<Button
variant="outlined"
onClick={() => {
if (mode === 'light') {
setMode('dark');
} else {
setMode('light');
}
}}
>
{mode === 'light' ? <Moon /> : <Sun />}
</Button>
);
};

export default function CssVarsTemplate() {
return (
<CssVarsProvider>
<CssBaseline />
<Container sx={{ my: 5 }}>
<Box sx={{ pb: 2 }}>
<ColorSchemePicker />
</Box>
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(256px, 1fr))',
gridAutoRows: 'minmax(160px, auto)',
gap: 2,
'& > div': {
placeSelf: 'center',
},
}}
>
<FilledInput placeholder="Placeholder" />
<FilledInput placeholder="Placeholder" color="secondary" />
<FilledInput placeholder="Placeholder" disabled />
<FilledInput placeholder="Placeholder" error />
<OutlinedInput placeholder="Placeholder" />
<OutlinedInput placeholder="Placeholder" color="secondary" />
<OutlinedInput placeholder="Placeholder" disabled />
<OutlinedInput placeholder="Placeholder" error />
</Box>
</Container>
</CssVarsProvider>
);
}
72 changes: 72 additions & 0 deletions docs/pages/experiments/material-ui/linear-progress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import * as React from 'react';
import {
Experimental_CssVarsProvider as CssVarsProvider,
useColorScheme,
} from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Container from '@mui/material/Container';
import Stack from '@mui/material/Stack';
import LinearProgress from '@mui/material/LinearProgress';
import Moon from '@mui/icons-material/DarkMode';
import Sun from '@mui/icons-material/LightMode';

const ColorSchemePicker = () => {
const { mode, setMode } = useColorScheme();
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return null;
}

return (
<Button
variant="outlined"
onClick={() => {
if (mode === 'light') {
setMode('dark');
} else {
setMode('light');
}
}}
>
{mode === 'light' ? <Moon /> : <Sun />}
</Button>
);
};

export default function CssVarsTemplate() {
return (
<CssVarsProvider>
<CssBaseline />
<Container sx={{ my: 5 }}>
<Box sx={{ pb: 2 }}>
<ColorSchemePicker />
</Box>
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(256px, 1fr))',
gridAutoRows: 'minmax(160px, auto)',
gap: 2,
'& > div': {
placeSelf: 'center',
},
}}
>
<Stack sx={{ width: '100%', color: 'grey.500' }} spacing={2}>
<LinearProgress />
<LinearProgress color="secondary" />
<LinearProgress color="success" />
<LinearProgress color="error" />
<LinearProgress color="warning" />
<LinearProgress color="inherit" />
</Stack>
</Box>
</Container>
</CssVarsProvider>
);
}
Loading