What’s the difference between JavaScript engines and JavaScript runtimes?

By Chris Coyier on

I can imagine being asked at an interview: What’s the difference between JavaScript engines and JavaScript runtimes? Nicholas C. Zakas says: A JavaScript engine implements ECMAScript as defined by the ECMA-262 standard. ECMA-262 defines the core functionality of JavaScript without any affordances for input or output. A JavaScript runtime is an ECMAScript host that embeds […]

Creating a Keyboard Shortcut Hook in React

By Chris Coyier on

I enjoyed this very straightforward, well-presented, useful article on how to create a keyboard shortcut hook in React from Tania Rascia. It’s part basic implementation, part designing an API pattern that feels right, part dealing with React hook eccentricities, and part dealing with edge cases. In the end, a pretty readable 86 lines of code.

The 2.5 Ways to Handle Web Events

By Chris Coyier on

How many ways are there to add an event (like a click) to an element? Andrea Giammarchi covers them. The first two are basically the same (hence the “2.5” in the title). I’d say the vast majority of event handling is through addEventListener, but the clearly listed advantages/disadvantages Andrea goes through are worth understanding. The […]

Colormaxxing

By Chris Coyier on

Sometimes giving a good name to something is what helps it sink into people’s minds. Daniel Karuna may have pulled that off here with “Colormaxxing“. The P3 color space is just bigger than the sRGB color space, and the extra colors tend to be in the more intense regions. What if I told you that #ff0000 or rgb(255, […]

Mesh Gradient Generator

By Chris Coyier on

A nice tool for generating mesh gradients from Erik D. Kennedy. You might call it a bit of a trend, but as Erik pointed out in a recent newsletter, they can be quite versatile because it’s just a nice background look that doesn’t demand anything in particular from the brand.

Hide a message in an emoji

By Chris Coyier on

Pretty interesting trickery here, encoding a secret message in an emoji that you automatically get when you copy/paste it from Paul Butler. Most unicode characters do not have variations associated with them. Since unicode is an evolving standard and aims to be future-compatible, variation selectors are supposed to be preserved during transformations, even if their […]