CSS' only-child instead of Conditional Logic

In many of the frontend frameworks that I work with, there are options for ternaries or if-branches injected into the HTML logic. This is logic I use a lot. One particular case is to show when there is no data. I just stumbled on a CSS pattern that makes my life much easier: the :only-child pseudo-class. React In React, I would do "something" like this ... { data.length === 0 ? <div> Nothing to…