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

340
Views
¿Cómo eliminar las clases predeterminadas de Mui Typography?

Estoy tratando de crear un elemento de tipografía. Vi que agregó un par de clases MUI CSS predeterminadas al depurar en el navegador. Así que traté de deshabilitarlos creando matrices vacías al final de la propiedad sx. no tuvo efecto

Como se muestra en la imagen, quiero deshabilitar esas 2 clases o al menos respetar las propiedades que tengo. Se las arregla para anular mis propiedades con sus propiedades como margen.

ingrese la descripción de la imagen aquí

 <Typography variant="h1" sx={{ width: '100px', height: '55px', fontSize: '20px', fontWeight: 500, lineHeight: '1.2', WebkitLineClamp: 4, WebkitBoxOrient: 'vertical', marginTop: '11px', '& .MuiTypography-h1': {}, '& .MuiTypography-root': {}, }} > Title </Typography>

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

0

Puede usar el componente StylesProvider que le permite cambiar la forma en que se aplican los estilos a los componentes secundarios. Las opciones estarán disponibles en todos los elementos secundarios de StylesProvider . Podemos usar el accesorio booleano injectFirst para agregar estilos que anulan los estilos de interfaz de usuario de material existentes. De esta manera, los estilos a los que se hace referencia desde archivos CSS externos anularán las UI de Material.

 import React from "react"; import StylesProvider from "@mui/styles/StylesProvider/StylesProvider"; import Typography from "@mui/material/Typography/Typography"; import "./styles.css"; export default function CustomTypography() { return ( <StylesProvider injectFirst> <div className="App"> <Typography>Title</Typography> </div> </StylesProvider> ); }

En styles.css , puede agregar css personalizado como este:

 .MuiTypography-h1 { color: blueviolet; } .MuiTypography-root { color: red; }
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!