-
Notifications
You must be signed in to change notification settings - Fork 686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-transforms] Have scale function accept percentage value #3399
Comments
Agree this is a nice to have, would be more intuitive for many authors ( It's very similar to the change in alpha values to support percentages, which the WG re-affirmed in #3342 after browser teams emphasized their plan to ship. |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: Have scale function accept percentage value<dael> github: https://github.com//issues/3399 <dael> AmeliaBR: This was a community suggestion that scale transforms that current accept number also accept % values, transform-scale: 150% instead of 1.5 <dael> AmeliaBR: Question of author conveience and intuitiveness. We've done this recently for opacity. Just like that it would only effect parsing. Actual rendering wouldn't change. <dael> AmeliaBR: Question of if people think it's enough value to users to change parsing code <dael> Rossen_: Any expection for how computed serializes <dael> AmeliaBR: I would assume convert to simple number <dael> TabAtkins: Given this is a place where number represents same as % I'm fine with it. It's low value, but low effort and I'm good with being more consistent across the language. <dael> TabAtkins: Idea is it would parse into a number internally and serialize as a number <dael> AmeliaBR: smfr can correct, but I assume this is transforms 2. I don't think any rush to get that to PR so we have time to ship impl <heycam> +1 for consistency across all values that accept a proportion-like value <dael> smfr: I think that's true. Would effect 2d transform functions. New in transforms 2. Fine with this <dael> Rossen_: Obj to accept proposal Allow percentages inside the scale <dael> RESOLVED: Allow percentages inside the scale |
Presumably this should also apply to the individual scale property (and not just the |
A convenient way, e.g. a keyword, to scale by √2 ≈ 1.414 or √½ ≈ 0.707 (as in ISO paper and pens) might also be nice. |
Allow percentages inside the scale functions, and the scale property. resolves w3c#3399
Allow percentages inside the scale functions, and the scale property. resolves w3c#3399
Yes, now that |
Allow percentages inside the scale functions, and the scale property. resolves w3c#3399
Allow percentages inside the scale functions, and the scale property. resolves w3c#3399
Agree, and Gecko just landed it (based on the spec PR). |
The functions scale() scaleX() scaleY() scaleZ() scale3d() and the property scale each accept percentages, that serialize as numbers. w3c/csswg-drafts#3399 w3c/csswg-drafts#4396 https://drafts.csswg.org/css-transforms-2/#transform-functions https://drafts.csswg.org/css-transforms-2/#propdef-scale Bug: 1179579 Change-Id: Icfbc42bf529c1c63045c3e918a6a1db2b14d1ae3
The functions scale() scaleX() scaleY() scaleZ() scale3d() and the property scale each accept percentages, that serialize as numbers. w3c/csswg-drafts#3399 w3c/csswg-drafts#4396 https://drafts.csswg.org/css-transforms-2/#transform-functions https://drafts.csswg.org/css-transforms-2/#propdef-scale Bug: 1179579 Change-Id: Icfbc42bf529c1c63045c3e918a6a1db2b14d1ae3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2703674 Commit-Queue: Eric Willigers <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#867008}
The functions scale() scaleX() scaleY() scaleZ() scale3d() and the property scale each accept percentages, that serialize as numbers. w3c/csswg-drafts#3399 w3c/csswg-drafts#4396 https://drafts.csswg.org/css-transforms-2/#transform-functions https://drafts.csswg.org/css-transforms-2/#propdef-scale Bug: 1179579 Change-Id: Icfbc42bf529c1c63045c3e918a6a1db2b14d1ae3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2703674 Commit-Queue: Eric Willigers <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#867008}
The functions scale() scaleX() scaleY() scaleZ() scale3d() and the property scale each accept percentages, that serialize as numbers. w3c/csswg-drafts#3399 w3c/csswg-drafts#4396 https://drafts.csswg.org/css-transforms-2/#transform-functions https://drafts.csswg.org/css-transforms-2/#propdef-scale Bug: 1179579 Change-Id: Icfbc42bf529c1c63045c3e918a6a1db2b14d1ae3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2703674 Commit-Queue: Eric Willigers <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#867008}
…ges., a=testonly Automatic update from web-platform-tests CSS Transforms: scale() accepts percentages. The functions scale() scaleX() scaleY() scaleZ() scale3d() and the property scale each accept percentages, that serialize as numbers. w3c/csswg-drafts#3399 w3c/csswg-drafts#4396 https://drafts.csswg.org/css-transforms-2/#transform-functions https://drafts.csswg.org/css-transforms-2/#propdef-scale Bug: 1179579 Change-Id: Icfbc42bf529c1c63045c3e918a6a1db2b14d1ae3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2703674 Commit-Queue: Eric Willigers <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#867008} -- wpt-commits: 808a9ed80e45a9da615fb930d212fcc7461648e6 wpt-pr: 28267
The functions scale() scaleX() scaleY() scaleZ() scale3d() and the property scale each accept percentages, that serialize as numbers. w3c/csswg-drafts#3399 w3c/csswg-drafts#4396 https://drafts.csswg.org/css-transforms-2/#transform-functions https://drafts.csswg.org/css-transforms-2/#propdef-scale Bug: 1179579 Change-Id: Icfbc42bf529c1c63045c3e918a6a1db2b14d1ae3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2703674 Commit-Queue: Eric Willigers <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#867008} GitOrigin-RevId: f31adb81393ef56e06da6d2a3e5ec42ef19a25b1
Hello,
I would like to suggest adding percentage for scale function in transformations.
Current state:
scale()
is using[-NUM, NUM]
where NUM is whole number (integer)Suggestion:
scale()
will support[-NUM, NUM]
and[-%, %]
Example:
transform: scale(120%)
will work same astransform:scale(1.2)
is working right now.It is not a game-breaker but it is nice to have.
Thank you for your work.
The text was updated successfully, but these errors were encountered: