-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Technical review: add interpolate-size and calc-size() #35934
base: main
Are you sure you want to change the base?
Conversation
Preview URLs (13 pages)
Flaws (6)Note! 7 documents with no flaws that don't need to be listed. 🎉 URL:
URL:
URL:
URL:
URL:
URL:
External URLs (3)URL:
URL:
(comment last updated: 2024-09-19 20:04:04) |
```css | ||
section { | ||
width: calc-size(fit-content, size + 4rem); | ||
height: calc-size(auto, size * 1.40; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon:
height: calc-size(auto, size * 1.40; | |
height: calc-size(auto, size * 1.40); |
<h2>Chris Mills</h2> | ||
</header> | ||
<main> | ||
<p>Chris is the silent phantom of MDN.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
|
||
### Values that can be interpolated | ||
|
||
At the time of writing, the following intrinsic values can be opted-in to animations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a Chrome limitation. I’m not sure if other browsers – when they ship this – would have these same limitations. They could, for example, support stretch
out of of the box.
(I’m also not sure if “At the time of writing” is something that conforms to MDN’s writing style)
The **`calc-size()`** [CSS](/en-US/docs/Web/CSS) [function](/en-US/docs/Web/CSS/CSS_Functions) allows you to perform calculations on [intrinsic size values](/en-US/docs/Glossary/Intrinsic_Size) such as `auto`, [`fit-content`](/en-US/docs/Web/CSS/fit-content), and [`max-content`](/en-US/docs/Web/CSS/max-content); this is not supported by the regular {{cssxref("calc()")}} function. | ||
|
||
`calc-size()` return values can also be interpolated, enabling their use in [animations](/en-US/docs/Web/CSS/CSS_animations) and [transitions](/en-US/docs/Web/CSS/CSS_transitions). In effect, they have [`interpolate-size: allow-keywords`](/en-US/docs/Web/CSS/interpolate-size) applied to them automatically. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there should be some kind of warning here to urge people to use interpolate-size
as that will do most of the time?
(It is mentioned further down)
Description
Chrome 129 supports the
interpolate-size
property andcalc-size()
function, which enable animation to/from and calculations involving intrinsic size values. This PR adds reference documentation for these new features.See also:
Motivation
Additional details
Related issues and pull requests