-
Notifications
You must be signed in to change notification settings - Fork 734
[css-gaps-1] Define Interpolation behavior for GapDecorations. Issue #12431 #12583
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
base: main
Are you sure you want to change the base?
Conversation
@jav099 could you please link your W3C account to your GitHub account, so that the IPR bot knows who you work for? Happy to help if you don't know how to do that. |
@svgeesus I have already done so I think? The IPR bot was failing yesterday and I followed its links to link the accounts. Now if I go to my W3C account and look at my connected accounts I can see my github profile. |
@@ -712,7 +712,7 @@ Gap decoration color: The 'column-rule-color' and 'row-rule-color' properties</h | |||
Initial: currentcolor | |||
Applies to: <a>grid containers</a>, <a>flex containers</a>, <a>multicol containers</a>, and <a>masonry containers</a> | |||
Inherited: no | |||
Animation type: by computed value type | |||
Animation type: repeatable list, (see [[#repeat-interpolation]]). |
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.
Animation type: repeatable list, (see [[#repeat-interpolation]]). | |
Animation type: repeatable list, see [[#repeat-interpolation]]. |
@@ -807,7 +807,7 @@ Gap decoration width: The 'column-rule-width' and 'row-rule-width' properties</h | |||
Applies to: <a>grid containers</a>, <a>flex containers</a>, <a>multicol containers</a>, and <a>masonry containers</a> | |||
Inherited: no | |||
Computed value: list of absolute lengths, <a>snapped as a border width</a>, or ''0'' under conditions described below | |||
Animation type: by computed value type | |||
Animation type: repeatable list, (see [[#repeat-interpolation]]). |
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.
Animation type: repeatable list, (see [[#repeat-interpolation]]). | |
Animation type: repeatable list, see [[#repeat-interpolation]]. |
@@ -982,6 +982,72 @@ Lists of values and the ''repeat-line-color/repeat()'' notation</h3> | |||
except that in step 2, change all instances of "first" to "last". | |||
</div> | |||
|
|||
<h4 id="repeat-interpolation">Interpolation of ''repeat()''</h4> | |||
When combining ''repeat()'' values for 'rule-color', and 'rule-width', |
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.
Half sentence here (left over from drafting?)
When interpolating ''repeat()'' values for 'rule-color' or 'rule-width', the interpolation proceeds in two steps: | ||
|
||
<ol> | ||
<li> <dfn>Expansion</dfn>: Expand each ''repeat(n, …)'' into its equivalent list of values. </li> |
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.
<li> <dfn>Expansion</dfn>: Expand each ''repeat(n, …)'' into its equivalent list of values. </li> | |
<li> <dfn>Expansion</dfn>: Expand each [=integer repeater=] into its equivalent list of values. </li> |
(link to defined terms where available for consistency)
<li> <dfn>List Interpolation</dfn>: Apply the [=repeatable list=] interpolation algorithm to the expanded lists, interpolating each item against its counterpart.</li> | ||
</ol> | ||
<pre class="example"> | ||
/* Repeater → Repeater */ |
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.
Suggestions for the interpolation examples:
- Applying the
example
class to<pre>
makes the formatting inconsistent with other examples in the document; apply it to<div>
instead and perhaps include some explanatory text - I think it would be helpful to include the expanded
from
andto
lists also - Adjust the spacing so that corresponding values line up vertically in the formatted HTML (unfortunately, as best I know, this can take some trial-and-error)
Here's how I might mark one of these up, but feel free to vary the overall form and explanatory text between examples as it makes sense to do so:
<div class="example">
<pre class="lang-css">
@keyframes example {
from { column-rule-width: repeat(2, 10px 20px); }
to { column-rule-width: 20px; }
}
</pre>
Interpolation of the above values would result in expansion of the
"from" and "to" values to create lists of equal lengths:
<pre>
From: 10px 20px 10px 20px
At 50%: 15px 20px 15px 20px
To: 20px 20px 20px 20px
</pre>
</div>
(I just now discovered class="lang-css"
while looking at other specs; I'll probably go back and mark up the other examples in this spec with it at some point)
</pre> | ||
|
||
<h5 id="auto-repeaters">Lists with Auto Repeaters</h5> | ||
When either of the lists we are interpolating between (let's call them |from| and |to|) include an <a>auto repeater</a> (e.g. ''repeat(auto, …)''), we conceptually split the list into three segments, similar |
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.
When either of the lists we are interpolating between (let's call them |from| and |to|) include an <a>auto repeater</a> (e.g. ''repeat(auto, …)''), we conceptually split the list into three segments, similar | |
When either of the lists we are interpolating between (let's call them |from| and |to|) include an <a>auto repeater</a>, we conceptually split the list into three segments, similar |
(the "e.g." is not needed since the autolink will take the reader to the definition of the term; omit it for brevity)
@@ -982,6 +982,72 @@ Lists of values and the ''repeat-line-color/repeat()'' notation</h3> | |||
except that in step 2, change all instances of "first" to "last". | |||
</div> | |||
|
|||
<h4 id="repeat-interpolation">Interpolation of ''repeat()''</h4> |
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.
I think these rules also apply to cases where the "from" and "to" values don't contain any repeaters but do have unequal list lengths, correct? Assuming that's the case, I'd suggest generalizing the section title and introductory test to reflect that.
/* Auto-Repeater → Auto-Repeater (Discrete interpolation, segment lengths don't match) */ | ||
from: 10px repeat(auto, 20px) 30px | ||
to: 20px repeat(auto, 40px) 40px 50px | ||
/* At 50%: 15px repeat(auto, 30px) 40px 50px */ |
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.
Are we interpolating part of the value continuously and part discretely? That seems weird to me - I'd expect that if the lists can't be lined up, the entire interpolation would be treated as discrete. Though maybe there's precedent for doing it this way elsewhere?
/* Auto-Repeater → Non-Repeater (Discrete interpolation, segment lengths don't match) */ | ||
from: 10px repeat(auto, 20px) 30px | ||
to: 20px 40px | ||
/* At 50%: 20px 40px */ |
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.
For cases where a discrete interpolation happens, the "At 50%" line doesn't add much value. I would instead have prose stating that the interpolation is discrete and explaining the specific reason why (e.g. "because only one value contains an [=auto repeater=]").
@@ -1066,4 +1132,6 @@ Changes since the <a href="https://www.w3.org/TR/2025/WD-css-gaps-1-20250417/">1 | |||
<li>Specified the behavior when gaps are coincident due to track collapsing. | |||
(<a href="https://github.com/w3c/csswg-drafts/issues/11814">Issue 11814</a>) | |||
<li>Added links to WPT suite. | |||
<li>Specified the interpolation behavior for ''repeat()'', 'rule-color', and 'rule-width'. |
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.
<li>Specified the interpolation behavior for ''repeat()'', 'rule-color', and 'rule-width'. | |
<li>Specified the interpolation behavior for values which may contain repeaters. |
This PR aims to define the interpolation behavior for the
rule-width
andrule-color
properties in CSSGapDecorations, based on the resolution in #12431.Changes can be seen live in https://jav099.github.io/javier-intersections-draft.github.io/