-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Basic info:
- Node v8.1.2
- jsdom v11.0.0
Minimal reproduction case
const { JSDOM } = require("jsdom");
const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);
dom.window.document.querySelector(":root").style.setProperty('--var', 'red');
dom.window.document.querySelector(":root").style.setProperty('color', 'red');
console.log(dom.window.document.querySelector(":root").style);
// CSSStyleDeclaration {
// '0': 'color',
// _values: { color: 'red' },
// _importants: { '--var': undefined, color: undefined },
// _length: 1,
// _onChange: [Function],
// Var: 'red' }
How does similar code behave in browsers?
Example: https://jsbin.com/xolomolexe/edit?js,console
In other browsers, CSS custom properties get applied like regular style properties.
chharvey, calvellido, btoo, laras126, jednano and 10 more