A Scroll-Driven Animation… with a Duration

By Chris Coyier on

Ryan Mulligan digs into a Jhey Tompkins Pen and discovers a neat little trick involving two @keyframe animations. The first is a “trigger” animation that triggers when a certain element comes into view, and flips a –trigger custom property. Via a Style Query, that triggers the actual animation. Why bother? Scroll-driven animation durations are, well… […]

Fading Out Text with Mask

By Chris Coyier on

If you’re going to fade out some text, I’m gonna call it and say the best way, while also being the easiest, is using a mask. Kilian Valkhof covered this recently, rejecting the idea of an overlay gradient, and also offering the idea of using background-clip. But mask is the clear winner. Let’s get that […]

Progressively Enhanced Form Validation

By Chris Coyier on

Here’s a thing you’re sure to do in your web developer career: add form validation to a form. You can’t leave that name field blank! That doesn’t look like an email address! That quantity is too high! Forms are a part of the beating heart of the web, and especially important to business. You can’t […]

We can :has it all

By Chris Coyier on

I’m still obsessed with how awesome and powerful :has() is in CSS. Ryan Mulligan really drives it home in We can :has it all with a single Pen that offers simple, realistic UI controls for: These are things you can easily imagine on any website, and now handled here entirely without JavaScript at all.

PostCSS Alternative

By Chris Coyier on

After I wrote up my Basic CSS Processing Setup that used Lightning CSS, Michael Bishop responded saying he uses PostCSS for essentially the same thing, with a forked repo demonstrating. I think Michael has a good point that PostCSS has a built-in watcher which simplifies the setup nicely. And postcss-preset-env is very similar in spirit, […]

Auto-Sizing Textarea

By Chris Coyier on

Credit to Stephen Shaw for the original idea, there is a decently easy way to make an auto-sizing <textarea> element. It is here. But it’s not perfect. There is a frustrating hard-to-replicate iOS bug. Plus it’s just a trick. It requires JavaScript and some pretty specific CSS to pull off. It’s awesome to see the […]

Still No CSS Reset

By Chris Coyier on

Happy New Year ya’ll! While we’re all thinking about taking the opportunity to do various resets on our lives, I’ll take the opportunity to mention CSS resets. As a CSS nerd, I love looking at people’s different takes on what a modern CSS reset could or should be, like I did recently. But that doesn’t […]

Vertical Centering in a Block-Level Element

By Chris Coyier on

Rachel Andrew, blowing my mind a bit: The align-content property from the Box Alignment spec does the job, however browsers require that you make the parent element either a flex or a grid layout. While the property was specified to work in block layout, no browser had implemented it, until now. align-content in block layout So now […]

Did you know?

Frontend Masters Donates to open source projects. $363,806 contributed to date.