Skip to content

Parenthesis missing when using variable with CSS functions (nested) #96

@juliovedovatto

Description

@juliovedovatto

I'm facing problems with IE11 browser using css variables. So I decided to use this awesome lib to convert CSS variables to normal representation value, to make work in the browser.

But the css is broken after parsing it. It does not work in any browser.

After a time debugging, I noticed a wrong behavior.

Example:

Without postcss-css-variables

:root {
  --variable-name-goes-here: 24px;
}
/* [...] */
.css_class {
    width: calc(58.3333333333% - var(--variable-name-goes-here, 0px)); 
}

Using postcss-css-variables

.css_class {
width: calc(58.3333333333% - 24px; /* <- missing )) */
}

It seems the string replacement is not working as expected.

I'm using 0.12.0 version.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions