The reasoning for that is intentional apparently:
#778 (comment)
But I think it's still weird that:
let div = document.createElement("div");
div.style.setProperty("--foo", "bar");
Behaves differently to:
let div = document.createElement("div");
div.setAttribute("style", "--foo: bar");
Is this behavior up-for-discussion? I think it is really unfortunate.
cc @andruud @tabatkins