Simplify conditionals using arrays using PHP/JS
Simplify conditionals by checking against an array instead of variables individually
Dynamic Scroll Based Classes
Here is a super useful snippet for dynamically updating the body's class based on scroll position in the browser.
Lazy loading is not a cure-all
This likely a pretty unpopular opinion, but this is also _my_ blog so I gotta be honest.
In my recent perusal of the web, I've realised lazy loading is often redundant and unnecessary. In fact, I'll bet for the most part lazy loading is implemented just to satisfy Google, but it is also a feature many sites could do without.
How to implement a fool-proof dark mode
**I think it's fair to say dark mode is one of 2019's biggest design patterns, especially amongst developers.** Here's a fool proof way to implement dark mode on your website so that it saves a user's preference and ensures no flash of inverting colours on page load.
A rant about the State of CSS in 2019
I have opinions of the state of CSS today. Some of them controversial, probably.
Check if a device is a touchscreen
Sometimes it's useful to know if the device a user is visiting on is a touchscreen or not. This is because touchscreens don't generally render things like hover states.