Skip to content

unitless zero value bug #7

Closed
@yksht

Description

@yksht

Hi :)

I'm using postcss and have following expression:

div {
    width: calc(100% - $width - $margin);
}

and I found strange behavior when try to use zero values:

// $width: 200px;
// $margin: 0; or $margin: 0px; or $margin: 0px;
// output: 
div {
    width: calc(100% - 200px - 0); // this is not valid expression inside 'calc' and browsers don't calculate it
}

but these are valid expressions:

width: calc(100% - 200px - 0px);
width: calc(100% - 200px - 0%);

so my question is: Could you fix this? Or this is a normal behavior?
thank you :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions