Constraint as Material

Most content service providers let users express themselves only through text, links, and images, and their sanitization rules strip HTML, JavaScript, and assorted attributes. The social media service Cohost grants more latitude with markup and inline styles than users are typically accustomed to. Some have treated that latitude as an invitation, recreating familiar interfaces and interactive games by putting CSS properties to unconventional use.

What the Experiments Look Like

Blackle Mori built a contraption in which pulling a handle slowly drives a series of gears, pulleys, and chains until an aperture opens to reveal the site's mascot — the eggbug — alongside the proclamation "Good Job!" Inspecting it in Developer Tools reveals a combination of grid, resize, transform, and calc(); adding a border to every <div> helps track how the individual elements move.

  • resize shows up repeatedly as a way to give viewers rudimentary click-and-drag functionality; Blackle Mori explains this technique in a dedicated tutorial.
  • Other crimes build limited interaction out of <details> and <summary>, again covered in a Blackle Mori tutorial.
  • Some in the community have adapted Andrew Siller's technique from "Night of the Living GIF: Making Interactive Multiplayer Experiences" to build a multiplayer Pokémon experience.

Familiar Workarounds

Working under a restricted toolkit is not new territory. Decorative CSS shapes have long substituted for images, :hover has stood in for mouseenter and mouseleave, and input:checked as a sibling selector has handled toggling.

Why the Practice Is Worth Keeping

CSS Crimes are probably not something you would want to employ on a regular basis, but experiments within constraints deserve embrace for the creative solutions they foster.