Had the idea of how to “fix” the CSS-only `random()` link by @chriscoyier. https...
Roma Komarov @kizu@front-end.social
Had the idea of how to “fix” the CSS-only `random()` link by @chriscoyier.
https://codepen.io/editor/kizu/pen/019ffc68-3dda-702a-af38-e5b4438b318e
Chrome Canary only: requires both `random()`, `if()`, and `sibling-index()/-count()` (+ a `@function` for making it reusable):
```CSS
@function --display-random-sibling(
--value,
--index <integer>: random(--random-link, 1, sibling-count())
) {
result: if(
style(--index: sibling-index()): var(--value);
else: none;
);
}
```
And then just `display: --display-random-sibling(block)`