Skip to content

Inherited calculation not using correctly scoped variable #41

@urrri

Description

@urrri

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions