Skip to content

Incorrect output and duplication when defining a variable relative to another #105

@ecc521

Description

@ecc521

Inputting the code

@media screen and (min-width: 500px) {
    :root {
        --defaultFontSize: 2.8vw;
        --specialFontSize: var(--defaultFontSize);
    }
}

@media screen and (min-width: 600px) {
    :root {
        --defaultFontSize: 3.8vw;
    }
}

body {
	font-size: var(--specialFontSize)
}

outputs

body {
	font-size: undefined
}

@media screen and (min-width: 600px) {

	body {
	font-size: undefined
	}
}

@media screen and (min-width: 500px) {

	body {
	font-size: 2.8vw
	}
}

@media screen and (min-width: 500px) {

	body {
	font-size: 2.8vw
	}
}

Note the font-size:undefined in the second declaration. That should be a 3.8vw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions