eunchurn / mui-theme

Builderhub Platform Material UI Theme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@builderhub/mui-theme

Publish Package to npmjs npm npm License: MIT

Builderhub Platform Material UI Theme

  • Custom colors
  • Custom breakpoint
  • Custom typography
  • Custom MuiCssBaseline

Installation

  • npm
npm i @builderhub/mui-theme
  • yarn
yarn add @builderhub/mui-theme
  • pnpm
pnpm add @builderhub/mui-theme

Usage

import React from "react";
import { BuilderhubThemeProvider } from "@builderhub/mui-theme";

export function Wrapped() {
  return (
    <BuilderhubThemeProvider>
      <App />
    </BuilderhubThemeProvider>
  );
}

기존 colors를 수정하는 방법

- import { colors } from "context";
+ import { useTheme } from "@mui/material";

// ...omitted
function Component() {
  const { palette } = useTheme();

  - const oldColor = colors.purple_10;
  + const newColor = palette.purple_10;
}

styled 에서 사용

import { styled, Button } from "@mui/material";

export const CustomButton = styled(Button)(({ theme }) => ({
  border: 0,
  background: theme.palette.purple_10,
  width: "5rem",
  height: "2rem",
  borderRadius: theme.shape.borderRadius,
}));

About

Builderhub Platform Material UI Theme


Languages

Language:TypeScript 94.8%Language:JavaScript 3.7%Language:Shell 1.5%