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

187
Views
Syntax for childselector in CSS/JSS using MUI v4 overrides

In my code (react) I have this autogenerated nested(!) theme rule from JSS MUI:

.MuiGrid-spacing-xs-4-348 > .MuiGrid-item-324 {
    padding: 16px;
}

I want to adress this rule using:

createTheme(theme, {
    overrides: {
      MuiGrid: {
        'spacing-xs-4': {
          width: "100%",
          margin: 0,

          // what to write here? This doesn't work:
          // '& .MuiGrid-item' : {
          //   border: 20px solid pink,
          // },
          },
        },
      },
    },
    
  });

What do I have to write?


Whenever some JSS/MuiDev is reading this:

I find it kind nonsense to switch key syntax to CSS-like Strings for the purpose to assign rules to MUI generated classes.

I have to write:

MuiGrid: {
        'spacing-xs-4': {

(Or is there any other way?) instead of e.g:

MuiGrid: {
        spacing: {
            xs: {
                4: {

Wouldn't that make much more sense?

Thank you for helpful comments!

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!