I am using Material UI components in a React.js project, for some reason I need customization in some components to make it responsive according to screen width.
I have added media query
and pass it as style attribute in the components but not working, any idea?
I am using code like this:
const drawerWidth = {
width: '50%',
'@media(minWidth: 780px)' : {
width: '80%'
}
}
<Drawer
.....
containerStyle = {drawerStyle}
>
</Drawer>
The code is working for the web only, on mobile devices no effect. Even CSS
code is not applying I've checked in the developer console. I am using Material UI version 0.18.7.
Any help would be appreciated.
PS: As per requirement I need to make some changes according to screen size using CSS
.