8000 [css-values] Allow division of same types in calc() · Issue #545 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-values] Allow division of same types in calc() #545

@LeaVerou

Description

@LeaVerou

The reason that division by a <length> was originally not allowed was that in some cases there was no way of knowing whether that was a division by 0, and before Variables there was no such concept as invalid in computed value time. Now that there is, perhaps we can revisit this issue for Values 4.

This is especially useful in conjunction with CSS Variables, as currently one can convert from a <number> to a <length> (or <angle> etc) but there is no way to convert a <length> to a <number>! Also, calculating the ratio of two lengths is often very useful, e.g. what percentage of the viewport width is 500px? calc(500px / 100vw)! Not to mention that this would be a more consistent, less surprising design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0