Answered you on discord, but you should just be using the Custom Header theme variables in your themes (instead of in your lovelace config). https://maykar.github.io/custom-header/#styling/advanced
Also, this thread is for the discussion of jinja templates in Custom Header. The main Custom Header thread can be found here.