Help Shape the Future of CSS-Tricks!

Hey, so it’s been a minute since we announced that CSS-Tricks is now part of the DigitalOcean family. Things are pretty much business as usual and hopefully it feels that way to you, too. Now that we’re getting settled, we’re … Help Shape the Future of CSS-Tricks! originally publ … | Continue reading


@css-tricks.com | 1 year ago

My Dumbest CSS Mistakes

We all make mistakes in our code. It happens! I know if I had one of those “Days Since Last Mistake” signs hanging over my desk, a big ol’ goose egg would be hovering above me all the time. It … My Dumbest CSS Mistakes originally published on CSS-Tricks. You should get the newsle … | Continue reading


@css-tricks.com | 1 year ago

Great (and Free!) Web Development Books You Can Get Online

Right after “Where is the best place to learn?” perhaps the most commonly asked question I hear from folks getting into code is “What web development books should I get to learn?” Well, consider this an answer to that question … Great (and Free!) Web Development Books You Can Get … | Continue reading


@css-tricks.com | 1 year ago

Single Element Loaders: The Bars

We’ve looked at spinners. We’ve looked at dots. Now we’re going to tackle another common pattern for loaders: bars. And we’re going to do the same thing in this third article of the series as we have the others … Single Element Loaders: The Bars originally published on CSS-Tricks … | Continue reading


@css-tricks.com | 1 year ago

Different Ways to Write CSS in React

We’re all familiar with the standard way of linking up a stylesheet to the of an HTML doc, right? That’s just one of several ways we’re able to write CSS. But what does it look like to style things … Different Ways to Write CSS in React originally published on CSS-Tricks. You sh … | Continue reading


@css-tricks.com | 1 year ago

Single Element Loaders: The Dots

We’re looking at loaders in this series. More than that, we’re breaking down some common loader patterns and how to re-create them with nothing more than a single div. So far, we’ve picked apart the classic spinning loader. Now, … Single Element Loaders: The Dots originally publi … | Continue reading


@css-tricks.com | 1 year ago

Conditionally Styling Selected Elements in a Grid Container

Calendars, shopping carts, galleries, file explorers, and online libraries are some situations where selectable items are shown in grids (i.e. square lattices). You know, even those security checks that ask you to select all images with crosswalks or whatever. 🧐… Conditio … | Continue reading


@css-tricks.com | 1 year ago

De-Mystifying IndieWeb on a WordPress Site

Well, sheesh. I opened a little can of worms when sharing Miriam’s “Am I on the IndieWeb yet?” with a short post bemoaning my own trouble getting on the IndieWeb train. But it’s a good can of worms. I think … De-Mystifying IndieWeb on a WordPress Site originally published on CSS- … | Continue reading


@css-tricks.com | 1 year ago

Useful Tools for Visualizing Databases on a Budget

A diagram is a graphical representation of information that depicts the structure, relationship, or operation of anything. Diagrams enable your audience to visually grasp hidden information and engage with them in ways that words alone cannot. Depending on the type … Useful Tools … | Continue reading


@css-tricks.com | 1 year ago

Single Element Loaders: The Spinner

Making CSS-only loaders is one of my favorite tasks. It’s always satisfying to look at those infinite animations. And, of course, there are lots of techniques and approaches to make them — no need to look further than CodePen to … Single Element Loaders: The Spinner originally pu … | Continue reading


@css-tricks.com | 1 year ago

Am I on the IndieWeb yet?

Can’t smash the Like button hard enough for what Miriam Suzanne has to say on the challenging technical hurdles of implementing Webmentions: The first round required several online services along with HTML & JS changes to my static site, just to verify my … Am I on the IndieWeb … | Continue reading


@css-tricks.com | 1 year ago

Let’s Make a QR Code Generator With a Serverless Function!

QR codes are funny, right? We love them, then hate them, then love them again. Anyways, they’ve lately been popping up again and it got me thinking about how they’re made. There are like a gazillion QR code generators out … Let’s Make a QR Code Generator With a Serverless Functio … | Continue reading


@css-tricks.com | 1 year ago

Building Interoperable Web Components That Even Work With React

