Skip to contentVisit my new website at chrisnicholas.dev

JavaScript

Articles relating to JavaScript.

How to Use Sandpack for Code Demos

Sandpack was released by CodeSandbox earlier this week, a package that takes code demos to the next level, supporting just about every JavaScript framework. In this article I'll be talking about the Sandpack React component, and how to get it customised & running.
Continue reading →

How to Use Next.js Middleware

With the release of Next.js 12, Vercel Edge Functions have been announced, allowing for super speedy edge-optimised functions. They can also be used as helpful Next.js middleware functions. In this article I'll explain what they are & how to use them, before diving into a few examples.
Continue reading →

Dark Mode by Local Sunlight

Dark mode is increasingly appearing as an option on websites, but why not have it enable automatically? We can estimate the sunlight levels at a user's location, and apply the correct theme to soothe their eyes.
Continue reading →