var s = document.body.style;
var cs = getComputedStyle(document.body);
s.cssText = "--a:a; --b:var(--a)b; counter-reset:var(--b)";
cs.counterReset; // "a 0 b 0" or equivalent
cs.getPropertyValue("--b"); // ???
I have noticed that Firefox serializes --b as "a/**/b". this is nice, because then
s.setProperty("--b", cs.getPropertyValue("--b"));
cs.counterReset; // still "a 0 b 0"
However, Blink serializes --b as "ab", so
s.setProperty("--b", cs.getPropertyValue("--b"));
cs.counterReset; // "ab 0" :(
I think https://drafts.csswg.org/css-variables/#serializing-custom-props should standardize what Firefox does in order to have round-trip.
I have noticed that Firefox serializes
--bas"a/**/b". this is nice, because thenHowever, Blink serializes
--bas"ab", soI think https://drafts.csswg.org/css-variables/#serializing-custom-props should standardize what Firefox does in order to have round-trip.