No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Proper way to set body width?

    Help
    2
    3
    297
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      khalilm last edited by

      Hi

      I am trying to limit the width of my app to 1280px.

      Currently I set it like this in app.sass

      body 
         max-width: 1280px
         margin: 0 auto
      

      I also set the width of my header in my layout files using the same code. This results in the site being centered and 1280px when my browser is maximized.

      Everything works fine until I attempt to use an overlay such as the Loading plugin or popup a dialog. While the header remains in position, the body gets shifted to the left. In looking at the browser styles, I see that the following css is being injected.

      .q-body--fullscreen-mixin, .q-body--prevent-scroll {
          position: fixed !important;
      }
      

      If I add the following code in app.sass, then everything works as expected

      .q-body--fullscreen-mixin, .q-body--prevent-scroll 
         position: unset !important
      

      I will be the first to admit that css is not my strong point so I am wondering am I completely off the mark in my approach and affect other things I am not aware o? Is there another way to accomplish this that I just missed?

      Any input would be appreciated!

      beets 1 Reply Last reply Reply Quote 0
      • beets
        beets @khalilm last edited by

        @khalilm Maybe better to not target body, and instead:

        #q-app
           max-width: 1280px
           margin: 0 auto
        
        1 Reply Last reply Reply Quote 1
        • K
          khalilm last edited by

          That worked perfectly. Thank you!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post