Those of us who’ve been web developers more than a few years have probably written code using more than one JavaScript framework. With all the choices out there — React, Svelte, Vue, Angular, Solid — it’s all but inevitable. One … Building Interoperable Web Components That Even W … | Continue reading


@css-tricks.com | 1 year ago

Please Give Me Some Space

There’s all kinds of ways to do that. Some more advisable and better-suited for certain situations than others, of course. We could do it directly in HTML: | Continue reading


@css-tricks.com | 1 year ago

How to Create Block Theme Patterns in WordPress 6.0

Block patterns, also frequently referred to as sections, were introduced in WordPress 5.5 to allow users to build and share predefined block layouts in the pattern directory. The directory is the home of a wide range of … How to Create Block Theme Patterns in WordPress 6.0 origin … | Continue reading


@css-tricks.com | 1 year ago

SPAs, Shared Element Transitions, and Re-Evaluating Technology

Nolan Lawson sparked some discussion when he described a noticeable shift away from single-page applications (SPAs): Hip new frameworks like Astro, Qwik, and Elder.js are touting their MPA [multi-page application] with “0kB JavaScript by default.” … SPAs, Shared Element Transiti … | Continue reading


@css-tricks.com | 1 year ago

Just How Long Should Alt Text Be?

I teach a class over at the local college here in Long Beach and a majority of the content is hosted on the Canvas LMS so students can access it online. And, naturally, I want the content to be as … Just How Long Should Alt Text Be? originally published on CSS-Tricks. You should … | Continue reading


@css-tricks.com | 1 year ago

Beautify GitHub Profile

It wasn’t long ago that Nick Sypteras showed us how to make custom badges for a GitHub repo. Well, Reza Shakeri put Beautify GitHub Profile together and it’s a huuuuuuge repo of different badges that pulls lots of examples … Beautify GitHub Profile originally published on CSS-Tri … | Continue reading


@css-tricks.com | 1 year ago

Cool CSS Hover Effects That Use Background Clipping, Masks, and 3D

We’ve walked through a series of posts now about interesting approaches to CSS hover effects. We started with a bunch of examples that use CSS background properties, then moved on to the text-shadow property where we technically didn’t use … Cool CSS Hover Effects That Use Backgr … | Continue reading


@css-tricks.com | 1 year ago

Customizing Color Fonts on the Web

Myles C. Maxfield on the WebKit Blog published a nifty how-to for color fonts. It comes on the heels of what Ollie wrote up here on CSS-Tricks the other day, and while they cover a lot of common … Customizing Color Fonts on the Web originally published on CSS-Tricks. You should g … | Continue reading


@css-tricks.com | 1 year ago

A Perfect Table of Contents With HTML + CSS

Earlier this year, I self-published an ebook called Understanding JavaScript Promises (free for download). Even though I didn’t have any intention of turning it into a print book, enough people reached out inquiring about a print version that … A Perfect Table of Contents With HT … | Continue reading


@css-tricks.com | 1 year ago

Mastering SVG’s stroke-miterlimit Attribute

So, SVG has this stroke-miterlimit presentation attribute. You’ve probably seen it when exporting an SVG from a graphic editor program, or perhaps you find out you could remove it without noticing any change to the visual appearance. After a good … Mastering SVG’s stroke-miterlim … | Continue reading


@css-tricks.com | 1 year ago

First Look At The CSS object-view-box Property

Ahmad Shadeed — doing what he always does so well — provides an early look at the object-view-box property, something he describes as a native way to crop an image in the browser with CSS. The use case? Well, … First Look At The CSS object-view-box Property originally published o … | Continue reading


@css-tricks.com | 1 year ago

Dialog Components: Go Native HTML or Roll Your Own?

As the author of a library called AgnosticUI, I’m always on the lookout for new components. And recently, I decided to dig in and start work on a new dialog (aka modal) component. That’s something many devs like to … Dialog Components: Go Native HTML or Roll Your Own? originally … | Continue reading


@css-tricks.com | 1 year ago

Verevolf

