When `flex-basis` is set to `0`, it distributes ALL space, not just empty space.
So: we put columns on either side of the nav, make them greedy with `flex-grow`, and distribute the space with `flex-basis`:
.column {
flex-grow: 1;
flex-basis: 0;
}
(Image credit: w3 dot org)
(You can also use `flex: 1` instead, but that shorthand obfuscates what's really going on here!)
Another nifty trick: The nav items "fan out" as the window gets larger, thanks to viewport-based gap sizes:
nav {
display: flex;
gap: max(calc(10vw - 60px), 16px);
}
How it works:
→ `gap` adds space between flex siblings
→ The `vw` unit scales with viewport
→ We crank up the scaling impact by picking a big number (10vw) and subtracting a fixed value (60px) using `calc`
→ To avoid having negative gap on small screens, we clamp it to 16px
I'm currently building a CSS course, “CSS for JavaScript Developers”!
The course features a number of in-depth workshops, and for the Flexbox module, we build an e-commerce webapp! It uses these tricks (among others) for its primary nav 🔥
Final little note: `gap` isn't supported in Safari, though they just added it to their Technology Preview, so it's on the way! In the meantime, you can use margin:
Heard from some folks that are concerned about the effect it'll have on artists. Wrestling with this a bit.
In my view, it's similar to the effect that Squarespace had on web developers. There's still plenty of demand for us, but it changed a bit.
Essentially things shift upwards a bit. It's less common to get paid $500 to build a website for your local bakery, but still plenty of opportunities building dynamic products for businesses with big budgets.
This style removes the "ugly" focus ring on inputs and links, but it means keyboard users can't navigate; it totally breaks the experience for them (and any non-mouse users) 😬
A thread with some solutions 🧵
First, some quick options:
• Leave them as-is! Outlines aren't so bad.
• Provide an alternative focus style, like changing the background color, or adding a border.
There's a nifty new pseudo-class you may not be aware of, though…
🌠 The `:focus-visible` pseudo-class is just like the `:focus` one, but it only matches when the browser determines that a visible focus state is necessary (eg. not a mouse user).
Keyboard users will see the focus rings, but mouse users won't.
At a couple jobs now, I've been tasked with reviewing incoming applications, so I've read _a lot_ of cover letters. IMO, a lot of them miss the mark 😬.
Today I thought I'd share some cover letters I've written which led to an offer, + some cover letter tips.
This letter isn't my best work, but it tells a compelling story about why I'm passionate about the space + the organization. Could be improved by sharing more about my skills/background
Letter 2: Glitch
I'm proud of this letter. I cover why I care about their mission (online code education), their product (mentioning specific features), and why my skills/background are valuable to them in their mission / for their product.
So many folks have lost their job in the last 2 weeks :(
I've been writing a short book on software dev portfolios. It isn't ready yet, but I wanted to share some of the highlights, to hopefully help folks who are job-hunting again!
The most important stuff I know, in-thread 👇
Your developer portfolio is a showcase of your most important projects. I'm using the term "project" loosely, to include:
• Stuff you shipped on-the-job (if not restricted by NDA)
• Side-projects
• OSS contributions
• Volunteer work
Your homepage should list your 2-5 most impressive projects. You should have an image, a brief summary, and a link to a dedicated page to learn much more about this project.