I just updated my template above to account for this based on some new info I learned yesterday. URLs in CSS/SCSS are strings, which means they need to be quoted. This means you need to use the type
attribute to specify this.
<Set sass=background_image type=string><Field background_image></Set>
.background {
background: url($background_image)
}
If you wanted to use Switch/When like I showed in my reply above, then you can’t sure the type
attribute and would instead just need to add the quotes in manually around "<Field background_image>"
Ultimately I feel like the solution here would be to use L&L to create a dynamic stylesheet with SCSS variables in the document head, but as you found out here, apparently that’s not how WordPress works. Bummer.