Style error when custom max-width
See original GitHub issueDescribe the bug


Reproduction
When I custom the max-width use --vp-layout-max-width: 1680px;
Then style of sidebar is ugly when I resize the window.
Expected behavior
The title of the header and the sidebar are always aligned.
System Info
System:
OS: macOS 12.4
CPU: (10) arm64 Apple M1 Max
Memory: 1.91 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
Yarn: 1.22.18 - /opt/homebrew/bin/yarn
npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm
Browsers:
Chrome: 104.0.5112.79
Firefox: 101.0
Safari: 15.5
npmPackages:
vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
max-width - CSS: Cascading Style Sheets - MDN Web Docs
The max-width CSS property sets the maximum width of an element. It prevents the used value of the width property from becoming larger...
Read more >Why would max-width not work on this? - Stack Overflow
For max-width to work correctly, your element first needs a certain width . Use 100% to achieve what you want. See here:.
Read more >CSS syntax error in tag 'style amp-custom' - WordPress.org
Hello, I am experiencing a AMP warning from google search console. I inquired with the WordPress developers and they said it was best...
Read more >CSS Layout - width and max-width - W3Schools
Note: The problem with the <div> above occurs when the browser window is smaller than the width of the element. The browser then...
Read more >Overview - Bootstrap
Choose from a responsive, fixed-width container (meaning its max-width changes at ... and then show at the `sm` breakpoint .custom-class { display: none;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@media (min-width: xxxx)
How @media dynamic setting? I don’t konw.
by js ?
maxWidth by config.js instead of css?
Okay, so what can we fix here at VitePress? I don’t think we can use var inside media queries.