Zeldman: You may not know his name, but he played a huge part in creating the web you take for granted today. And he’s back—kind of. That would be Glenn Davis and the Verevolf site Zeldman’s talking about. The … Verevolf originally published on CSS-Tricks. You should get the news … | Continue reading


@css-tricks.com | 1 year ago

Inline Image Previews with Sharp, BlurHash, and Lambda Functions

Don’t you hate it when you load a website or web app, some content displays and then some images load — causing content to shift around? That’s called content reflow and can lead to an incredibly annoying user experience for … Inline Image Previews with Sharp, BlurHash, and Lambd … | Continue reading


@css-tricks.com | 1 year ago

An Interactive Starry Backdrop for Content

I was fortunate last year to get approached by Shawn Wang (swyx) about doing some work for Temporal. The idea was to cast my creative eye over what was on the site and come up with some … An Interactive Starry Backdrop for Content originally published on CSS-Tricks. You should ge … | Continue reading


@css-tricks.com | 1 year ago

Improving Icons for UI Elements with Typographic Alignment and Scale

Utilizing icons in user interface elements is helpful. In addition to element labeling, icons can help reinforce a user element’s intention to users. But I have to say, I notice a bit of icon misalignment while browsing the web. Even … Improving Icons for UI Elements with Typogra … | Continue reading


@css-tricks.com | 1 year ago

Creating Style Variations in WordPress Block Themes

Global styles, a feature of the block themes, is one of my favorite parts of creating block themes. The concept of global style variations in WordPress were introduced in Gutenberg 12.5 which would allow theme authors to create alternate … Creating Style Variations in WordPress B … | Continue reading


@css-tricks.com | 1 year ago

Cool Hover Effects That Use CSS Text Shadow

In my last article we saw how CSS background properties allow us to create cool hover effects. This time, we will focus on the CSS text-shadow property to explore even more interesting hovers. You are probably wondering how adding shadow … Cool Hover Effects That Use CSS Text Sha … | Continue reading


@css-tricks.com | 1 year ago

A CSS Slinky in 3D? Challenge Accepted!

Braydon Coyer recently launched a monthly CSS art challenge. He actually had reached out to me about donating a copy of my book Move Things with CSS to use as a prize for the winner of the challenge — … A CSS Slinky in 3D? Challenge Accepted! originally published on CSS-Tricks. Y … | Continue reading


@css-tricks.com | 1 year ago

COLRv1 and CSS font-palette: Web Typography Gets Colorful

According to Toshi Omagari, the author of Arcade Game Typography, the world’s first multi-colored digital font was created in 1982 for a never-released video game called Insector. Multi-colored fonts, sometimes called chromatic type, are still relatively rare on the … COLRv1 and … | Continue reading


@css-tricks.com | 1 year ago

Let’s Create a Tiny Programming Language

By now, you are probably familiar with one or more programming languages. But have you ever wondered how you could create your own programming language? And by that, I mean: A programming language is any set of rules that convert … Let’s Create a Tiny Programming Language origin … | Continue reading


@css-tricks.com | 1 year ago

Useful Tools for Creating AVIF Images

AVIF (AV1 Image File Format) is a modern image file format specification for storing images that offer a much more significant file reduction when compared to other formats like JPG, JPEG, PNG, and WebP. Version 1.0.0 of the AVIF specification … Useful Tools for Creating AVIF Ima … | Continue reading


@css-tricks.com | 1 year ago

How to Serve a Subdomain as a Subdirectory

Let’s say you have a website built on a platform that excels at design and it’s available at example.com. But that platform falls short at blogging. So you think to yourself, “What if I could use a different blogging … How to Serve a Subdomain as a Subdirectory originally publish … | Continue reading


@css-tricks.com | 1 year ago

Syntax Highlighting (and More!) With Prism on a Static Site

So, you’ve decided to build a blog with Next.js. Like any dev blogger, you’d like to have code snippets in your posts that are formatted nicely with syntax highlighting. Perhaps you also want to display line numbers in the … Syntax Highlighting (and More!) With Prism on a Static … | Continue reading


@css-tricks.com | 1 year ago

Adding Custom GitHub Badges to Your Repo

