Jonghakseo / chrome-extension-boilerplate-react-vite

Chrome Extension Boilerplate with React + Vite + Typescript
MIT License
2.44k stars 359 forks source link

If you are using Material-UI components in the ui directory under the packages folder but the CSS is not being applied, how can this be fixed? #785

Open ToBeBetter755 opened 2 hours ago

ToBeBetter755 commented 2 hours ago

/chrome-extension-boilerplate-react-vite/packages/ui/lib/components/Button.tsx

import type { ComponentPropsWithoutRef } from 'react';
import { cn } from '../utils';
import { Button as MuiButton } from '@mui/material';

export type ButtonProps = {
  theme?: 'light' | 'dark';
} & ComponentPropsWithoutRef<'button'>;

export function Button({ theme, className, children }: ButtonProps) {
  return (
    <MuiButton
      color="primary"
      className={cn(
        className,
        'py-1 px-4 rounded shadow hover:scale-105',
        theme === 'light' ? 'bg-white text-black' : 'bg-black text-white',
      )}
    >
      {children}
    </MuiButton>
  );
}
github-actions[bot] commented 2 hours ago

Thank you for your contribution. We will check and reply to you as soon as possible.