Home/CSS-Tricks
Source

CSS-Tricks

1,207 articles from CSS-Tricks.

Frontend — Next.js on Netlify

Next.js on Netlify

If you want to put Next.js on Netlify, here's a 5 minute tutorial¹. One of the many strengths of Next.js is that it can do server-side rendering (SSR) with a

CCChris Coyier·February 28, 2021Frontend
Frontend — Hiding Content Responsibly

Hiding Content Responsibly

We've covered the idea of hiding things in CSS many times here, the most recent post being Marko Ilic's "Comparing Various Ways to Hide Things in CSS" which

CCChris Coyier·February 23, 2021Frontend
Design & UX — Getting Deep Into Shadows

Getting Deep Into Shadows

Let’s talk shadows in web design. Shadows add texture, perspective, and emphasize the dimensions of objects. In web design, using light and shadow can add

RORob O'LearyRob O'Leary·February 22, 2021Design & UX
Frontend — Three Ways to Blob with CSS and SVG

Three Ways to Blob with CSS and SVG

Blobs are the smooth, random, jelly-like shapes that have a whimsical quality and are just plain fun. They can be used as illustration elements and background

AMAkash MittalAkash Mittal·February 19, 2021Frontend
Frontend — Barebones CSS for Fluid Images

Barebones CSS for Fluid Images

Zach takes a look at some fundamental HTML+CSS usage for fluid, responsive images. Most of it, I'd say, is what you'd expect, but things get weird when srcset

CCChris Coyier·February 18, 2021Frontend
Frontend — Let’s Create a Custom Audio Player

Let’s Create a Custom Audio Player

HTML has a built-in native audio player interface that we get simply using the <audio> element. Point it to a sound file and that’s all there is to it.

IUIdorenyin UdohIdorenyin Udoh·February 18, 2021Frontend
Security — WordPress 5.7: Big ol' jQuery Update

WordPress 5.7: Big ol' jQuery Update

WordPress core is making the jump from jQuery 1.12.4 to jQuery 3.5.1! This is a big deal for lots of reasons — like modern features, better DX, and security

GGGeoff GrahamGeoff Graham·February 11, 2021Security
Engineering — iframe feedback

iframe feedback

What if an <iframe> had within it another <iframe> of the exact same source? Inception, as they say. Baptise Crespy does this all-important

CCChris Coyier·February 11, 2021Engineering
Frontend — Nested Media Queries

Nested Media Queries

We don't have "regular" nesting in CSS. Maybe this becomes a thing someday, or something like it. That would be cool, although that pre-spec doesn't mention

CCChris Coyier·February 9, 2021Frontend
Engineering — "Cancelable" Smooth Scrolling

"Cancelable" Smooth Scrolling

Here's the situation: Your site offers a "scroll back to top" button, and you've implemented smooth scrolling. As the page scrolls back to the top, users see

CCChris Coyier·February 1, 2021Engineering
Frontend — No-Jank CSS Stripes

No-Jank CSS Stripes

My mind goes immediately to repeating-linear-gradient and hard-stop gradients when thinking of creating stripes in CSS. You make one stripe by using the same

CCChris Coyier·February 1, 2021Frontend
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