First, I wanna clarify that this isn't all just about aesthetics. It's important to understand *why* shadows are such a powerful tool.
Shadows give our application depth and realism, and let us focus attention by elevating important elements.
In the past, when I wanted to add a shadow, I'd play with the numbers until I liked the way it looked. As a result, I had a mess of incongruous shadows, breaking the overall illusion of depth 😅
We can avoid this problem by understanding how shadows work.
With all of that precursor knowledge out of the way, we can jump to the ✨ effects ✨
We leverage two tricks to enhance our shadows:
• Layering
• Color-matching
Instead of a single shadow, here's what happens if we use 5!
We can play with the offsets and blur radius to create a diffuse, life-like shadow:
Most devs will use a transparent black as the shadow color. The problem with this is that it desaturates the shadow, leading to a "washed-out" quality.
If we pick a color based on the backdrop, it looks much more lush and natural:
This is one of my most value-packed tutorials ever. Seriously, I think you'll learn a ton of good stuff. We cover a bunch of stuff I haven't mentioned here, like how to incorporate these ideas into a design system, and how to add shadows to irregular shapes like a tooltip:
🌠 It's so easy to get sucked into performance micro-optimization territory.
Someone will say that Method X is slow, and inevitably somebody else will point out that it doesn't really matter outside of contrived, unrealistic benchmarks.
🧵 I wanna dig into that a bit…
Here's an example. We have a list of users, and we wanna filter so that we only show the people who are online.
We can do that with a "filter", or with a "reduce", or with a "forEach". Which is faster? Does it matter? Why or why not?
Are you interested in teaching stuff to developers? Maybe through a blog, or a workshop, or an online course?
🧵 This thread is a quick summary of some of the most-critical stuff I've learned, over years of blogging, teaching at a bootcamp, and working in edtech at Khan Academy.
I believe that there are two categories of learning: active and passive.
Active learning means that the learner is doing something. They're solving a problem, writing some code, playing with an example. Passive learning is watching a video, listening to a lecturer.
Which one is better? Well, I think active learning is probably more effective, but it's also more draining. Nonstop active learning is *exhausting*.
I like to treat it like interval training: I intersperse both types, so that we're constantly hopping between them.
From March 2020 to ~October 2020, I wasn't really able to use a keyboard/mouse.
I've been pretty public about how I worked around it (joshwcomeau.com/blog/hands-fre…), but I haven't been as public about how I overcame it.
🧵 This thread is about my personal experience with RSI.
This is a story about my own experience, not a tutorial for how to solve RSI. Everyone's different, and just because something worked for me doesn't mean it'll work for you.
Please read all the way through before trying anything.
[cw medical stuff / surgery discussion]
In March 2020, I injured my left arm. Certain activities, like typing, would cause a burning pain in the elbow, and occasionally the wrist or fingers.
In May 2020, the same thing started happening in my right arm.
Around this time tomorrow (10AM EST), I'll be launching my first product as an indie hacker, CSS for JavaScript Devs (css-for-js.dev).
It has been one heck of a ride 😅. In this thread, I wanna share what the journey's been like ✨
In early 2020, I developed an RSI that made it impossible to use a keyboard/mouse. I spent months not using a computer at all, and then months training myself to code with dictation and an eye-tracker.
It's mostly better now, but this was a catalyst for my abrupt career change.
I mention this because I think it's important framing: I'm not the type of person that would typically quit their secure, very-well-paid job as a staff engineer *during a pandemic* to pursue an unproven venture. But it felt urgent to me that I do this right now.