A followup on building a random post button using only HTML and CSS. The post explores several simpler alternatives to the original approach: using flexbox for uni-directional slices, stacking all links and showing one randomly via CSS random(), using CSS animations instead of random() for better browser support, and experimenting with if() and style queries (which turn out not to work with random()).
Questions this post answers
Can I use CSS random() with style queries to conditionally show elements?
Style queries do not work with CSS random(). An attempt to use an if() function to show only one stacked link based on a random() value fails because style queries are incompatible with random(). An alternative is to use a CSS animation to determine which stacked element is on top, which also provides better browser support than random(). Developers pushing CSS random() to its limits find edge cases like this covered on daily.dev.