With stuff like this, my first thought is always “But what about SSR?”.
Packages like this typically run on the client, *after* rehydration. This leads to an awkward flicker where the text "rebalances" a second or two after the page loads.
This package works flawlessly 💯
It works by inlining a script in the HTML, similar to the technique I share in “The Quest for the Perfect Dark Mode” (joshwcomeau.com/react/dark-mod…).
It's very clever. @shuding_'s work is always immaculate.
Hopefully in the future, text balancing will be supported natively in the browser, and we won't need clever workarounds like this. But in the meantime, this is the best tool I've seen for solving this problem in a React context 💯
• • •
Missing some Tweet in this thread? You can try to
force a refresh
🌠 Over the past few months, I've discovered a couple products that have helped me stay focused during the day, and get good sleep at night.
I wanna tell you about them! 🧵
I should say first: this isn't a sponsored post. I'm not being compensated in any way. The companies don't know I'm posting this. There are no affiliate links.
I just genuinely want to share stuff I've found helpful, in case it helps you too!
The first is Magic Mind (magicmind.co). It's a “productivity drink”.
It has a more subtle effect than their marketing suggests (for me, at least ), but I have actually found it helps me focus.
So, 2022 is almost over, which means your professional development stipend is about to expire! ⏰
If you work at a company that has this perk, I've collected some suggestions in this thread! Books and courses I've been impressed with, or excited by.
Sarah Drasner recently published a book, "Engineering Management for the Rest of Us"! If you're thinking about exploring eng management, there's nobody I'd rather learn from.
Plus, it shows your employer that you're looking to grow your career. 😄
I'm a big fan of @steveschoger + @adamwathan's "Refactoring UI". It's a collection of tips to help developers sharpen their design sense, and avoid all of the common mistakes we tend to make.
From what I remember, I paid off the $20 within a couple of weeks, destroyed the card, and forgot all about it.
~10 years later (!!), I get a letter from a collections agency. I owe many hundreds of dollars for unpaid credit card bills.
It took a lot of work to track down, since the bill had bounced between different collection agencies, but I eventually figure out what the original charge was.
I had paid off the card in full, but a tiny amount of interest had accumulated. Like, a few cents.
When you get comfortable with Flexbox, you can build some truly remarkable things. Check out this demo, heavily inspired by @argyleink’s “4 layouts for the price of 1”.
It uses *no media queries*! It's all based on fluid principles.
Demos like this used to hurt my brain. I *thought* I understood Flexbox, but I couldn't fathom how stuff like this worked!
Fast-forward a few years, and a LOT of practice, and I use these techniques in my work every day.
I started tinkering with CSS back in 2007. For a decade, I stumbled my way through it. I was able to get stuff done, but I wasn't confident.
I had my go-to snippets, things I could copy/paste to solve specific problems, but sometimes they didn't work and I didn't know why. 😬
I decided that I was sick of struggling with CSS, and so I started actively trying to understand it. When I'd run into some funky behaviour, I'd settle into the problem like a warm bath, and work through it until I understood.