How to change the default max-width for Container? #2490
Answered
by
segunadebayo
sjaakbanaan
asked this question in
Q&A
-
So if do just:
How to make sure the max-width is no longer 1440px (the default value for 8xl), but it becomes 1260px instead? Preferably I don't want to overwrite the value for '8xl' in the sizes tokens. How can i use the above code where Container has a max-width of 1260px, without setting a maxWidth prop on it? |
Beta Was this translation helpful? Give feedback.
Answered by
segunadebayo
Apr 8, 2024
Replies: 1 comment 1 reply
-
You need to extend the container pattern and create your own transform Here's an example from Park UI. defineConfig({
patterns: {
extend: {
container: {
transform(props) {
return {
position: 'relative',
width: '100%',
mx: 'auto',
px: { base: '4', md: '6' },
maxWidth: '<INSERT_VALUE>'
...props,
}
},
},
},
}}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
segunadebayo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to extend the container pattern and create your own transform
Here's an example from Park UI.