postcss-css-variables
postcss-css-variables copied to clipboard
Inherited calculation not using correctly scoped variable
I enter following:
:root {
--aaa: 2;
--bbb: calc(var(--aaa) * 2);
}
.btn {
--aaa: 3;
width: var(--aaa);
height: var(--bbb);
}
.btn:hover {
--aaa: 4;
}
and receive:
.btn {
width: 3;
height: calc(4 * 2); /*here is the error, it should be 3*2*/
}
.btn:hover {
height: calc(4 * 2);
}
.btn:hover {
width: 4;
}