:root isn’t global

01/05/2023

Listen ":root isn’t global"

Episode Synopsis

Most developers prefer to keep all their CSS custom properties in one place, and a pattern that has emerged in recent years is to put those on :root, a pseudo-class that targets the topmost element in your document (so that's always <html> on web pages). But just because they're in one place and in the […]
The post :root isn’t global first appeared on Kilian Valkhof.