A comparison-first reference for related web concepts
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:
- Swapping a class
- Swapping a class, with the colors defined in a Sass
@mixin - Swapping a class, where the class changes the value of a custom property
- Swapping the value of a custom property
- Swapping the value of a custom property, with the colors stored in JavaScript only
- Setting inline styles
- Manipulating the CSSOM
- 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.



