Transparency when window is deselected on macos

What I’m trying to do

I have written a css snippet:

.workspace-leaf,
.workspace-tab-header-container { background: transparent !important; }
.workspace-split.mod-root, .workspace-split.mod-root .view-content, .workspace-split.mod-root .view-header { background: transparent !important; }
.view-header-title-container:not(.mod-at-end):after { background: transparent !important; }

which makes the window transparent. This works well when I am focused on the app, but when I click on another window, the transparency goes away and the window becomes solid. How can I get the transparency to stay when the window is unfocused?

Things I have tried

Writing custom css, editing the DOM in the inspector, googling.