Bring an element to front

I have an element that acts like a universally invokable dialog box that is set to dontDestroyOnLoad. How do you bring the element to the front of all UI since setting the z-align in the stylesheet did nothing?

In the panelSettings of a UIDocument you can set the sort order of it.
Put only the Dialog in one and set the sort order to a higher value then the other UIDocuments have.

If you don’t need more than one panel (for example, because of difference in scaling or rendering to texture), we highly suggest you don’t have more than one PanelSettings (each PanelSettings will generate one separate panel). Instead, you can either keep your dialog box in front of everything (by having it as the last sibling) and flipping its display to “Flex” (show) and “None” (hide), or moving it to the last sibling position when you want it to show and moving it back up on the hierarchy to hide it.

Does that mean if I were to have multiple ui documents with the same panel settings asset, there would be a performance dip as well? It’s a bit unrelated to the issue since in this case I do need 2 panels but it would be helpful to know for other applications.

I’m not sure where you got that from, all I said it’s better to keep all your stuff in a single PanelSettings if you don’t need panels with different settings.