As I update my old mui styling to utilize the sx
attribute, I've noticed the ability to specify styles for different breakpoints using
sx = {{ someCssProp: { xs: ..., md: ...
and so on.
Prior to this, I had been using theme.breakpoints.only
for some of my styles. After reviewing the documentation on breakpoint usage from the official MUI docs, it appears that the xs, md, ...
parameters within sx
will only apply with theme.breakpoints.up
... This means if I want styling specifically at the xs
breakpoint, a code snippet like:
<Box sx={{background: {xs: 'blue'}}}>Some content</Box>
will result in the Box
having a blue background starting from the xs breakpoint...
Is there any way for me to achieve a similar outcome as my previous use of .only
?