Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark Theme #82

Open
elicharlese opened this issue Nov 12, 2022 · 0 comments
Open

Dark Theme #82

elicharlese opened this issue Nov 12, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@elicharlese
Copy link
Member

elicharlese commented Nov 12, 2022

Dark

To create a dark theme in TypeScript and MUI, you can create a theme.ts file and set up a custom theme with a dark color scheme. Here's an example:

import { createMuiTheme } from '@material-ui/core/styles';

const theme = createMuiTheme({
  palette: {
    type: 'dark',
    primary: {
      main: '#90caf9',
    },
    secondary: {
      main: '#f48fb1',
    },
  },
});

export default theme;

In this example, we're creating a dark theme with a primary color of #90caf9 and a secondary color of #f48fb1. You can customize the colors to your preference.

To use this theme in your application, you'll need to wrap your app in a ThemeProvider and pass in the theme object. Here's an example:

import React from 'react';
import { ThemeProvider } from '@material-ui/core/styles';
import theme from './theme';

function App() {
  return (
    <ThemeProvider theme={theme}>
      {/* Your app goes here */}
    </ThemeProvider>
  );
}

export default App;

Once you've set up the theme, all MUI components in your app will use the dark color scheme.

Light

import { createTheme } from '@material-ui/core/styles';

const lightTheme = createTheme({
  palette: {
    type: 'light',
    primary: {
      main: '#0069d9',
    },
    secondary: {
      main: '#19857b',
    },
    background: {
      default: '#fff',
      paper: '#fff',
    },
  },
});

export default lightTheme;

In this theme, we set the type of the palette to light and specify the primary and secondary colors using the main property. We also set the background color to white for both the default and paper elements. You can modify these colors to fit your needs.

@elicharlese elicharlese added the bug Something isn't working label Nov 12, 2022
@elicharlese elicharlese self-assigned this Nov 12, 2022
@elicharlese elicharlese added this to the Front-End base for all dapps in Framer milestone Feb 5, 2023
@elicharlese elicharlese removed this from the Front-End base for all dapps in Framer milestone Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant