diff --git a/benchmark/browser/scenarios/make-styles/index.js b/benchmark/browser/scenarios/make-styles/index.js index 125ef635e122b7..8a21c749f7c666 100644 --- a/benchmark/browser/scenarios/make-styles/index.js +++ b/benchmark/browser/scenarios/make-styles/index.js @@ -1,21 +1,27 @@ import * as React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; +import { createTheme } from '@material-ui/core/styles'; +import { makeStyles } from '@material-ui/styles'; -const useStyles = makeStyles((theme) => ({ - root: { - width: 200, - height: 200, - borderWidth: 3, - borderColor: 'white', - '&:hover': { - backgroundColor: theme.palette.secondary.dark, - }, - [theme.breakpoints.up('sm')]: { - backgroundColor: theme.palette.primary.main, - borderStyle: 'dashed', +const defaultTheme = createTheme(); + +const useStyles = makeStyles( + (theme) => ({ + root: { + width: 200, + height: 200, + borderWidth: 3, + borderColor: 'white', + '&:hover': { + backgroundColor: theme.palette.secondary.dark, + }, + [theme.breakpoints.up('sm')]: { + backgroundColor: theme.palette.primary.main, + borderStyle: 'dashed', + }, }, - }, -})); + }), + { defaultTheme }, +); const Div = React.forwardRef(function Div(props, ref) { const classes = useStyles(); diff --git a/docs/pages/index.tsx b/docs/pages/index.tsx index 7b20ca03015fe7..6d55b630b39402 100644 --- a/docs/pages/index.tsx +++ b/docs/pages/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import Typography from '@material-ui/core/Typography'; +import { experimentalStyled as styled } from '@material-ui/core/styles'; +import Box from '@material-ui/core/Box'; +import Typography, { TypographyProps } from '@material-ui/core/Typography'; import Button from '@material-ui/core/Button'; import Container from '@material-ui/core/Container'; import Steps from 'docs/src/pages/landing/Steps'; @@ -32,82 +33,59 @@ function loadDependencies() { loadScript('https://platform.twitter.com/widgets.js', document.querySelector('head')); } -const useStyles = makeStyles( - (theme) => ({ - root: { - flex: '1 0 100%', - }, - hero: { - paddingTop: theme.spacing(8), - color: theme.palette.primary.main, - }, - content: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - textAlign: 'center', - paddingTop: theme.spacing(4), - paddingBottom: theme.spacing(8), - [theme.breakpoints.up('md')]: { - paddingTop: theme.spacing(16), - paddingBottom: theme.spacing(16), - flexDirection: 'row', - alignItems: 'flex-start', - textAlign: 'left', - }, - }, - title: { - marginLeft: -12, - whiteSpace: 'nowrap', - letterSpacing: '.7rem', - textIndent: '.7rem', - fontWeight: theme.typography.fontWeightLight, - [theme.breakpoints.only('xs')]: { - fontSize: 28, - }, - }, - logo: { - flexShrink: 0, - width: 120, - height: 120, - marginBottom: theme.spacing(2), - [theme.breakpoints.up('md')]: { - marginRight: theme.spacing(8), - width: 195, - height: 175, - }, - }, - button: { - marginTop: theme.spacing(4), - }, - social: { - padding: theme.spacing(2, 0), - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - minHeight: 21, - boxSizing: 'content-box', - '& a': { - color: theme.palette.background.paper, - }, - }, - github: { - width: 105, - display: 'flex', - justifyContent: 'flex-end', - marginRight: theme.spacing(1), - '& span': { - display: 'flex', - }, - }, - twitter: { - width: 160, - display: 'flex', +const Content = styled(Container)(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + textAlign: 'center', + paddingTop: theme.spacing(4), + paddingBottom: theme.spacing(8), + [theme.breakpoints.up('md')]: { + paddingTop: theme.spacing(16), + paddingBottom: theme.spacing(16), + flexDirection: 'row', + alignItems: 'flex-start', + textAlign: 'left', + }, +})); + +const Title = styled(Typography)( + ({ theme }) => ({ + marginLeft: -12, + whiteSpace: 'nowrap', + letterSpacing: '.7rem', + textIndent: '.7rem', + fontWeight: theme.typography.fontWeightLight, + [theme.breakpoints.only('xs')]: { + fontSize: 28, }, }), - { name: 'LandingPage' }, ); +const Logo = styled('img')(({ theme }) => ({ + flexShrink: 0, + width: 120, + height: 120, + marginBottom: theme.spacing(2), + [theme.breakpoints.up('md')]: { + marginRight: theme.spacing(8), + width: 195, + height: 175, + }, +})); + +const Social = styled('div')(({ theme }) => ({ + padding: theme.spacing(2, 0), + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + minHeight: 21, + boxSizing: 'content-box', + '& a': { + color: theme.palette.background.paper, + }, +})); + interface LandingPageProps { sponsorsProps: { docs: object; @@ -121,26 +99,19 @@ export default function LandingPage(props: LandingPageProps) { loadDependencies(); }, []); const t = useTranslate(); - const classes = useStyles(); return ( -
+
-
- - + + +
- + {'MATERIAL-UI'} - </Typography> + {t('strapline')} @@ -148,16 +119,24 @@ export default function LandingPage(props: LandingPageProps) { component={Link} noLinkStyle href="/getting-started/installation" - className={classes.button} + sx={{ mt: 4 }} variant="outlined" > {t('getStarted')}
-
-
-
-
+ + + + Star -
-
+ + Follow -
-
+ + @@ -186,7 +165,7 @@ export default function LandingPage(props: LandingPageProps) {
-
+