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

311
Views
Material ui estilos de emoción, estilos reutilizables

Bueno, me pregunto, ¿cómo se crearía un estilo reutilizable para material ui? (emoción).

Normalmente, un estilo se puede escribir como:

 import {styled, css, Theme} from "@mui/material"; import IconButton from '@mui/material/IconButton'; import MenuIcon from '@mui/icons-material/Menu'; const StyledMenuButton = styled(IconButton)(` margin-left: 16px; max-height: 48px; `); export const SomeComponent() { return <IconButton> <MenuIcon /> </IconButton> }

Sin embargo, traté de hacer que el fragmento de estilo fuera reutilizable para varios componentes:

 import {styled, Theme} from "@mui/material"; import IconButton from '@mui/material/IconButton'; import MenuIcon from '@mui/icons-material/Menu'; const baseStyle = css` margin-left: 16px; max-height: 48px; `; const StyledMenuButton = styled(IconButton)(`${baseStyle}`); export const SomeComponent() { return <StyledMenuButton> <MenuIcon /> </StyledMenuButton> }

¿Y ahora el estilo ya no carga? ¿Cómo usar estilos reutilizables en emoción?

about 4 years ago · Juan Pablo Isaza
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!