D
D
Dmitry2020-09-30 11:14:15
React
Dmitry, 2020-09-30 11:14:15

How to combine selectors in Material-ui?

spanI want to add green color for paragraph and tag . On normal css it will be just:
p, span { color: green }
And how to write it in makeStyles without using duplication?

const useStyles = makeStyles({
  root: {
    '& p': {
      color: 'green',
    },
    '& span': {
      color: 'green',
    }
  },
});

I tried using an array ['& p, & span'], but it doesn't work. I don’t see such an opportunity in the documentation (or I’m looking badly)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question