Skip to content

100 Days Of More Or Less Modern CSS

It’s time to get me up on speed with modern CSS. There’s so much new in CSS that I know too little about. To change that I’ve started #100DaysOfMoreOrLessModernCSS. Why more or less modern CSS? Because some topics will be about cutting-edge features, while other stuff has been around for quite a while already, but I just have little to no experience with it.

Buttons and the Baader–Meinhof phenomenon

Shortly after we got our new car, a Volkswagen T5, I noticed many people seemed to have the same car. Actually, it was everywhere.

Parents counting children in CSS

The other day I was driving home when suddenly it hit me: We can use :has() to determine how many children a parent element has.

outline is your friend

If you open a plain HTML document with no CSS and you focus an interactive element like a button, link, or textarea, you’ll see that by default browsers use the outline property to highlight these elements.

Analyzing pages in a particular state with Lighthouse

Historically, Lighthouse has analyzed the cold pageload of a page only. Clicking the “Generate report” button reloads the page before Lighthouse runs its tests. This can be problematic when you want to run tests on parts of the UI that are only visible when the user interacts with it. For example, a fly-out navigation, a modal window, or the content in a disclosure widget.

Divs are bad!

Yes, clickbait, I’m so sorry! Of course, divs are not bad. For example, they can be really useful,…

Even though there’s nothing wrong with the div per se, some people, including me, still like to complain when they’re not used consciously.