If you’ve spent time looking at open-source repos on GitHub, you’ve probably noticed that most of them use badges in their README files. Take the official React repository, for instance. There are GitHub badges all over the README file that communicate important dynamic info, lik … | Continue reading


@css-tricks.com | 1 year ago

Creating Realistic Reflections With CSS

In design, reflections are stylized mirror images of objects. Even though they are not as popular as shadows, they have their moments — just think about the first time you explored the different font formats in MS Word or PowerPoint: … Creating Realistic Reflections With CSS orig … | Continue reading


@css-tricks.com | 1 year ago

Creating the DigitalOcean Logo in 3D With CSS

Howdy y’all! Unless you’ve been living under a rock (and maybe even then), you’ve undoubtedly heard the news that CSS-Tricks, was acquired by DigitalOcean. Congratulations to everyone! 🥳 As a little hurrah to commemorate the occasion, I wanted to … Creating the DigitalOce … | Continue reading


@css-tricks.com | 1 year ago

Setting Up CloudFront to Host Your Web App

In my last article, we went over how to set up a web app that serves chunks and bundles of CSS and JavaScript from CloudFront. We integrated it into Vite so that when the app runs in a browser, … Setting Up CloudFront to Host Your Web App originally published on CSS-Tricks. You s … | Continue reading


@css-tricks.com | 1 year ago

Cool Hover Effects That Use Background Properties

A while ago, Geoff wrote an article about a cool hover effect. The effect relies on a combination of CSS pseudo-elements, transforms, and transitions. A lot of comments have shown that the same effect can be done using background … Cool Hover Effects That Use Background Propertie … | Continue reading


@css-tricks.com | 1 year ago

Avoiding the Pitfalls of Nested Components in a Design System

When creating a component-based, front-end infrastructure, one of the biggest pain points I’ve personally encountered is making components that are both reusable and responsive when there are nested components within components. Take the following “call to action” (… Avoiding the … | Continue reading


@css-tricks.com | 2 years ago

Writing Strong Front-end Test Element Locators

Automated front-end tests are awesome. We can write a test with code to visit a page — or load up just a single component — and have that test code click on things or type text like a user would, … Writing Strong Front-end Test Element Locators originally published on CSS-Tricks. … | Continue reading


@css-tricks.com | 2 years ago

Adding Tailwind CSS to New and Existing WordPress Themes

In the 15 or so years since I started making WordPress websites, nothing has had more of an impact on my productivity — and my ability to enjoy front-end development — than adding Tailwind CSS to my workflow (and it … Adding Tailwind CSS to New and Existing WordPress Themes origi … | Continue reading


@css-tricks.com | 2 years ago

Making Mermaid Diagrams in Markdown

Mermaid diagrams and flowcharts have been gaining traction, especially with GitHub’s announcement that they are natively supported in Markdown. Let’s take a look at what they are, how to use them, and just as importantly: why. Just like you … Making Mermaid Diagrams in Markdown o … | Continue reading


@css-tricks.com | 2 years ago

Add a CSS Lens Flare to Photos for a Bright Touch

I’m a big fan of movies by J.J. Abrams. I enjoy their tight plots, quippy dialog, and of course: anamorphic lens flares. Filmmakers like Abrams use lens flare to add a dash of ‘homemade’ realism to their movies, … Add a CSS Lens Flare to Photos for a Bright Touch originally publi … | Continue reading


@css-tricks.com | 2 years ago

Adding CDN Caching to a Vite Build

Content delivery networks, or CDNs, allow you to improve the delivery of your website’s static resources, most notably, with CDN caching. They do this by serving your content from edge locations, which are located all over the world. When a … Adding CDN Caching to a Vite Build or … | Continue reading


@css-tricks.com | 2 years ago

Tricks to Cut Corners Using CSS Mask and Clip-Path Properties

We recently covered creating fancy borders with CSS mask properties, and now we are going to cut the corners with CSS mask and clip-path! A lot of techniques exist to cut different shapes from the corners of any element. … Tricks to Cut Corners Using CSS Mask and Clip-Path Proper … | Continue reading


@css-tricks.com | 2 years ago