Skip to content

Compiling clamp with mixed units vw and rem fails #648

@rintisch

Description

@rintisch

When compiling e.g. clamp(0.2rem, 0.2rem + 0.12vw, 0.3rem) the Compiler fails in the method compileString() line 573 with the message Incompatible units vw and rem.: line: <line-number>, column: <column-number>.

It works when using clamp(0.2rem, calc(0.2rem + 0.12vw), 0.3rem) but calc() is optional ,see https://web.dev/min-max-clamp/

When using a calculation inside of a min(), max(), or clamp() function, you can remove the call to calc(). For example, writing font-size: max(calc(0.5vw - 1em), 2rem) would be the same as font-size: max(0.5vw - 1em, 2rem).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestspec complianceIssues with compliance to the Sass spec

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions