Skip to content
Discussion options

You must be logged in to vote

To avoid the padding, you can access the content and remove the q-pa-md class as follows:

from nicegui import Client, ui

@ui.page('/')
def page(client: Client):
    client.content.classes(remove='q-pa-md')
    with ui.column().classes('bg-red window-width window-height'):
        ui.button('Click')

ui.run()

But once you have access to the client, you can also set the background color for the layout directly. This automatically fills the whole screen:

@ui.page('/')
def page(client: Client):
    client.layout.classes('bg-red')
    ui.button('Click')

See #411 for a discussion about how to set the page background color and the ongoing development of a nicer API.

Replies: 3 comments 5 replies

Comment options

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

You must be logged in to vote
4 replies
@falkoschindler
Comment options

@angelhdzmultimedia
Comment options

@falkoschindler
Comment options

@angelhdzmultimedia
Comment options

Comment options

You must be logged in to vote
1 reply
@mdu-adam-williamson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants