Skip to content

Instantly share code, notes, and snippets.

@xtiannyeto
Last active October 15, 2021 16:03
Show Gist options
  • Save xtiannyeto/b1e01797cb2c2daf40c98280cb1f48ab to your computer and use it in GitHub Desktop.
Save xtiannyeto/b1e01797cb2c2daf40c98280cb1f48ab to your computer and use it in GitHub Desktop.
app.tsx
import { Button, createTheme, ThemeProvider } from '@mui/material';
import React from 'react';
import './App.scss';
import styles from './style.module.scss';
function App() {
const theme = createTheme({
palette: {
primary: {
main: styles.colorPrimary
},
secondary: {
main: styles.colorSecondary
},
error: {
main: styles.colorDanger
}
}
});
return (
<div className="App">
<ThemeProvider theme={theme}>
<Button variant="contained">primary</Button>
<Button color="secondary" variant="contained">
secondary
</Button>
<Button color="error" variant="contained">
danger
</Button>
</ThemeProvider>
</div>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment