Is there a way to enable the module header conditionally based on a variable?

I’m deploying a Workshop module via Marketplace and would like to use installation parameters to conditionally show a slim module header when a user is in the DEV or TEST namespaces/environments, and hide it entirely when in PROD.

I’d also like to be able to use a string variable to set a custom background color for the header (blue in DEV and orange in TEST).

I see conditional visibility isn’t available for the module header by default - are there any workarounds to potentially achieve this? (there are a number of embedded modules and pages, so I’d ideally like to not have to create a section in each of the pages to achieve this outcome)

There isn’t a great way to do this. The workaround here is to use a toolbar section as a module header.

The toolbar section supports conditional visibility and can hold the same widgets and have the same formatting as the module header.