Skip to content
Advertisement

Tag: css-variables

List CSS custom properties (CSS Variables)

I’ve set some CSS custom properties in my stylesheet: I can retrieve them individually if I already know the name of the CSS variable like so: But if I wanted to pull a list of CSS variables and their values out, how would that be done? Answer Update: To catch CORS errors, I added !styleSheet.href && to the first if-statement.

Advertisement