postcss-css-variables icon indicating copy to clipboard operation
postcss-css-variables copied to clipboard

Inherited calculation not using correctly scoped variable

Open urrri opened this issue 8 years ago • 0 comments

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;
}

urrri avatar Jul 15 '16 15:07 urrri