question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could you implement withStyles in tss-react too? It’s convenient when just want to overwrite the style of a Mui Component.

const StyledLinearProgress = withStyles(LinearProgress)({
    root: {},
    // other LinearProgressProps.classes properties...
})

_Originally posted by @Jack-Works in https://github.com/mui-org/material-ui/issues/26571#issuecomment-903371766_

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
garronejcommented, Sep 24, 2021

not yet, but I hope I’ll find the time to finalize it by Monday.

1reaction
LabuzzMichalcommented, Oct 8, 2021

Hi @garronej, withStyles works like a charm 😃

The only difference I noticed comparing to MUI withStyles is lack of possibility to write combined styles like below

const MyButton = withStyles(Button, (theme) => ({
  root: {
    borderColor: [theme.palette.grey[700], "!important"],
  },
}));

However it works fine if I just add these values

const MyButton = withStyles(Button, (theme) => ({
  root: {
    borderColor: theme.palette.grey[700] + " !important",
  },
}));
Read more comments on GitHub >

github_iconTop Results From Across the Web

@mui/styles (LEGACY) - MUI System
@mui/styles is the legacy styling solution for MUI. It depends on JSS as a styling solution, which is not used in the @mui/material...
Read more >
What is the benefit of using withStyles over makeStyles?
If you are customizing the styles of a Material-UI component, using withStyles is preferable to wrapping it with your own component solely for ......
Read more >
Material-UI makeStyles, useStyles, createStyles, and ...
Material-UI withStyles was the primary method for wrapping a component and passing style props to it. It is still a valid method to...
Read more >
withStyles - TSS - Setup
withStyles. It's like the material-ui v4 higher-order component API but type safe by design. IMPORTANT NOTICE: Don't be afraid to use as const...
Read more >
makeStyles, useStyles, withStyles, and createStyles - YouTube
Do you want to build a full MUI app from beginning to end, learn every aspect of the sx prop, styled API, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found