Re: [csswg-drafts] [css-values-5] Maybe min, max and step should not be part of the random-caching-key (#11742)

> This suggests a 2x2 matrix of possibilities, but only three of them were specifiable with the per-element keyword: auto name and ID, manual name and ID, or manual name and null

I don't follow what auto name you are talking about. Do you mean `per-element`?

Anyways, it's actually more than 2x2 because of indexes. Are the grow and shrink ratios set to the same amount?

```css
flex: random(match-element, 0, 1) random(match-element, 0, 1);
```

I guess they don't, in order to maximize randomness, and because (I believe?) you can specify a common ident if you want the same amount.

| Behavior | Original | Inverted |
| - | - | - |
| Don't vary.<br>Share among elements, properties and indices | <pre><code>flex:&#10;  random(--global, 0, 1)&#10;  random(--global, 0, 1)</code></pre> | <pre><code>flex:&#10;  random(--global match-element, 0, 1)&#10;  random(--global match-element, 0, 1)</code></pre> |
| Vary with element.<br>Share among properties and indices | <pre><code>flex:&#10;  random(per-element, 0, 1)&#10;  random(per-element, 0, 1)</code></pre> | <pre><code>flex:&#10;  random(--element, 0, 1)&#10;  random(--element, 0, 1)</code></pre> |
| Vary with property.<br>Share among elements and indices | <pre><code>flex:&#10;  random(--flex, 0, 1)&#10;  random(--flex, 0, 1)</code></pre> | <pre><code>flex:&#10;  random(--flex match-element, 0, 1)&#10;  random(--flex match-element, 0, 1)</code></pre> |
| Vary with index.<br>Share among elements and properties | <pre><code>flex:&#10;  random(--1, 0, 1)&#10;  random(--2, 0, 1)</code></pre> | <pre><code>flex:&#10;  random(--1 match-element, 0, 1)&#10;  random(--2 match-element, 0, 1)</code></pre> |
| Vary with element, property.<br>Share among indices | <pre><code>flex:&#10;  random(per-element --flex, 0, 1)&#10;  random(per-element --flex, 0, 1)</code></pre> | <pre><code>flex:&#10;  random(--flex, 0, 1)&#10;  random(--flex, 0, 1)</code></pre> |
| Vary with element, index.<br>Share among properties | <pre><code>flex:&#10;  random(per-element --1, 0, 1)&#10;  random(per-element --2, 0, 1)</code></pre> | <pre><code>flex:&#10;  random(--1, 0, 1)&#10;  random(--2, 0, 1)</code></pre> |
| Vary with property, index.<br>Share among elements | <pre><code>flex:&#10;  random(--flex--1, 0, 1)&#10;  random(--flex--2, 0, 1)</code></pre> | <pre><code>flex:&#10;  random(--flex--1 match-element, 0, 1)&#10;  random(--flex--2 match-element, 0, 1)&#10;/* or */&#10;flex:&#10;  random(match-element, 0, 1)&#10;  random(match-element, 0, 1)</code></pre> |
| Vary with element, property, index.<br>Don't share | <pre><code>flex:&#10;  random(per-element --flex--1, 0, 1)&#10;  random(per-element --flex--2, 0, 1)&#10;/* or */&#10;flex:&#10;  random(0, 1)&#10;  random(0, 1)</code></pre> | <pre><code>flex:&#10;  random(0, 1)&#10;  random(0, 1)</code></pre> |

So even though omitting the options implies the "weird curve" in the original, I think it's preferable because it directly maps to "varies with". The inverted option kinda maps to "shared with", but it's less straightforward, because it's not obvious that an ident shares among properties and indices but not among elements.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11742#issuecomment-2708581940 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 9 March 2025 00:22:24 UTC