Pass a CSS Variable in Twig
<div id="header-container" style="--bg-url: {{img.getUrl()}}">...</div>
And then,
\#header-container { background-image: url(var(--bg-url); }
Various notes and things I find myself repeating.
Jan 13, 2024
<div id="header-container" style="--bg-url: {{img.getUrl()}}">...</div>
And then,
\#header-container { background-image: url(var(--bg-url); }