In Defense of the Ternary Statement

Some months ago I was on Hacker News (as one does) and I ran across a (now deleted) article about not using if statements. If you’re new to this idea | Continue reading


@css-tricks.com | 5 years ago

The Serif Tax

Fonts are vector. Vector art with more points makes for larger files than vector art with fewer points. Custom fonts are downloaded. So, fonts with less | Continue reading


@css-tricks.com | 5 years ago

Using a Mixin to Take the Math out of Responsive Font Sizes

Responsive Font Size (RFS) is an engine that automatically calculates and updates the font-size property on elements based on the dimensions of the | Continue reading


@css-tricks.com | 5 years ago

Native Lazy Loading

IntersectionObserver has made lazy loading a lot easier and more efficient than it used to be, but to do it really right you still gotta remove the src | Continue reading


@css-tricks.com | 5 years ago

Testing for Visual Regressions with Percy

It’s a Herculean task to test | Continue reading


@css-tricks.com | 5 years ago

Undefined: The Third Boolean Value

I wanted to implement a notification message in one of my projects, similar to what you’d see in Google Docs while a document is saving. In other words, a | Continue reading


@css-tricks.com | 5 years ago

Decaying Sites

Websites have a tendency to decay all by themselves. Link rot, they call it. Unpaid domain name registrations. Companies that have gone out of business. | Continue reading


@css-tricks.com | 5 years ago

Fixed Headers, On-Page Links, and Overlapping Content, Oh My!

Let's take a basic on-page link: Section Two When clicked, the browser will scroll itself to the element with that ID: . A browser feature as old as | Continue reading


@css-tricks.com | 5 years ago

What Are Design Tokens?

I’ve been hearing a lot about design tokens lately, and although I’ve never had to work on a project that’s needed them, I think they’re super interesting | Continue reading


@css-tricks.com | 5 years ago

Make it hard to screw up driven development

Development is complicated. Our job is an ongoing battle between getting the job done and doing that job in a safe, long-lasting way. Developers say | Continue reading


@css-tricks.com | 5 years ago

Form Validation in Under an Hour with Vuelidate

Form validation has a reputation for being tricky to implement. In this tutorial, we’ll break things down to alleviate some of that pain. Creating nice | Continue reading


@css-tricks.com | 5 years ago

Yet Another JavaScript Framework

On March 6, 2018, a new bug was added to the official Mozilla Firefox browser bug tracker. A developer had noticed an issue with Mozilla's nightly build. | Continue reading


@css-tricks.com | 5 years ago

Differential Serving

There is "futuristic" JavaScript that we can write. "Stage 0" refers to ideas for the JavaScript language that are still proposals. Still, someone might | Continue reading


@css-tricks.com | 5 years ago

Creating a Reusable Pagination Component in Vue

The idea behind most of web applications is to fetch data from the database and present it to the user in the best possible way. When we deal with data | Continue reading


@css-tricks.com | 5 years ago

CSS Houdini Could Change the Way We Write and Manage CSS

CSS Houdini may be the most exciting development in CSS. Houdini is comprised of a number of separate APIs, each shipping to browsers separately, and some | Continue reading


@css-tricks.com | 5 years ago

Jetpack Gutenberg Blocks

I remember when Gutenberg was released into core, because I was at WordCamp US that day. A number of months have gone by now, so I imagine more and more | Continue reading


@css-tricks.com | 5 years ago

A Gutenburg-Powered Newsletter

I like Gutenberg, the new WordPress editor. I'm not oblivious to all the conversation around accessibility, UX, and readiness, but I know how hard it is | Continue reading


@css-tricks.com | 5 years ago

Next Genpm

So many web projects use npm to pull in their dependencies, for both the front end and back. npm install and away it goes, pulling thousands of files into | Continue reading


@css-tricks.com | 5 years ago

Better Than Native

Andy Bell wrote up his thoughts about the whole web versus native app debate which I think is super interesting. It was hard to make it through the post | Continue reading


@css-tricks.com | 5 years ago

Breaking CSS Custom Properties out of :root Might Be a Good Idea

CSS Custom Properties have been a hot topic for a while now, with tons of great articles about them, from great primers on how they work to creative | Continue reading


@css-tricks.com | 5 years ago

When to Use Target=“_blank”

Anchor links1 may have a target attribute which controls what happens when that link is clicked. One of the possible values of that attribute is _blank, | Continue reading


@css-tricks.com | 5 years ago

An Illustrated (and Musical) Guide to Map, Reduce, and Filter Array Methods

Map, reduce, and filter are three very useful array methods in JavaScript that give developers a ton of power in a short amount of space. Let’s jump right | Continue reading


@css-tricks.com | 5 years ago

Understanding Event Emitters

Consider, a DOM Event: const button = document.querySelector("button"); button.addEventListener("click", (event) => /* do something with the event */) We | Continue reading


@css-tricks.com | 5 years ago

Simple & Boring

Simplicity is a funny adjective in web design and development. I'm sure it's a quoted goal for just about every project ever done. Nobody walks into a | Continue reading


@css-tricks.com | 5 years ago

All About mailto: Links

