using default theme colors material ui

Viewed 273

how to use default theme colors like "primary" or "secondary" in sx property? I don't want to change them, I just want to write sx={{ backgroundColor: "primary" }} or smth like that

1 Answers

You need to be a bit more specific which color you want:

For example to access priamry.main, use:

<Box sx={{ borderColor: 'primary.main' }} />

or for the current text color:

<Box sx={{ color: 'text.secondary' }}>Sessions</Box>

More information

Related