Using the Custom Highlight API
You can get your hands on ranges of text in JavaScript, then apply a named “highlight” on them, so you can style that range in CSS with no other selector necessary.
You can get your hands on ranges of text in JavaScript, then apply a named “highlight” on them, so you can style that range in CSS with no other selector necessary.
A silly debate that rages just as hard as “tabs vs spaces” is “semicolons or not” in JavaScript. Generally, the answer is “use an automatic formatting tool so you don’t have to think about it”. But if you happen to be on the “no semicolons” side, it’s interesting to note that it can cause confusing […]
Zustand is a minimal, but fun and effective state management library which just may improve your render performance.
A little reminder from Matt Smith that getting the last item in an Array is easier now:
Josh Comeau does a great job with beginner-friendly explanations of important concepts, and Promises From The Ground Up is no exception. In a nutshell, we have Promises because we need callbacks. We need callbacks because JavaScript is single-threaded and can’t wait around for things. And so we dance. These days, you’ll see more async and […]
Feels notable that Iterator helpers have become Baseline Newly available. The gist is that you can map and filter on stuff that was annoying or impossible to before. I’ll copy Jeremy Wagner’s example:
I was trying to play with CSS Module Scripts the other day, which are a way to import CSS as a constructable stylesheet using the ESModules syntax. They are Chrome-only so not really something we can generally use (unless you’re building an Electron app or something), but I really like the idea of being able […]
Just a tiny gotcha.
We can pass the mouse position from JavaScript to CSS and use it to make unusual and playful effects.
Frontend Masters donates to open source projects through thanks.dev and Open Collective, as well as donates to non-profits like The Last Mile, Annie Canons, and Vets Who Code.