Skip to content

Precision for nested calc is not accurate #51

@andreymal

Description

@andreymal
> reduceCSSCalc('calc((100% / 3) * 3)')
'100%'
> reduceCSSCalc('calc(calc(100% / 3) * 3)')
'99.99999%'

We also can go deeper lol:

> reduceCSSCalc('calc(calc(100% / 30000000) * 30000000)')
'0%'

Note that it works in Firefox and Chrome:

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