Skip to content

[css-transforms] Proposal: allow <length> values in scale #12089

Open
@benface

Description

@benface

For a reason that I'm sure is deeply technical, the scale property, as well as the scale(), scaleX(), and scaleY() transform functions, don't allow length values such as px. Percentages and calc() are allowed however, so it would be a huge unlock to allow length values together with them (Codepen here):

<div style="width: 200px; height: 100px; scale: 50px;">
  I expect this to be scaled down to 50px x 50px (same as if `scale` was set to `0.25 0.5`)
</div>

<div style="width: 200px; height: 100px; scale: calc(100% + 50px);">
  I expect this to be scaled up to 250px x 150px
</div>

<div style="width: 200px; height: 100px; transform: scaleX(calc(100% - 50px)) scaleY(calc(100% + 50px));">
  I expect this to be scaled to 150px x 150px
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions