How to Add Night Mode to Your WordPress Site with JavaScript & CSS

May 6, 2019

Lately, I’ve been thinking a lot readability and information retention. I firmly believe that people have an easier time comprehending dark text on a light background. However, there are certainly times when light text on a dark background is a valid design choice. For example, staring at a white background when reading late at night is terrible for your eyes.

To address this issue, I added a “night mode” to my website that automatically turns on after 5 PM and stays active until 5 AM. I decided to forgo the typical night/light mode button because there’s nowhere obvious to put such a button on my website. Here’s how I added the automatic night mode feature.

Continue Reading →


How to Reduce Network Requests in WordPress by Combining Images

March 10, 2019

Over the past few weeks, I’ve been working on optimizing this website by implementing Cloudflare full-page caching on certain pages, refactoring CSS, and reducing the number of requests per page load. Every page on Decrypto has a Twitter icon in the top left corner and an Instagram icon in the top right corner. Previously, the two icons were two separate PNG images. After a little Photoshop and CSS magic, I’ve cut that number in half. Now, both icons are displayed with the same PNG image.

Continue Reading →



Questions?

Find me on Twitter, or email me.