Skip to content

Grid, dynamic sidebar/navbar width with main 100% width #1774

Answered by robbyrice
frederikhors asked this question in Help
Discussion options

You must be logged in to vote

Instead of using the grid utilities you might want to look into using the flexbox utilities for this layout. It might look something like this.

<div class="min-h-screen flex">

  <div style="bg-green-500 {`width: ${randomWidth}px !important;`}">
      Sidebar. This has dynamic width.
  </div>

  <div class="bg-red-500 flex-grow">
    Main. This has full width.
  </div>

</div>

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by frederikhors
Comment options

You must be logged in to vote
1 reply
@robbyrice
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants