A fascinating little tech demo by Roman Komarov that allows for clickable table sorting entirely in CSS. It’s a combination of inline CSS custom properties, the order property, and calc().
This demo sparked a ton of conversation about accessibility, the crux of which is that the reordering is done only visually and not in the source. Which means that someone interacting directly with the source (a screen reader) might be mislead into thinking they’ve sorted the table when they haven’t. Rachel Andrew pointed out that it’s actually one of the rare things the spec itself tells you not to do:
Authors must use order only for visual, not logical, reordering of content. Style sheets that use order to perform logical reordering are non-conforming.