@@ -130,12 +130,32 @@ this would be a normal intermediate value at 70% of the way through an animation
130
130
131
131
This is specified [ in css-values-5] ( https://drafts.csswg.org/css-values-5/#calc-size ) .
132
132
133
+ ## ` interpolate-size `
134
+
135
+ The CSS ` interpolate-size ` property is an inherited property that takes two values:
136
+ ` numeric-only ` (the initial value) and ` allow-keywords ` .
137
+ It exists because there is enough web content that depends on
138
+ intrinsic sizing keywords * not* animating
139
+ that we need a way for pages to opt in to allowing these animations.
140
+
141
+ Since it is an opt-in for compatibility,
142
+ it is designed to make it easy to opt in the entire page.
143
+ Therefore, it is an inherited property so that it can just be specified once on the root.
144
+ It is also not part of any shorthands because being part of a shorthand
145
+ would cause use of the shorthand to reset the opt-in.
146
+
147
+ This is specified [ in css-values-5] ( https://drafts.csswg.org/css-values-5/#interpolate-size ) .
148
+
133
149
The following slightly more involved example shows
134
150
(while using the separately proposed ` ::details-content ` pseudo-element)
135
151
the CSS needed to make a ` <details> ` element
136
152
animate its ` height ` when it opens and closes:
137
153
138
154
``` css
155
+ :root {
156
+ interpolate-size : allow-keywords;
157
+ }
158
+
139
159
details ::details-content {
140
160
--open-close-duration : 500ms ;
141
161
height : 0 ;
@@ -144,26 +164,10 @@ details::details-content {
144
164
content-visibility var (--open-close-duration ) allow-discrete;
145
165
}
146
166
details [open ]::details-content {
147
- height : calc-size( max-content , size) ;
167
+ height : max-content ;
148
168
}
149
169
```
150
170
151
- This is specified [ in css-values-5] ( https://drafts.csswg.org/css-values-5/#calc-size ) .
152
-
153
- ## ` interpolate-size `
154
-
155
- The CSS ` interpolate-size ` property is an inherited property that takes two values:
156
- ` numeric-only ` (the initial value) and ` allow-keywords ` .
157
- It exists because there is enough web content that depends on
158
- intrinsic sizing keywords * not* animating
159
- that we need a way for pages to opt in to allowing these animations.
160
-
161
- Since it is an opt-in for compatibility,
162
- it is designed to make it easy to opt in the entire page.
163
- Therefore, it is an inherited property so that it can just be specified once on the root.
164
- It is also not part of any shorthands because being part of a shorthand
165
- would cause use of the shorthand to reset the opt-in.
166
-
167
171
## Detailed design discussion
168
172
169
173
Much of the design discussion happened in w3c/csswg-drafts #626
0 commit comments