I feel like most usage of global CSS custom property use has the author putting them into a :root selector like:
:root {
--brand-color: red;
}Code language: CSS (css)
This is just a PSA that you… don’t have to. It’s not required. It has nothing to do with custom properties. It’s just a selector. It happens to select the html element on a website, except for with extra specificity that I’d wager isn’t typically useful. I think the earliest code samples of them in the spec did it that way for whatever reason, and it stuck as a weird niche cultural artifact.