AppLayout content background

Hi, how can I change background of content in AppLayout? I tried [content] selector in css or getContent() method in MainLayout class but it’s not working.

Most often the content area will be filled with whatever view you are on, so if you change the background, it might still be blocked by the view.

The challenge with styling the content is that it’s not an element in itself, but a <slot>.

Ok, I understand. So, how can I change that extra space background to a different color? Look at the screen - red arrow points at background of VerticalLayout component and I want to have same background on that extra space. Is it possible?


It looks like you would want to call setMargin(false) and setHeightFull() on your view

Woah, it worked! Thanks a lot :smile: