Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
Mi estilo hecho por makestyle material ui está anulado por algo

¿Qué puedo hacer para que mis clases de makestyles sean más importantes que el estilo de interfaz de usuario de material predeterminado?

Ese es mi código:

 import { createTheme, ThemeProvider } from '@mui/material/styles'; import { makeStyles, createStyles } from '@mui/styles'; const customTheme = createTheme({ palette: { primary:{ main: '#303030', }, }, components:{ MuiButton:{ styleOverrides: { root: { '&:focus': { background: "#f00", }, '&:hover': { background: "#f00", }, '&::after': { content: '"xd"', color: 'blue', }, }, contained:{ borderRadius:'50%', }, }, variants: [ { props: { variant: 'dashed' }, style: { textTransform: 'none', border: `2px dashed #000000`, }, }, ], }, }, }); const useStyles = makeStyles((theme) => //I tried without createStyles too, no change createStyles({ root: { }, differentButton:{ backgroundColor: 'green', fontSize: '30px', opacity: '80%', }, //tak sie propsy przekazuje foo: (props) => ({ backgroundColor: props.backgroundColor, }), }), ); function App() { const classes = useStyles(); return ( <> <CssBaseline/> <Button className={classes.differentButton}>Different</Button> <RemoveButton variant="contained">Remove Button</RemoveButton> <ThemeProvider theme={customTheme}> <Button className={classes.differentButton}>Different</Button> </ThemeProvider> </> ); }

Está anulado por algo Está anulado por algo (estilo de interfaz de usuario de material predeterminado, creo que sí)

¿Significa que con la personalización de los componentes de la interfaz de usuario del material no puedo usar makeStyles? Sé que también puedo hacer eso con styled() pero me parece mejor la forma makeStyles.

PD. No quiero usar !important en todas partes jaja

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hay varias soluciones.

Puedes usar withStyles , mui v4

conEstilos

Usar emotion style por styled

estilizado

¡También puedes usar !important en material-ui

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!