Skip to content

Commit

Permalink
revert changes in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 3, 2019
1 parent ab45677 commit 117bced
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
1 change: 1 addition & 0 deletions docs/src/pages/components/text-fields/FormattedInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function NumberFormatCustom(props: NumberFormatCustomProps) {
});
}}
thousandSeparator
isNumericString
prefix="$"
/>
);
Expand Down
36 changes: 0 additions & 36 deletions docs/src/pages/customization/palette/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ Note that `contrastThreshold` follows a non-linear curve.
## Example

{{"demo": "pages/customization/palette/Palette.js"}}
{{"demo": "pages/customization/palette/Palette.tsx"}}

## Color tool

Expand Down Expand Up @@ -178,41 +177,6 @@ const theme = createMuiTheme({

{{"demo": "pages/customization/palette/DarkTheme.js"}}

### User preference

Users might have specified a preference for a light or dark theme.
The method by which the user expresses their preference can vary. It might be a system-wide setting exposed by the Operating System, or a setting controlled by the User Agent.

You can leverage this preference dynamically with the [useMediaQuery](/components/use-media-query/) hook and the [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media query.

For instance, you can enable the dark mode automatically:

```jsx
import React from 'react';
import useMediaQuery from '@material-ui/core/useMediaQuery';
import { ThemeProvider } from '@material-ui/core/styles';

function App() {
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');

const theme = React.useMemo(
() =>
createMuiTheme({
palette: {
type: prefersDarkMode ? 'dark' : 'light',
},
}),
[prefersDarkMode],
);

return (
<ThemeProvider theme={theme}>
<Routes />
</ThemeProvider>
);
}
```

## Default values

You can explore the default values of the palette using [the theme explorer](/customization/default-theme/?expend-path=$.palette) or by opening the dev tools console on this page (`window.theme.palette`).

0 comments on commit 117bced

Please sign in to comment.