
Frontend Masters published a follow-up to an earlier piece about making a link that sends someone to a random post on your site, built with nothing but HTML and CSS. The author revisited the original approach, decided it was more complicated than it needed to be, and kept the part that mattered: a random() function in CSS.
This is a small thing, and if you own a plumbing company or a dental practice, a random post button is probably not on your wish list. So why does it matter at all?
Because it is a decent example of a shift in how sites are put together. Historically, anything interactive on a web page needed JavaScript, which is the programming language that runs in a visitor's browser. JavaScript is fine, but it has costs: more code to download, more that can break, more that slows a page down, and more that needs updating over time. When a behaviour can be handled by CSS instead (the language that controls how a page looks), you usually end up with something lighter and less fragile.
The practical version of that for you: when you ask for something on your site, a rotating testimonial, a menu that opens, a tab panel, there is often more than one way to build it. The lighter option tends to be cheaper to maintain and less likely to be the thing that stops working in two years.
The caution is that very new CSS features are not always supported in every browser yet. Someone visiting on an older phone might not see the same thing. That does not make new features off limits, it just means the build needs a sensible fallback, meaning a plainer version that still works.
What to do: nothing today. But next time you are briefing changes to your site, it is fair to ask whether a feature needs JavaScript or whether it can be done more simply, and what happens for visitors on older browsers. Those two questions will tell you a lot about how carefully your site is being built.
Reported by:

