- Currently, I am utilizing Next.js alongside Material-UI as the framework of choice.
- Within my project, there is a Layout component that encapsulates the content with Material-UI's
<Container>
. - I desire to customize the style of the Layout component in order to remove the width limitations on the background and have it span across the entire screen.
components/Layout.js
import { Container } from '@material-ui/core';
export default function Layout({ children }) {
return <Container>{children}</Container>;
}
pages/_app.js
import Layout from '../components/Layout';
...
<Layout>
<Component {...pageProps} />
</Layout>
...
pages/index.js
export default function App() {
return (
<div style={{ backgroundColor: "yellow" }}>
Home Page
</div>
)
}
https://i.stack.imgur.com/ulahn.png
Using the Layout component proves useful for most scenarios, but there are instances where I need to supersede specific styles within Layout from the child components.
In this particular situation, how can I override the style of the Layout component that enforces a maxWidth constraint?
I attempted to include {width: '100vw'}
within the styles of pages/index.js, however, it was ineffective.
Any guidance on this matter would be greatly appreciated.