You can make a garden variety anchor link () open up a new email. Let's take a little journey into this feature. It's pretty easy to use, but as with | Continue reading


@css-tricks.com | 5 years ago

Advanced Tooling for Web Components

Over the course of the last four articles in this five-part series, we’ve taken a broad look at the technologies that make up the Web Components | Continue reading


@css-tricks.com | 5 years ago

Using for Menus and Dialogs is an Interesting Idea

One of the most empowering things you can learn as a new front-end developer who is starting to learn JavaScript is to change classes. If you can change | Continue reading


@css-tricks.com | 5 years ago

It’s pretty cool how Netlify CMS works with any flat file site generator

Little confession here: when I first saw Netlify CMS at a glance, I thought: cool, maybe I'll try that someday when I'm exploring CMSs for a new project. | Continue reading


@css-tricks.com | 5 years ago

Encapsulating Style and Structure with Shadow DOM

This is part four of a five-part series discussing the Web Components specifications. In part one, we took a 10,000-foot view of the specifications and | Continue reading


@css-tricks.com | 5 years ago

Blurred Borders in CSS

Say we want to target an element are just visually blur the border of it. There is no simple, single built-in web platform feature we can reach for. But | Continue reading


@css-tricks.com | 5 years ago

Some Notes About Accessibility

Earlier this month Eric Bailey wrote about the current state of accessibility on the web and why it felt like fighting an uphill battle: As someone with a | Continue reading


@css-tricks.com | 5 years ago

Creating a Custom Element from Scratch

In the last article, we got our hands dirty with Web Components by creating an HTML template that is in the document but not rendered until we need it. | Continue reading


@css-tricks.com | 5 years ago

Chrome Lite Pages

The Chrome team announced a new feature called Lite Pages that can be activated by flipping on the Data Saver option on an Android device: Chrome on | Continue reading


@css-tricks.com | 5 years ago

Using Local with Flywheel

Have you seen Local by Flywheel? It's a native app for helping set up local WordPress developer environments. I absolutely love it and use it to do all my | Continue reading


@css-tricks.com | 5 years ago

Stacked “Borders”

A little while back, I was in the process of adding focus styles to An Event Apart’s web site. Part of that was applying different focus effects in | Continue reading


@css-tricks.com | 5 years ago

Crafting Reusable HTML Templates

In our last article, we discussed the Web Components specifications (custom elements, shadow DOM, and HTML templates) at a high-level. In this article, | Continue reading


@css-tricks.com | 5 years ago

The Whole Spreadsheets as Databases Thing is Pretty Cool

A spreadsheet has always been a strong (if fairly literal) analogy for a database. A database has tables, which is like a single spreadsheet. Imagine a | Continue reading


@css-tricks.com | 5 years ago

An Introduction to Web Components

Front-end development moves at a break-neck pace. This is made evident by the myriad articles, tutorials, and Twitter threads bemoaning the state of what | Continue reading


@css-tricks.com | 5 years ago

People Digging into Grid Sizing and Layout Possibilities

Jen Simmons has been coining the term intrinsic design, referring to a new era in web layout where the sizing of content has gone beyond fluid columns and | Continue reading


@css-tricks.com | 5 years ago

Design Systems and Portfolios

In my experience working with design systems, I’ve found that I have to sacrifice my portfolio to do it well. Unlike a lot of other design work where it’s | Continue reading


@css-tricks.com | 5 years ago

Web Standards Meet User-Land: Using CSS-in-JS to Style Custom Elements

The popularity of CSS-in-JS has mostly come from the React community, and indeed many CSS-in-JS libraries are React-specific. However, Emotion, the most | Continue reading


@css-tricks.com | 5 years ago

Little Things That Tickled My Brain from An Event Apart Seattle

I had so much fun at An Event Apart Seattle! There is something nice about sitting back and basking in the messages from a variety of such super smart | Continue reading


@css-tricks.com | 5 years ago

7 things you should know when getting started with Serverless APIs

I want you to take a second and think about Twitter, and think about it in terms of scale. Twitter has 326 million users. Collectively, we create ~6,000 | Continue reading


@css-tricks.com | 5 years ago

The Benefits of Structuring CSS Around Appearance and Layout

I like this point that Jonathan Snook made on Twitter and I’ve been thinking about it non-stop because it describes something that’s really hard about | Continue reading


@css-tricks.com | 5 years ago

Planning for Responsive Images

The first time I made an image responsive, it was as simple as coding these four lines: img { max-width: 100%; height auto; /* default */ } Though that | Continue reading


@css-tricks.com | 5 years ago

Smooth Scrolling for Screencasts

Let's say you wanted to scroll a web page from top to bottom programmatically. For example, you're recording a screencast and want a nice full-page | Continue reading


@css-tricks.com | 5 years ago

Getting into GraphQL with AWS AppSync

GraphQL is becoming increasingly popular. The problem is that if you are a front-end developer, you are only half of the way there. GraphQL is not just a | Continue reading


@css-tricks.com | 5 years ago

Downsides of Smooth Scrolling

Smooth scrolling has gotten a lot easier. If you want it all the time on your page, and you are happy letting the browser deal with the duration for you, | Continue reading


@css-tricks.com | 5 years ago