Home/CSS-Tricks
Source

CSS-Tricks

1,103 articles from CSS-Tricks.

Frontend — Bulletproof flag components

Bulletproof flag components

A clever use of CSS grid from Jay Freestone to accomplish a particular variation of the media object design pattern (where the image is centered with the

CCChris Coyier·January 29, 2021Frontend
Frontend — GreenSock ScrollTrigger

GreenSock ScrollTrigger

High five to the Greensock gang for the ScrollTrigger release. The point of this new plugin is triggering animation when a page scrolls to certain positions,

CCChris Coyier·January 28, 2021Frontend
Frontend — A Whole Website in a Single HTML File

A Whole Website in a Single HTML File

I can’t stop thinking about this site. It looks like a pretty standard fare; a website with links to different pages. Nothing to write home about except

RRRobin RendleRobin Rendle·January 28, 2021Frontend
Frontend — The Holy Grail Layout with CSS Grid

The Holy Grail Layout with CSS Grid

How to build a very common layout with CSS grid. Header on the top, footer on the bottom. Two columns, sidebar and main content. This one has navigation above the main content but within that same column.

CCChris Coyier·January 27, 2021Frontend
SRE & Ops — Monorepo

Monorepo

I'm not exactly a large-scale DevOps guy, but I can tell ya we've been moving back toward a monorepo at CodePen and it's rife with advantages over a system

CCChris Coyier·January 26, 2021SRE & Ops
Frontend — New in Chrome 88: aspect-ratio

New in Chrome 88: aspect-ratio

And it was released yesterday! The big news for us in CSS Land is that the new release supports the aspect-ratio property. This comes right on the heels of

GGGeoff GrahamGeoff Graham·January 20, 2021Frontend
Frontend — Life with ESM

Life with ESM

ESM, meaning ES Modules, meaning JavaScript Modules. Like, import and friends.

CCChris Coyier·January 19, 2021Frontend
Networking — Netlify Edge Handlers

Netlify Edge Handlers

Netlify Edge Handlers are in Early Access (you can request it), but they are super cool and I think they are worth wrapping your brain around now. I think

CCChris Coyier·January 19, 2021Networking
Frontend — AnimXYZ

AnimXYZ

There are quite a few CSS animation libraries. They tend to be a pile of class names that you can apply as needed like "bounce" or "slide-right" and it'll...

CCChris Coyier·January 18, 2021Frontend
Frontend — State of JavaScript 2020

State of JavaScript 2020

We rounded up a bunch of published 2020 annual reports right before the year ended and compiled them into a big ol' list. The end of the list called out a

GGGeoff GrahamGeoff Graham·January 18, 2021Frontend
Frontend — On Auto-Generated Atomic CSS

On Auto-Generated Atomic CSS

Robin Weser's "The Shorthand-Longhand Problem in Atomic CSS" in an interesting journey through a tricky problem. The point is that when you take on the job of

CCChris Coyier·January 15, 2021Frontend
Engineering — Painters Tape and Fault Tolerance

Painters Tape and Fault Tolerance

One of my favorite things in the world is painters tape (also called masking tape). It seems like something silly: some tape you put on a wall when you’re painting to avoid getting paint on the wall. The tape doesn’t have a strong adhesive, so it can be pulled back off the wall without damaging it.

CCChris Coyier·January 8, 2021Engineering
Design & UX — Svelte and Spring Animations

Svelte and Spring Animations

Spring animations are a wonderful way to make UI interactions come to life. Rather than merely changing a property at a constant rate over a period of time,

ARAdam RackisAdam Rackis·January 8, 2021Design & UX
Frontend — Styling Code In and Out of Blocks

Styling Code In and Out of Blocks

There is a <code> tag in HTML. I literally just used it to wrap that tag in the previous sentence — so meta. It is an inline-by-default element that

CCChris Coyier·January 6, 2021Frontend
Frontend — Whack-a-Mole: The CSS Edition

Whack-a-Mole: The CSS Edition

We’ve seen the checkbox hack and how it can be used to build a complete state machine in CSS. Today, we’ll take that line of thought a step further and build

WYWill YuWill Yu·January 6, 2021Frontend
Frontend — Custom Properties as State

Custom Properties as State

Here's a fun idea from James Stanley: a CSS file (that presumably updates daily) containing CSS custom properties for "seasonal" colors (e.g. spring is

CCChris Coyier·January 5, 2021Frontend
Engineering — Cloudinary Tricks for Video

Cloudinary Tricks for Video

Creating video is time consuming. A well-made 5-minute video can take hours to plan, record, and edit — and that's before we start talking about

JLJason LengstorfJason Lengstorf·December 30, 2020Engineering
Frontend — Integrating TypeScript with Svelte

Integrating TypeScript with Svelte

Svelte is one of the newer JavaScript frameworks and it’s rapidly rising in popularity. It’s a template-based framework, but one which allows for arbitrary

ARAdam RackisAdam Rackis·December 24, 2020Frontend
Frontend — "Yes or No?"

"Yes or No?"

Sara Soueidan digs into this HTML/UX situation. "Yes" or "no" is a boolean situation. A checkbox represents this: it's either on or off (uh, mostly). But is a

CCChris Coyier·December 22, 2020Frontend
Frontend — Recognizing Constraints

Recognizing Constraints

There’s a “C” word in web development that we don’t give enough attention to. No, I’m not talking about “continuous integration”, or even “CSS”. The “C” word

JWJeremy Wagner·December 22, 2020Frontend
Career & Teams — Retrospective on Fela

Retrospective on Fela

I really appreciate a real-world walkthrough of a technology. Not only in what that technology does, but why it was chosen and how it worked for a team.

CCChris Coyier·December 21, 2020Career & Teams
Engineering — Optimizing Image Depth

Optimizing Image Depth

Something I learned (or, I guess, re-learned) this year is how important it is to pay close attention to the bit depth of images. Way back in the day, we used

EMEric MeyerEric Meyer·December 18, 2020Engineering
Engineering — Change vs. Inertia

Change vs. Inertia

Recently, I've become more deeply aware of the inherent tension between change and inertia, as it applies to the evolution and use of web technologies. These

KSKyle Simpson·December 18, 2020Engineering
Engineering — What's Old is New

What's Old is New

This year, I learned a lot about how "old" tricks can solve a lot of modern problems if you use the right tools. Following the growth of Jamstack-style

CWCassidy WilliamsCassidy Williams·December 17, 2020Engineering
Frontend — Write Code, Get Confetti

Write Code, Get Confetti

This year I learned about the canvas-confetti npm package. It is a simple JavaScript package that injects a (virtual, <canvas>) confetti explosion into

FSFred Schott·December 16, 2020Frontend
Engineering — Learning to Simplify

Learning to Simplify

When I first got this writing prompt, my mind immediately started thinking stuff like, “What tech have I learned this year?” But this post isn’t really about

ABAndy BellAndy Bell·December 16, 2020Engineering
Performance — Slow Movement

Slow Movement

There was a time when I felt overwhelmed by how fast the web developed. It seemed like not a single day passed without a new plugin, framework, technique, or

MMManuel Matuzovic·December 16, 2020Performance
Engineering — The Power of Lampshading

The Power of Lampshading

I enjoyed this blog post from Shawn. Lampshading is apparently the idea of a TV show calling attention to some weakness (like an implausible plot point) so

CCChris Coyier·December 16, 2020Engineering
Frontend — Hell Yes! CSS!

Hell Yes! CSS!

Speaking of cool CSS stuff you can buy, Julia Evans' zine Hell Yes! CSS! is hot off the presses. A "zine" being 28 pages of "short, informative, and fun

CCChris Coyier·December 15, 2020Frontend
Frontend — Give Users Control: The Media Session API

Give Users Control: The Media Session API

Here’s a scenario. You start a banging Kendrick Lamar track in one of your many open browser tabs. You’re loving it, but someone walks into your space and you

IUIdorenyin UdohIdorenyin Udoh·December 14, 2020Frontend
Engineering — Why I love Tailwind

Why I love Tailwind

Max Stoiber wrote some interesting notes about why he loves Tailwind. (Max created styled-components, so he has some skin in the styling methodology game.)

RRRobin RendleRobin Rendle·December 11, 2020Engineering
Engineering — Unconventional Stock Image Sources

Unconventional Stock Image Sources

This year, I learned that there is a wide world of free stock imagery available beyond Unsplash and Pexels. You see, I’ve been working on designing WordPress

MCMel ChoyceMel Choyce·December 10, 2020Engineering