This vs. That, a site by Phuoc Nguyen, organizes its content around pitting two or more related concepts against each other in a single article. The premise is that superficially similar techniques often behave in markedly different ways, and that difference is worth understanding before you pick one.

A representative article covers display: none;, opacity: 0;, and visibility: hidden. All three appear to "hide" an element, yet each has distinct consequences. The content is open source for anyone who wants to contribute.

A parallel: the same result via many routes

The comparison format echoes a Pen by Adam Thompson, which sets the colors of some pill boxes in seven separate ways. None of the approaches is "better" than another — they simply reach the same outcome by different means:

  1. Swapping a class
  2. Swapping a class, with the colors defined in a Sass @mixin
  3. Swapping a class, where the class changes the value of a custom property
  4. Swapping the value of a custom property
  5. Swapping the value of a custom property, with the colors stored in JavaScript only
  6. Setting inline styles
  7. Manipulating the CSSOM
  8. Setting a non-standard color attribute

More variations are possible on top of those: changing a class on a higher-up parent, using data-* attributes, applying a hue-shifting filter, doing color math in JavaScript to manipulate hues, or using the checkbox hack to change styling. The list is far from exhaustive.