Stretch VisualElement to size of editor window

Hey guys,

Questions in the title. Basically just trying to have my root visual element’s background expand to the size of the editor window, but I can’t find the settings combination to do it. Is it possible?

Thanks

That would be the flex-grow attribute.

You can take a look at this thread on a similar problem: How do you style the root element in uss?

1 Like

Ahh, thank you! I was messing with settings for far too long and was too silly to realize the TemplateContainer was the missing link.

Do you know why the ListView’s Alternating Backgrounds only work with certain styling settings? I had the alternating colors working for a while and then I must’ve changed something and now there is no Alternating Background when set to all. I figure it must be some setting or color I’ve changed but I cant figure it out.

You can use the UI Toolkit Debugger in Window > UI Toolkit > Debugger to see what could possibly override your background colors. That would be the easiest way to find what changed.