Skip to content

Commit

Permalink
[docs][system] Fix border color of Boxes in demos of `Configure the s…
Browse files Browse the repository at this point in the history
…x prop` page in dark mode (mui#35961)
  • Loading branch information
ZeeshanTamboli authored Jan 27, 2023
1 parent a41260a commit 0c2caaf
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as React from 'react';
import { createTheme, ThemeProvider, Box, Stack } from '@mui/system';
import { Box, Stack } from '@mui/system';
import { createTheme, ThemeProvider } from '@mui/material/styles';

// Retain type safety.

const theme = createTheme({
unstable_sxConfig: {
// You can now use the background key in sx
// You can now use the borderRadius key in sx
// by providing direct values from the palette
borderRadius: {
themeKey: 'shape',
Expand All @@ -22,9 +23,9 @@ export default function ChangeTheBehaviorSxProp() {
return (
<Stack direction="row" gap={1}>
<ThemeProvider theme={theme}>
<Box sx={{ borderRadius: 'sm', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'md', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'lg', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'sm', border: 1, p: 4 }} />
<Box sx={{ borderRadius: 'md', border: 1, p: 4 }} />
<Box sx={{ borderRadius: 'lg', border: 1, p: 4 }} />
</ThemeProvider>
</Stack>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { createTheme, ThemeProvider, Box, Stack } from '@mui/system';
import { Box, Stack } from '@mui/system';
import { createTheme, ThemeProvider } from '@mui/material/styles';

// Retain type safety.
declare module '@mui/system' {
Expand All @@ -12,7 +13,7 @@ declare module '@mui/system' {

const theme = createTheme({
unstable_sxConfig: {
// You can now use the background key in sx
// You can now use the borderRadius key in sx
// by providing direct values from the palette
borderRadius: {
themeKey: 'shape',
Expand All @@ -29,9 +30,9 @@ export default function ChangeTheBehaviorSxProp() {
return (
<Stack direction="row" gap={1}>
<ThemeProvider theme={theme}>
<Box sx={{ borderRadius: 'sm', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'md', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'lg', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'sm', border: 1, p: 4 }} />
<Box sx={{ borderRadius: 'md', border: 1, p: 4 }} />
<Box sx={{ borderRadius: 'lg', border: 1, p: 4 }} />
</ThemeProvider>
</Stack>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ThemeProvider theme={theme}>
<Box sx={{ borderRadius: 'sm', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'md', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'lg', border: '1px solid black', p: 4 }} />
<Box sx={{ borderRadius: 'sm', border: 1, p: 4 }} />
<Box sx={{ borderRadius: 'md', border: 1, p: 4 }} />
<Box sx={{ borderRadius: 'lg', border: 1, p: 4 }} />
</ThemeProvider>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { createTheme, ThemeProvider, Box, handleBreakpoints } from '@mui/system';
import { Box, handleBreakpoints } from '@mui/system';
import { createTheme, ThemeProvider } from '@mui/material/styles';

const customTheme = createTheme({
unstable_sxConfig: {
Expand Down Expand Up @@ -29,7 +30,7 @@ export default function ExtendSxProp() {
<Box
sx={{
size: 10,
border: '1px solid black',
border: 1,
}}
/>
</ThemeProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { createTheme, ThemeProvider, Box, handleBreakpoints } from '@mui/system';
import { Box, handleBreakpoints } from '@mui/system';
import { createTheme, ThemeProvider } from '@mui/material/styles';

const customTheme = createTheme({
unstable_sxConfig: {
Expand Down Expand Up @@ -29,7 +30,7 @@ export default function ExtendSxProp() {
<Box
sx={{
size: 10,
border: '1px solid black',
border: 1,
}}
/>
</ThemeProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Box
sx={{
size: 10,
border: '1px solid black',
border: 1,
}}
/>
</ThemeProvider>

0 comments on commit 0c2caaf

Please sign in to comment.